Hello,
I’m trying to run (and package for nixpkgs) the kDrive AppImage but I’m running into issues.
I ran the AppImage with appimage-run
but the app just fails with a non-helpful error message:
kDrive server initialization error: Unable to open parameters database.
So, I went straight ahead to packaging it instead, without further success (and the same error).
I looked at the AppImage content which is extracted in a .cache
directory in my home after trying to run it with appimage-run
. Did some ldd
on the binaries to get the list of dependencies and came up with the following package « derivation » (I don’t think it’s a derivation per se, but whatever):
{ appimageTools, fetchurl, lib, stdenv }:
let
pname = "kDrive";
version = "3.5.5.20231213";
srcs = {
x86_64-linux = fetchurl {
url = "https://download.storage.infomaniak.com/drive/desktopclient/kDrive-${version}-amd64.AppImage";
sha256 = "sha256-DWnh2f5ZKq+znmgpxn84LG9sZl3FdDOxgJq+/06S4Xo=";
};
aarch64-linux = fetchurl {
url = "https://download.storage.infomaniak.com/drive/desktopclient/kDrive-${version}-arm64.AppImage";
#sha256 = ""; # TODO
};
x86_64-darwin = fetchurl {
url = "https://download.storage.infomaniak.com/drive/desktopclient/kDrive-${version}.pkg";
#sha256 = ""; # TODO
};
};
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
meta = with lib; {
description = "kDrive desktop synchronization client.";
homepage = "https://www.infomaniak.com/kdrive";
license = licenses.unlicense;
platforms = builtins.attrNames srcs;
maintainers = [ maintainers.nicolas-goudry ];
mainProgram = "kDrive";
};
contents = appimageTools.extractType2 { inherit pname version src; };
linux = appimageTools.wrapType2 {
inherit pname version src meta;
#multiArch = false;
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ (with pkgs; [
alsa-lib
brotli
curl
cyrus_sasl
dbus
e2fsprogs
expat
gmp
freetype
fontconfig
gcc-unwrapped
glib
glibc
gnutls
heimdal
icu66
keyutils
libffi
libgcrypt
libgpg-error
libidn2
libjpeg
libkrb5
libpng
libpsl
libsecret
libselinux
libssh
libtasn1
libunistring
libxcrypt-legacy
libxkbcommon
libxml2
log4cplus
lz4
nettle
nghttp2
nspr
nss
openldap
openssl
p11-kit
pcre2
poco
qt6.full
rtmpdump
sentry-native
sqlite
systemd
util-linux
xorg.libxcb
xorg.libxkbfile
xorg.libxshmfence
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xxHash
xz
zlib
]);
extraInstallCommands = ''
mv $out/bin/${pname}-${version} $out/bin/${pname}
install -m 444 -D ${contents}/kDrive_client.desktop -t $out/share/applications
cp -r ${contents}/usr/share/icons $out/share
'';
};
darwin = stdenv.mkDerivation {
inherit pname version src meta;
dontBuild = true;
unpackPhase = ''
7z x $src
bsdtar -xf Payload~
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 usr/local/bin/kdrive -t $out/bin
runHook postInstall
'';
};
in
if stdenv.isDarwin
then darwin
else linux
(don’t mind the darwin part, it’s not relevant here and probably not working as-is, but I plan to add it later)
I tried to use strace
to find out what’s going on but I can’t find anything wrong (yet).
Does anybody have ideas, suggestions, pointers?
Thanks!