about summary refs log tree commit diff
path: root/pkgs/tools/security
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-09-10 07:06:45 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-09-10 07:06:45 +0200
commit1716d62f633cd091fce0d61517bb79504c300d36 (patch)
tree5abe8333c83e247f364cf835efc7fc669d36c311 /pkgs/tools/security
parentdc051dfdef1ec4c9bdd90b228764b6c24372597e (diff)
parent8752ff225446422b902d9f88d6f75f9928d4eb34 (diff)
downloadnixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar.gz
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar.bz2
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar.lz
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar.xz
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.tar.zst
nixlib-1716d62f633cd091fce0d61517bb79504c300d36.zip
Merge branch 'staging-next' into staging
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r--pkgs/tools/security/asc-key-to-qr-code-gif/default.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix b/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix
index 6b3a922bbe5c..580cf7585c92 100644
--- a/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix
+++ b/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix
@@ -15,15 +15,20 @@ stdenv.mkDerivation {
     sha256 = "0yrc302a2fhbzryb10718ky4fymfcps3lk67ivis1qab5kbp6z8r";
   };
 
-  buildInputs = [ imagemagick qrencode ] ++ stdenv.lib.optional testQR zbar;
   dontBuild = true;
   dontStrip = true;
   dontPatchELF = true;
 
-  preInstall = ''
-    substituteInPlace asc-to-gif.sh \
-      --replace "convert" "${imagemagick}/bin/convert" \
-      --replace "qrencode" "${qrencode.bin}/bin/qrencode"
+  preInstall = let
+    substitutions = [
+      ''--replace "convert" "${imagemagick}/bin/convert"''
+      ''--replace "qrencode" "${qrencode.bin}/bin/qrencode"''
+    ] ++ stdenv.lib.optional testQR [
+      ''--replace "hash zbarimg" "true"'' # hash does not work on NixOS
+      ''--replace "$(zbarimg --raw" "$(${zbar.out}/bin/zbarimg --raw"''
+    ];
+  in ''
+    substituteInPlace asc-to-gif.sh ${stdenv.lib.concatStringsSep " " substitutions}
   '';
 
   installPhase = ''