Merge pull request #209062 from doronbehar/pkg/syncthingtray

syncthingtray: 1.3.1 -> 1.3.2

Changed files
+9 -26
pkgs
applications
+9 -13
pkgs/applications/misc/syncthingtray/default.nix
···
, 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
···
'';
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"]
-13
pkgs/applications/misc/syncthingtray/use-nix-path-in-autostart.patch
···
-
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"