From 0f8a593cd2ac99af04ca1457ec0de9c6cbc5b4b6 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 20:37:01 +0200 Subject: [PATCH 01/17] imv: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/im/imv/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index 178bdfcae3fb..70a1eb09dd68 100644 --- a/pkgs/by-name/im/imv/package.nix +++ b/pkgs/by-name/im/imv/package.nix @@ -101,8 +101,6 @@ stdenv.mkDerivation rec { ++ builtins.map (b: backends."${b}") withBackends; postInstall = '' - # fix the executable path and install the desktop item - substituteInPlace ../files/imv.desktop --replace "imv %F" "$out/bin/imv %F" install -Dm644 ../files/imv.desktop $out/share/applications/ ''; From af971aa847ba1c0e7f7d8fc125e772db531736fe Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 20:38:00 +0200 Subject: [PATCH 02/17] imv: use replace-fail Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/im/imv/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index 70a1eb09dd68..8908a987da4d 100644 --- a/pkgs/by-name/im/imv/package.nix +++ b/pkgs/by-name/im/imv/package.nix @@ -109,8 +109,8 @@ stdenv.mkDerivation rec { # so we have to fix those to the binaries we installed into the /nix/store substituteInPlace "$out/bin/imv" \ - --replace "imv-wayland" "$out/bin/imv-wayland" \ - --replace "imv-x11" "$out/bin/imv-x11" + --replace-fail "imv-wayland" "$out/bin/imv-wayland" \ + --replace-fail "imv-x11" "$out/bin/imv-x11" ''; doCheck = true; From f7e15d3e5c3ad9e8b825c32dd7103dcb5d565fe7 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 20:41:53 +0200 Subject: [PATCH 03/17] signal-desktop: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- .../networking/instant-messengers/signal-desktop/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix index 77754a0122e1..a8f1df73e043 100644 --- a/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix +++ b/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix @@ -237,7 +237,7 @@ stdenv.mkDerivation rec { # Fix the desktop link substituteInPlace $out/share/applications/${pname}.desktop \ - --replace-fail "/opt/${dir}/${pname}" $out/bin/${pname} \ + --replace-fail "/opt/${dir}/${pname}" ${meta.mainProgram} \ --replace-fail "StartupWMClass=Signal" "StartupWMClass=signal" # Note: The following path contains bundled libraries: From 3b0e6194fb3813468d23166dd2712660d036a231 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:03:02 +0200 Subject: [PATCH 04/17] ryujinx: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/ry/ryujinx/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/ry/ryujinx/package.nix b/pkgs/by-name/ry/ryujinx/package.nix index 6e698c3314f0..5b24e80d34bc 100644 --- a/pkgs/by-name/ry/ryujinx/package.nix +++ b/pkgs/by-name/ry/ryujinx/package.nix @@ -98,9 +98,6 @@ buildDotnetModule rec { install -D ./mime/Ryujinx.xml $out/share/mime/packages/Ryujinx.xml install -D ../misc/Logo.svg $out/share/icons/hicolor/scalable/apps/Ryujinx.svg - substituteInPlace $out/share/applications/Ryujinx.desktop \ - --replace "Ryujinx.sh %f" "$out/bin/Ryujinx.sh %f" - ln -s $out/bin/Ryujinx $out/bin/ryujinx popd From 4b11c8ab1df0438010b44df26bbbc0d1a176128d Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:09:29 +0200 Subject: [PATCH 05/17] qtcreator: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/development/tools/qtcreator/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/development/tools/qtcreator/default.nix b/pkgs/development/tools/qtcreator/default.nix index 54831c7028f3..9956e931b064 100644 --- a/pkgs/development/tools/qtcreator/default.nix +++ b/pkgs/development/tools/qtcreator/default.nix @@ -86,11 +86,6 @@ stdenv.mkDerivation rec { "--set-default PERFPROFILER_PARSER_FILEPATH ${lib.getBin perf}/bin" ]; - postInstall = '' - substituteInPlace $out/share/applications/org.qt-project.qtcreator.desktop \ - --replace "Exec=qtcreator" "Exec=$out/bin/qtcreator" - ''; - meta = with lib; { description = "Cross-platform IDE tailored to the needs of Qt developers"; longDescription = '' From 9affc1b3d88f9f69f4b87e88c7103c20365bdb32 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:11:33 +0200 Subject: [PATCH 06/17] entangle: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/en/entangle/package.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/by-name/en/entangle/package.nix b/pkgs/by-name/en/entangle/package.nix index fd5f3873df78..dab4bd89fe73 100644 --- a/pkgs/by-name/en/entangle/package.nix +++ b/pkgs/by-name/en/entangle/package.nix @@ -120,11 +120,6 @@ stdenv.mkDerivation (finalAttrs: { -e "/gtk-update-icon-cache/d" ''; - postInstall = '' - substituteInPlace "$out/share/applications/org.entangle_photo.Manager.desktop" \ - --replace "Exec=entangle" "Exec=$out/bin/entangle" - ''; - meta = { description = "Tethered camera control and capture"; longDescription = '' From dc278337657dcdfdf632109b0769384109a7ec0e Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:11:42 +0200 Subject: [PATCH 07/17] gnome-weather: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/gn/gnome-weather/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/gn/gnome-weather/package.nix b/pkgs/by-name/gn/gnome-weather/package.nix index 99a475963d3f..edbfa6503a97 100644 --- a/pkgs/by-name/gn/gnome-weather/package.nix +++ b/pkgs/by-name/gn/gnome-weather/package.nix @@ -55,8 +55,7 @@ stdenv.mkDerivation rec { # entry point to the wrapped binary we get back to a wrapped # binary. substituteInPlace "data/org.gnome.Weather.service.in" \ - --replace "Exec=@DATA_DIR@/@APP_ID@" \ - "Exec=$out/bin/gnome-weather" + --replace-fail "Exec=@DATA_DIR@/@APP_ID@" "Exec=gnome-weather" chmod +x meson_post_install.py patchShebangs meson_post_install.py From 8816be7bdaa297e6b4448473f8e23e08b0ed1a0b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:12:27 +0200 Subject: [PATCH 08/17] gnome-maps: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/gn/gnome-maps/package.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkgs/by-name/gn/gnome-maps/package.nix b/pkgs/by-name/gn/gnome-maps/package.nix index 233c0f2296ee..27eee47cbf61 100644 --- a/pkgs/by-name/gn/gnome-maps/package.nix +++ b/pkgs/by-name/gn/gnome-maps/package.nix @@ -68,16 +68,6 @@ stdenv.mkDerivation (finalAttrs: { libsoup_3 ]; - postPatch = '' - # The .service file isn't wrapped with the correct environment - # so misses GIR files when started. By re-pointing from the gjs - # entry point to the wrapped binary we get back to a wrapped - # binary. - substituteInPlace "data/org.gnome.Maps.service.in" \ - --replace-fail "Exec=@pkgdatadir@/@app-id@" \ - "Exec=$out/bin/gnome-maps" - ''; - preCheck = '' # “time.js” included by “timeTest” and “translationsTest” depends on “org.gnome.desktop.interface” schema. export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:$XDG_DATA_DIRS" From d769a8defe586926b133efc4a73b62ee24e6002e Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:14:00 +0200 Subject: [PATCH 09/17] gnome-panel: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/gn/gnome-panel/package.nix | 10 ---------- pkgs/by-name/gn/gnome-panel/wrapper.nix | 5 ++--- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/gn/gnome-panel/package.nix b/pkgs/by-name/gn/gnome-panel/package.nix index 5ec2383c826b..80c49fda4017 100644 --- a/pkgs/by-name/gn/gnome-panel/package.nix +++ b/pkgs/by-name/gn/gnome-panel/package.nix @@ -45,16 +45,6 @@ stdenv.mkDerivation (finalAttrs: { ./modulesdir-env-var.patch ]; - # make .desktop Exec absolute - postPatch = '' - patch -p0 < Date: Mon, 14 Oct 2024 21:14:41 +0200 Subject: [PATCH 10/17] imagej: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/im/imagej/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/im/imagej/package.nix b/pkgs/by-name/im/imagej/package.nix index 37fed43765ea..53c984c96132 100644 --- a/pkgs/by-name/im/imagej/package.nix +++ b/pkgs/by-name/im/imagej/package.nix @@ -62,8 +62,6 @@ in stdenv.mkDerivation rec { --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share" install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png - substituteInPlace $out/share/applications/ImageJ.desktop \ - --replace Exec=imagej Exec=$out/bin/imagej ''; meta = with lib; { From 52dc88dece9f74fbc3210bad54db45eaf4475c15 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:16:57 +0200 Subject: [PATCH 11/17] nmapsi4: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/nm/nmapsi4/package.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/by-name/nm/nmapsi4/package.nix b/pkgs/by-name/nm/nmapsi4/package.nix index 682e7f1f2d12..37287dcef021 100644 --- a/pkgs/by-name/nm/nmapsi4/package.nix +++ b/pkgs/by-name/nm/nmapsi4/package.nix @@ -52,9 +52,7 @@ stdenv.mkDerivation rec { for f in $out/share/applications/* ; do substituteInPlace $f \ - --replace Qt4 Qt5 \ - --replace Exec=nmapsi4 Exec=$out/bin/nmapsi4 \ - --replace "Exec=kdesu nmapsi4" "Exec=kdesu $out/bin/nmapsi4" + --replace Qt4 Qt5 done ''; From cddcb797a3287aab52da11407f81dadaa08d9f79 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:27:37 +0200 Subject: [PATCH 12/17] fclones-gui: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/tools/misc/fclones/gui.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/misc/fclones/gui.nix b/pkgs/tools/misc/fclones/gui.nix index bf010cfa798e..e5e611336439 100644 --- a/pkgs/tools/misc/fclones/gui.nix +++ b/pkgs/tools/misc/fclones/gui.nix @@ -38,7 +38,6 @@ rustPlatform.buildRustPackage rec { postInstall = '' substituteInPlace snap/gui/fclones-gui.desktop \ - --replace Exec=fclones-gui Exec=$out/bin/fclones-gui \ --replace 'Icon=''${SNAP}/meta/gui/fclones-gui.png' Icon=fclones-gui install -Dm444 snap/gui/fclones-gui.desktop -t $out/share/applications From ac1e883587fbeca09619b15217ed9fcbb1da345c Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:33:47 +0200 Subject: [PATCH 13/17] gnome-control-center: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/gn/gnome-control-center/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/gn/gnome-control-center/package.nix b/pkgs/by-name/gn/gnome-control-center/package.nix index 6d10ce16a8db..9600b529c888 100644 --- a/pkgs/by-name/gn/gnome-control-center/package.nix +++ b/pkgs/by-name/gn/gnome-control-center/package.nix @@ -200,9 +200,6 @@ stdenv.mkDerivation (finalAttrs: { # WM keyboard shortcuts --prefix XDG_DATA_DIRS : "${mutter}/share" ) - for i in $out/share/applications/*; do - substituteInPlace $i --replace "Exec=gnome-control-center" "Exec=$out/bin/gnome-control-center" - done ''; separateDebugInfo = true; From 97ac49b09c7477de806aa71fc39264deb112aa2d Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:36:01 +0200 Subject: [PATCH 14/17] gamepad-tool: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/ga/gamepad-tool/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/ga/gamepad-tool/package.nix b/pkgs/by-name/ga/gamepad-tool/package.nix index 4e7b03bdb4af..f31c4ca927ad 100644 --- a/pkgs/by-name/ga/gamepad-tool/package.nix +++ b/pkgs/by-name/ga/gamepad-tool/package.nix @@ -31,7 +31,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { cp -r usr/share/icons $out/share/icons substitute usr/share/applications/gamepad-tool-debian.desktop \ $out/share/applications/gamepad-tool.desktop \ - --replace "Exec=gamepad-tool" "Exec=$out/bin/gamepad-tool" \ --replace "/usr/share/icons/hicolor/256x256/apps/gamepad-tool.png" "$out/share/icons/hicolor/256x256/apps/gamepad-tool.png" runHook postInstall ''; From 824cbe992255b202ac4d2005a0d4b739e14a7973 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 18 Nov 2024 16:43:09 +0100 Subject: [PATCH 15/17] gamepad-tool: remove absolute icon path Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/ga/gamepad-tool/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ga/gamepad-tool/package.nix b/pkgs/by-name/ga/gamepad-tool/package.nix index f31c4ca927ad..3ca6cabddf62 100644 --- a/pkgs/by-name/ga/gamepad-tool/package.nix +++ b/pkgs/by-name/ga/gamepad-tool/package.nix @@ -31,7 +31,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { cp -r usr/share/icons $out/share/icons substitute usr/share/applications/gamepad-tool-debian.desktop \ $out/share/applications/gamepad-tool.desktop \ - --replace "/usr/share/icons/hicolor/256x256/apps/gamepad-tool.png" "$out/share/icons/hicolor/256x256/apps/gamepad-tool.png" + --replace-fail "/usr/share/icons/hicolor/256x256/apps/gamepad-tool.png" "gamepad-tool" runHook postInstall ''; From fb74ff8dd0d91eeb7e9c9251e03812a25ec5aeb9 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:38:04 +0200 Subject: [PATCH 16/17] tilix: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/by-name/ti/tilix/package.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/by-name/ti/tilix/package.nix b/pkgs/by-name/ti/tilix/package.nix index 4394a2a52f58..07344d23d87a 100644 --- a/pkgs/by-name/ti/tilix/package.nix +++ b/pkgs/by-name/ti/tilix/package.nix @@ -61,11 +61,6 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs meson_post_install.py ''; - preFixup = '' - substituteInPlace $out/share/applications/com.gexperts.Tilix.desktop \ - --replace "Exec=tilix" "Exec=$out/bin/tilix" - ''; - passthru.tests.test = nixosTests.terminal-emulators.tilix; meta = with lib; { From b00728da1090ce0dc8a3586f7d86f1a04122e605 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Oct 2024 21:39:45 +0200 Subject: [PATCH 17/17] electron-cash: remove absolute path in desktop entry Signed-off-by: Sefa Eyeoglu --- pkgs/applications/misc/electron-cash/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/applications/misc/electron-cash/default.nix b/pkgs/applications/misc/electron-cash/default.nix index e9854ac3ef94..89579d62a4f9 100644 --- a/pkgs/applications/misc/electron-cash/default.nix +++ b/pkgs/applications/misc/electron-cash/default.nix @@ -61,11 +61,6 @@ python3Packages.buildPythonApplication rec { --replace "(share_dir" "(\"share\"" ''; - postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/share/applications/electron-cash.desktop \ - --replace "Exec=electron-cash" "Exec=$out/bin/electron-cash" - ''; - # If secp256k1 wasn't added to the library path, the following warning is given: # # Electron Cash was unable to find the secp256k1 library on this system.