summary refs log tree commit diff
path: root/pkgs/tools/X11/xdg-utils/default.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-03-15 01:44:24 +0000
committerRobin Gloster <mail@glob.in>2016-03-15 01:44:24 +0000
commit3f45f0948d6fe158bed063adb66850ded0ba4861 (patch)
treeac717689d391d3f5333132fc34e4b2aed829414c /pkgs/tools/X11/xdg-utils/default.nix
parenta9b942c0617b1cd5f0732d05eadad0114a178f37 (diff)
parentd227d9a70e41d65e4e6f4ac75a9d243c5a19fa85 (diff)
downloadnixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar.gz
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar.bz2
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar.lz
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar.xz
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.tar.zst
nixlib-3f45f0948d6fe158bed063adb66850ded0ba4861.zip
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/tools/X11/xdg-utils/default.nix')
-rw-r--r--pkgs/tools/X11/xdg-utils/default.nix21
1 files changed, 10 insertions, 11 deletions
diff --git a/pkgs/tools/X11/xdg-utils/default.nix b/pkgs/tools/X11/xdg-utils/default.nix
index 23b406c2d43f..6f1335593621 100644
--- a/pkgs/tools/X11/xdg-utils/default.nix
+++ b/pkgs/tools/X11/xdg-utils/default.nix
@@ -28,18 +28,17 @@ stdenv.mkDerivation rec {
 
   postInstall = stdenv.lib.optionalString mimiSupport ''
     cp ${mimisrc}/xdg-open $out/bin/xdg-open
-    substituteInPlace $out/bin/xdg-open --replace "awk " "${gawk}/bin/awk "
-    substituteInPlace $out/bin/xdg-open --replace "sort " "${coreutils}/bin/sort "
-    substituteInPlace $out/bin/xdg-open --replace "(file " "(${file}/bin/file "
-  '' + ''
-    for item in $out/bin/*; do
-      substituteInPlace $item --replace "cut " "${coreutils}/bin/cut "
-      substituteInPlace $item --replace "sed " "${gnused}/bin/sed "
-      substituteInPlace $item --replace "egrep " "${gnugrep}/bin/egrep "
-      sed -i $item -re "s#([^e])grep #\1${gnugrep}/bin/grep #g" # Don't replace 'egrep'
-      substituteInPlace $item --replace "which " "type -P "
-      substituteInPlace $item --replace "/usr/bin/file" "${file}/bin/file"
+  ''
+  + ''
+    for tool in "${coreutils}/bin/cut" "${gnused}/bin/sed" \
+      "${gnugrep}"/bin/{e,}grep "${file}/bin/file" \
+      ${stdenv.lib.optionalString mimiSupport
+        '' "${gawk}/bin/awk" "${coreutils}/bin/sort" ''} ;
+    do
+      sed "s# $(basename "$tool") # $tool #g" -i "$out"/bin/*
     done
+
+    sed 's# which # type -P #g' -i "$out"/bin/*
   '';
 
   meta = with stdenv.lib; {