diff --git a/pkgs/tools/security/pcsc-tools/default.nix b/pkgs/tools/security/pcsc-tools/default.nix index c479caa0a613..29d4562d47c5 100644 --- a/pkgs/tools/security/pcsc-tools/default.nix +++ b/pkgs/tools/security/pcsc-tools/default.nix @@ -7,8 +7,8 @@ , makeWrapper , pkg-config , wrapGAppsHook -, systemd -, dbus +, systemdSupport ? stdenv.isLinux, systemd +, dbusSupport ? stdenv.isLinux, dbus , pcsclite , PCSC , wget @@ -16,8 +16,13 @@ , perlPackages , testers , nix-update-script + +# gui does not cross compile properly +, withGui ? stdenv.buildPlatform.canExecute stdenv.hostPlatform }: +assert systemdSupport -> dbusSupport; + stdenv.mkDerivation (finalAttrs: { pname = "pcsc-tools"; version = "1.7.1"; @@ -33,16 +38,20 @@ stdenv.mkDerivation (finalAttrs: { "--datarootdir=${placeholder "out"}/share" ]; - buildInputs = [ dbus perlPackages.perl pcsclite ] - ++ lib.optional stdenv.isDarwin PCSC - ++ lib.optional stdenv.isLinux systemd; + buildInputs = lib.optionals dbusSupport [ + dbus + ] ++ [ + perlPackages.perl pcsclite + ] ++ lib.optional stdenv.isDarwin PCSC + ++ lib.optional systemdSupport systemd; nativeBuildInputs = [ autoconf-archive autoreconfHook - gobject-introspection makeWrapper pkg-config + ] ++ lib.optionals withGui [ + gobject-introspection wrapGAppsHook ]; @@ -54,6 +63,7 @@ stdenv.mkDerivation (finalAttrs: { wrapProgram $out/bin/scriptor \ --set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}" + '' + lib.optionalString withGui '' wrapProgram $out/bin/gscriptor \ ''${makeWrapperArgs[@]} \ --set PERL5LIB "${with perlPackages; makePerlPath [ @@ -66,6 +76,7 @@ stdenv.mkDerivation (finalAttrs: { Cairo CairoGObject ]}" + '' + '' wrapProgram $out/bin/ATR_analysis \ --set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}"