Glad to hear that we’re on the same page
Thanks for the clarification, I think I got confused by the similarity of ldd
and LD_...
.
I went ahead and removed the lib
directory, but since I couldn’t find the liblog4cplusU.so.9
library in Nix packages, I kept only this one from the AppImage content. I’m now left with this in my store:
$ nix shell 'nixpkgs#tree' -c tree -d -L 2
.
├── bin
├── lib
├── resources
├── share
│ ├── applications
│ ├── icons
│ ├── kDrive_client
│ └── mime
└── translations
└── qtwebengine_locales
While lib
contains only:
-r--r--r-- 1 root root 6,7M 1 janv. 1970 liblog4cplusU.so.9
I took a look at the Qt documentation in the Nixpkgs manual and went ahead to wrap kDrive
as a Qt application:
all-packages.nix
kdrive = qt6Packages.callPackage ../applications/misc/kdrive { };
kdrive/default.nix
stdenv.mkDerivation rec {
# ...
dontWrapQtApps = true;
buildInputs = [ qtbase ];
nativeBuildInputs = [ wrapQtAppsHook ];
# ...
postFixup = ''
# patchelf stuff
wrapQtApp $out/bin/kDrive
'';
}
Now, I can see the kDrive desktop entry in Gnome, but I still can’t run it somehow.
When running kDrive
I see again the initial error message, alongside a Qt error:
$ kDrive
kDrive server starting
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
kDrive server initialization error: Unable to open parameters database.
I can get rid of the Qt error by following what @Rigor1934 mentioned yesterday: adding QT_QPA_PLATFORM=xcb
. But the server initialization error remains.
Looking at the logs, I have this:
2024-02-07 16:05:16:140 [I] (140268897102400) log.cpp:126 - Logger initialization done
2024-02-07 16:05:16:141 [I] (140268897102400) appserver.cpp:2848 - kDrive locale:[en_US] version:[3.5.7master (build 20240124)] os:[NixOS 24.05 (Uakari)]
2024-02-07 16:05:16:141 [I] (140268897102400) appserver.cpp:166 - New DB exists : /home/nicolas/.config/kDrive/.parms.db => 1
2024-02-07 16:05:16:141 [I] (140268897102400) appserver.cpp:167 - Old config exists : /home/nicolas/.config/kDrive/kDrive.cfg => 1
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:562 - sqlite3 version=3.44.2
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:578 - sqlite3 locking_mode=normal
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:595 - sqlite3 journal_mode=wal
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:615 - sqlite3 synchronous=NORMAL
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:630 - sqlite3 case_sensitivity=ON
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:645 - sqlite3 foreign_keys=ON
2024-02-07 16:05:16:141 [D] (140268897102400) db.cpp:348 - Check DB version
2024-02-07 16:05:16:141 [I] (140268897102400) db.cpp:441 - Prepare DB
2024-02-07 16:05:16:142 [W] (140268897102400) parmsdb.cpp:611 - Cannot open exclusion templates file sync-exclude.lst
2024-02-07 16:05:16:142 [W] (140268897102400) parmsdb.cpp:1275 - Error in updateExclusionTemplates
2024-02-07 16:05:16:142 [W] (140268897102400) parmsdb.cpp:1224 - Error in initParameters
2024-02-07 16:05:16:142 [W] (140268897102400) db.cpp:443 - Error in Db::prepare
2024-02-07 16:05:16:142 [E] (140268897102400) db.cpp:649 - Database initialisation error
2024-02-07 16:05:16:142 [D] (140268897102400) db.cpp:241 - Closing DB /home/nicolas/.config/kDrive/.parms.db
2024-02-07 16:05:16:142 [D] (140268897102400) db.cpp:472 - No database Transaction to commit
At first, I thought it was a permissions issue with the sync-exclude.lst
file, so I tried to use install
instead of cp
to set its permissions to rw-rw-rw-
but it doesn’t work (and I think this is normal since the Nix store is and should remain read-only):
installPhase = ''
runHook preInstall
for dir in resources translations; do
mkdir -p $out/$dir
cp -R ${contents}/usr/$dir/* $out/$dir
done
mkdir -p $out/bin
install -m 0555 ${contents}/usr/bin/kDrive $out/bin
install -m 0555 ${contents}/usr/bin/kDrive_client $out/bin
install -m 0444 ${contents}/usr/bin/qt.conf $out/bin
install -m 0666 ${contents}/usr/bin/sync-exclude.lst $out/bin
ls -lah $out/bin
for dir in applications icons kDrive_client mime; do
mkdir -p $out/share/$dir
cp -R ${contents}/usr/share/$dir/* $out/share/$dir
done
mkdir -p $out/lib
cp -R ${contents}/usr/lib/liblog4cplusU.so.9 $out/lib
runHook postInstall
'';
Here is the bin
directory listing:
$ ls -lah bin
total 26M
dr-xr-xr-x 2 root root 4,0K 1 janv. 1970 .
dr-xr-xr-x 7 root root 4,0K 1 janv. 1970 ..
-r-xr-xr-x 1 root root 16K 1 janv. 1970 kDrive
-r-xr-xr-x 1 root root 12M 1 janv. 1970 kDrive_client
-r-xr-xr-x 1 root root 15M 1 janv. 1970 .kDrive-wrapped
-r--r--r-- 1 root root 108 1 janv. 1970 qt.conf
-r--r--r-- 1 root root 315 1 janv. 1970 sync-exclude.lst
No symbolic links, nothing. The sync-exclude.lst
file is read-only and I suspect this to be the issue.
I’m wondering if I could place the file somewhere else where it would be writable and create a symlink in the store location. I’ll try to do that later and keep you posted.
Thanks again for your help, let me know if you have any more of your good ideas/pointers
EDIT: I found a weird thing!
If I cd
in kDrive location in the Nix store, and run kDrive
from the bin
directory, it works! That’s so frustrating, I feel that I’m very close to make it work but I don’t fraking understand why it tries to load the file relatively from the PWD
…