nixpkgs/pkgs/applications/networking/sync/backintime/qt.nix
Bjørn Forsman 687ed41b53 backintime: add missing dependency 'packaging'
Fixes this error:

  $ ./result/bin/backintime-qt
  /nix/store/fpr65b2gwpa4q9w3k6z8kjcd9yprmg6s-backintime-qt-1.3.3
  Traceback (most recent call last):
    File "/nix/store/fpr65b2gwpa4q9w3k6z8kjcd9yprmg6s-backintime-qt-1.3.3/share/backintime/qt/app.py", line 35, in <module>
      import qttools
    File "/nix/store/fpr65b2gwpa4q9w3k6z8kjcd9yprmg6s-backintime-qt-1.3.3/share/backintime/qt/qttools.py", line 32, in <module>
      from packaging.version import Version
  ModuleNotFoundError: No module named 'packaging'

Fixes https://github.com/NixOS/nixpkgs/issues/241966.
2023-07-08 07:47:44 +02:00

27 lines
700 B
Nix

{ mkDerivation, backintime-common, python3 }:
let
python' = python3.withPackages (ps: with ps; [ pyqt5 backintime-common packaging ]);
in
mkDerivation {
inherit (backintime-common)
version src installFlags meta dontAddPrefix nativeBuildInputs;
pname = "backintime-qt";
buildInputs = [ python' backintime-common ];
preConfigure = ''
cd qt
substituteInPlace configure \
--replace '"/../etc' '"/etc'
substituteInPlace qttools.py \
--replace "__file__, os.pardir, os.pardir" '"${backintime-common}/${python'.sitePackages}/backintime"'
'';
preFixup = ''
wrapQtApp "$out/bin/backintime-qt" \
--prefix PATH : "${backintime-common}/bin:$PATH"
'';
}