summary refs log tree commit diff
path: root/pkgs/tools/archivers
diff options
context:
space:
mode:
authorGraham Christensen <graham@tumblr.com>2017-11-14 12:12:19 -0500
committerGraham Christensen <graham@tumblr.com>2017-11-14 19:07:30 -0500
commit753f7be38d1bc683a9330b6214f5731eebc656f0 (patch)
treef6fbc928656986901eab8cc07a884e2f19ddd8df /pkgs/tools/archivers
parent20a5e9db841a5b04f7c3d39f775552b1a1025b46 (diff)
downloadnixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar.gz
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar.bz2
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar.lz
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar.xz
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.tar.zst
nixlib-753f7be38d1bc683a9330b6214f5731eebc656f0.zip
sharutils: simplify substituteInPlace syntax to be Nix 1.11.8 compatible
Diffstat (limited to 'pkgs/tools/archivers')
-rw-r--r--pkgs/tools/archivers/sharutils/default.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix
index 11072fc28dea..9f161ac7525a 100644
--- a/pkgs/tools/archivers/sharutils/default.nix
+++ b/pkgs/tools/archivers/sharutils/default.nix
@@ -18,10 +18,17 @@ stdenv.mkDerivation rec {
   # that cause shar to just segfault. It isn't a problem on Linux because their sandbox
   # remaps /etc/passwd to a trivial file, but we can't do that on Darwin so I do this
   # instead. In this case, I pass in the very imaginative "submitter" as the submitter name
-  patchPhase = ''
-    substituteInPlace tests/shar-1 --replace '$''\{SHAR}' '$''\{SHAR} -s submitter'
-    substituteInPlace tests/shar-2 --replace '$''\{SHAR}' '$''\{SHAR} -s submitter'
-  '';
+
+  patchPhase = let
+      # This evaluates to a string containing:
+      #
+      #     substituteInPlace tests/shar-2 --replace '${SHAR}' '${SHAR} -s submitter'
+      #     substituteInPlace tests/shar-2 --replace '${SHAR}' '${SHAR} -s submitter'
+      shar_sub = "\${SHAR}";
+    in ''
+      substituteInPlace tests/shar-1 --replace '${shar_sub}' '${shar_sub} -s submitter'
+      substituteInPlace tests/shar-2 --replace '${shar_sub}' '${shar_sub} -s submitter'
+    '';
 
   doCheck = true;