postgresqlPackages.pgroonga: 3.2.4 -> 3.2.5 (#365378)
[NixPkgs.git] / pkgs / applications / networking / sync / backintime / qt.nix
blob2708997a45b67cd9f59130b227bd20e56bc6ae74
2   lib,
3   stdenv,
4   backintime-common,
5   python3,
6   polkit,
7   which,
8   su,
9   coreutils,
10   util-linux,
11   wrapQtAppsHook,
12   qtbase,
13   qtwayland,
16 let
17   python' = python3.withPackages (
18     ps: with ps; [
19       pyqt6
20       backintime-common
21       packaging
22     ]
23   );
25 stdenv.mkDerivation {
26   inherit (backintime-common)
27     version
28     src
29     installFlags
30     meta
31     dontAddPrefix
32     ;
34   pname = "backintime-qt";
36   buildInputs = [
37     python'
38     backintime-common
39     qtbase
40     qtwayland
41   ];
43   nativeBuildInputs = backintime-common.nativeBuildInputs or [ ] ++ [
44     wrapQtAppsHook
45   ];
47   configureFlags = [ "--python=${lib.getExe python'}" ];
49   preConfigure = ''
50     patchShebangs --build updateversion.sh
51     cd qt
52     substituteInPlace qttools_path.py \
53       --replace "__file__, os.pardir, os.pardir" '"${backintime-common}/${python'.sitePackages}/backintime"'
54   '';
56   preFixup = ''
57     wrapQtApp "$out/bin/backintime-qt" \
58       --prefix PATH : "${lib.getBin backintime-common}/bin:$PATH"
60     substituteInPlace "$out/share/polkit-1/actions/net.launchpad.backintime.policy" \
61       --replace-fail "/usr/bin/backintime-qt" "$out/bin/backintime-qt"
63     substituteInPlace "$out/share/applications/backintime-qt-root.desktop" \
64       --replace-fail "/usr/bin/backintime-qt" "backintime-qt"
66     substituteInPlace "$out/share/backintime/qt/serviceHelper.py" \
67       --replace-fail "'which'" "'${lib.getExe which}'" \
68       --replace-fail "/bin/su" "${lib.getBin su}/bin/su" \
69       --replace-fail "/usr/bin/backintime" "${lib.getExe backintime-common}" \
70       --replace-fail "/usr/bin/nice" "${lib.getBin coreutils}/bin/nice" \
71       --replace-fail "/usr/bin/ionice" "${lib.getBin util-linux}/bin/ionice"
73     substituteInPlace "$out/share/dbus-1/system-services/net.launchpad.backintime.serviceHelper.service" \
74       --replace-fail "/usr/share/backintime" "$out/share/backintime"
76     substituteInPlace "$out/bin/backintime-qt_polkit" \
77       --replace-fail "/usr/bin/backintime-qt" "$out/bin/backintime-qt"
79     wrapProgram "$out/bin/backintime-qt_polkit" \
80       --prefix PATH : "${lib.getBin polkit}/bin:$PATH"
81   '';