Indeed, the project is incorrectly assuming that all python packages are installed to the same directory, which is not always the case – PYTHONPATH environment variable can be used.
Potentially interesting for this project is mesonpep517 which I am packaging and testing now. https://github.com/NixOS/nixpkgs/pull/72784
It basically offers Meson as a PEP 517 compliant build backend to build a wheel, which is then used as usual.
That said, I have stumbled upon yet another issue:
Message: Compiling resources
Configuring about_dialog.ui using configuration
Found pkg-config: /nix/store/0bkzr1nxk03c2sp8yym9lw3ay8ixgf2n-pkg-config-0.29.2/bin/pkg-config (0.29.2)
Traceback (most recent call last):
File "/nix/store/cyhaixglvnbny117lbsw66wjm1c3a0aa-meson-0.51.2/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 127, in run
return options.run_func(options)
...
FileNotFoundError: [Errno 2] No such file or directory: 'glib-compile-resources': 'glib-compile-resources'
Since it is called at build time, it also needs to be in nativeBuildInputs. Python packages pass strictDeps = true to mkDerivation by default, so they separate runtime and build time dependencies.
Thanks! That made it built. Another issue though: it’s complaining about a missing pwquality
Traceback (most recent call last):
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/bin/..gnome-passwordsafe-wrapped-wrapped", line 18, in <module>
from passwordsafe.application import Application
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/application.py", line 7, in <module>
from passwordsafe.main_window import MainWindow
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/main_window.py", line 5, in <module>
from passwordsafe.create_database import CreateDatabase
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/create_database.py", line 2, in <module>
from passwordsafe.created_database import CreatedDatabase
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/created_database.py", line 2, in <module>
from passwordsafe.unlock_database import UnlockDatabase
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/unlock_database.py", line 3, in <module>
from passwordsafe.unlocked_database import UnlockedDatabase
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/unlocked_database.py", line 4, in <module>
from passwordsafe.database_settings_dialog import DatabaseSettingsDialog
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/database_settings_dialog.py", line 7, in <module>
import passwordsafe.password_generator
File "/nix/store/al09bl02j7ynr363g4j0mxw5znr12jpm-passwordsafe-3.32.1/lib/python3.7/site-packages/passwordsafe/password_generator.py", line 3, in <module>
import pwquality
ModuleNotFoundError: No module named 'pwquality'
I couldn’t find any pwquality Python package in NixOS either.
Updated default.nix:
{
stdenv, fetchgit, makeWrapper, wrapGAppsHook,
libhandy, libpwquality, python3Packages, gtk3, glib,
meson, ninja, pkgconfig, cmake, gobject-introspection,
}:
python3Packages.buildPythonApplication rec {
pname = "passwordsafe";
version = "3.32.1";
format = "other";
name = "${pname}-${version}";
src = fetchgit {
url = "https://gitlab.gnome.org/diamondburned/PasswordSafe.git";
rev = "5ab72a2a48f45c41d7a1cca2dab9634ea36198f0";
sha256 = "1i458p51wby00sjjfv9838b3hmgwzlbyvwqkxhzlsj7kzxr57c80";
};
buildInputs = [
libhandy
libpwquality
gtk3
glib
gobject-introspection
];
propagatedBuildInputs = with python3Packages; [
pykeepass
pygobject3
libkeepass
pwquality
];
nativeBuildInputs = buildInputs ++ [
wrapGAppsHook
meson
ninja
pkgconfig
cmake
];
meta = with stdenv.lib; {
description = "Password manager for GNOME which makes use of the KeePass v.4 format";
homepage = https://gitlab.gnome.org/World/PasswordSafe;
license = licenses.gpl3;
platforms = platforms.linux;
};
}
For testing purpose I continued this package in my NUR repository. You can try the package nur.repos.onny.passwordsafe if you want I’ve packaged version 3.99.2. Still not sure which features might be missing or bugs still present.