From 82a791baa53964df9b3ac799e2c8b2fa8f858f97 Mon Sep 17 00:00:00 2001 From: VykosMolt Date: Sat, 5 Sep 2026 13:09:05 +0200 Subject: [PATCH] pcsclite: fix pcsc-spy interpreter Patch pcsc-spy with the host Python after moving it to dev. The automatic dev-output hook uses the build path, leaving /usr/bin/python3 unchanged with strictDeps. Add an execution test for pcsc-spy --help. Fixes #557676 Assisted-by: Codex (GPT-6 Astra) --- pkgs/by-name/pc/pcsclite/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/pc/pcsclite/package.nix b/pkgs/by-name/pc/pcsclite/package.nix index 271bf0fdd121..02373531eca7 100644 --- a/pkgs/by-name/pc/pcsclite/package.nix +++ b/pkgs/by-name/pc/pcsclite/package.nix @@ -21,6 +21,7 @@ pname ? "pcsclite", polkitSupport ? false, nixosTests, + runCommand, }: stdenv.mkDerivation (finalAttrs: { @@ -86,6 +87,7 @@ stdenv.mkDerivation (finalAttrs: { postInstall = '' # pcsc-spy is a debugging utility and it drags python into the closure moveToOutput bin/pcsc-spy "$dev" + patchShebangs --host "$dev/bin/pcsc-spy" ''; __structuredAttrs = true; @@ -117,6 +119,13 @@ stdenv.mkDerivation (finalAttrs: { package = finalAttrs.finalPackage; command = "pcscd --version"; }; + pcsc-spy = runCommand "pcsc-spy-test" { } '' + status=0 + ${finalAttrs.finalPackage.dev}/bin/pcsc-spy --help > help.txt 2>&1 || status=$? + test "$status" -eq 1 + grep -F "Usage: pcsc-spy" help.txt + touch "$out" + ''; }; updateScript = nix-update-script { }; };