diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix index c48d458567dc17..0ebeb1beffa187 100644 --- a/pkgs/applications/misc/electrum/default.nix +++ b/pkgs/applications/misc/electrum/default.nix @@ -88,7 +88,7 @@ python3Packages.buildPythonApplication { --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} '' + (if enableQt then '' substituteInPlace ./electrum/qrscanner.py \ - --replace ${libzbar_name} ${zbar}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} + --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} '' else '' sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt ''); diff --git a/pkgs/tools/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix index bb1081074b98a7..116f32a701b32b 100644 --- a/pkgs/tools/graphics/zbar/default.nix +++ b/pkgs/tools/graphics/zbar/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { pname = "zbar"; version = "0.23"; + outputs = [ "out" "py" "lib" "dev" "doc" "man" ]; + src = fetchFromGitHub { owner = "mchehab"; repo = "zbar"; @@ -54,7 +56,7 @@ stdenv.mkDerivation rec { ]; configureFlags = (if enableDbus then [ - "--with-dbusconfdir=${placeholder "out"}/etc/dbus-1/system.d" + "--with-dbusconfdir=${placeholder "out"}/etc" ] else [ "--without-dbus" ]) ++ lib.optionals (!enableVideo) [ @@ -63,9 +65,10 @@ stdenv.mkDerivation rec { "--without-qt" ]; - postInstall = optionalString enableDbus '' - install -Dm644 dbus/org.linuxtv.Zbar.conf $out/etc/dbus-1/system.d/org.linuxtv.Zbar.conf - ''; + makeFlags = [ + "pyexecdir=${placeholder "py"}/${python.sitePackages}" + "pythondir=${placeholder "py"}/${python.sitePackages}" + ]; meta = with lib; { description = "Bar code reader"; 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 6b3a922bbe5c32..580cf7585c926c 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 = ''