diff options
author | Doron Behar <doron.behar@gmail.com> | 2023-01-04 18:42:00 +0200 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2023-03-02 13:59:43 +0200 |
commit | 7317a23ece1308d251c48a72a3acaa97f53e82ec (patch) | |
tree | cf8761e067b1e45d4a1a682fd33ac3f9b6c321e8 /pkgs/applications/misc/syncthingtray | |
parent | e8f052a421804bbb08a84ee6a562ef70864247f5 (diff) |
syncthingtray: 1.3.1 -> 1.3.2
Diff: https://github.com/Martchus/syncthingtray/compare/v1.3.1...v1.3.2 Add `autostartExecPath` option.
Diffstat (limited to 'pkgs/applications/misc/syncthingtray')
-rw-r--r-- | pkgs/applications/misc/syncthingtray/default.nix | 22 | ||||
-rw-r--r-- | pkgs/applications/misc/syncthingtray/use-nix-path-in-autostart.patch | 13 |
2 files changed, 9 insertions, 26 deletions
diff --git a/pkgs/applications/misc/syncthingtray/default.nix b/pkgs/applications/misc/syncthingtray/default.nix index 5d583181ce65e..99404d38efeee 100644 --- a/pkgs/applications/misc/syncthingtray/default.nix +++ b/pkgs/applications/misc/syncthingtray/default.nix @@ -19,30 +19,25 @@ , kioPluginSupport ? true , plasmoidSupport ? true , systemdSupport ? true +/* It is possible to set via this option an absolute exec path that will be +written to the `~/.config/autostart/syncthingtray.desktop` file generated +during runtime. Alternatively, one can edit the desktop file themselves after +it is generated See: +https://github.com/NixOS/nixpkgs/issues/199596#issuecomment-1310136382 */ +, autostartExecPath ? "syncthingtray" }: mkDerivation rec { - version = "1.3.1"; + version = "1.3.2"; pname = "syncthingtray"; src = fetchFromGitHub { owner = "Martchus"; repo = "syncthingtray"; rev = "v${version}"; - sha256 = "sha256-0rmfDkPvgubVqfbIOZ+mnv/x1p2sb88zGeg/Q2JCy3I="; + sha256 = "sha256-zLZw6ltdgO66dvKdLXhr/a6r8UhbSAx06jXrgMARHyw="; }; - patches = [ - # Fix Exec= path in runtime-generated - # ~/.config/autostart/syncthingtray.desktop file - this is required because - # we are wrapping the executable. We can't use `substituteAll` because we - # can't use `${placeholder "out"}` because that will produce the $out of - # the patch derivation itself, and not of syncthing's "out" placeholder. - # Hence we use a C definition with NIX_CFLAGS_COMPILE - ./use-nix-path-in-autostart.patch - ]; - env.NIX_CFLAGS_COMPILE = "-DEXEC_NIX_PATH=\"${placeholder "out"}/bin/syncthingtray\""; - buildInputs = [ qtbase cpp-utilities @@ -70,6 +65,7 @@ mkDerivation rec { ''; cmakeFlags = [ + "-DAUTOSTART_EXEC_PATH=${autostartExecPath}" # See https://github.com/Martchus/syncthingtray/issues/42 "-DQT_PLUGIN_DIR:STRING=${placeholder "out"}/lib/qt-5" ] ++ lib.optionals (!plasmoidSupport) ["-DNO_PLASMOID=ON"] diff --git a/pkgs/applications/misc/syncthingtray/use-nix-path-in-autostart.patch b/pkgs/applications/misc/syncthingtray/use-nix-path-in-autostart.patch deleted file mode 100644 index a0907496ff9a7..0000000000000 --- a/pkgs/applications/misc/syncthingtray/use-nix-path-in-autostart.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git i/widgets/settings/settingsdialog.cpp w/widgets/settings/settingsdialog.cpp -index 4deff1f..16845b5 100644 ---- i/widgets/settings/settingsdialog.cpp -+++ w/widgets/settings/settingsdialog.cpp -@@ -802,7 +802,7 @@ bool setAutostartEnabled(bool enabled) - desktopFile.write("[Desktop Entry]\n" - "Name=" APP_NAME "\n" - "Exec=\""); -- desktopFile.write(qEnvironmentVariable("APPIMAGE", QCoreApplication::applicationFilePath()).toUtf8().data()); -+ desktopFile.write(qEnvironmentVariable("APPIMAGE", EXEC_NIX_PATH).toUtf8().data()); - desktopFile.write("\" qt-widgets-gui --single-instance\nComment=" APP_DESCRIPTION "\n" - "Icon=" PROJECT_NAME "\n" - "Type=Application\n" |