diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 596bc9dd9e09..d9495bd984ef 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -10,6 +10,7 @@ , sdlSupport ? !stdenv.isDarwin, SDL2 , gtkSupport ? !stdenv.isDarwin && !xenSupport, gtk3, gettext, gnome3 , vncSupport ? true, libjpeg, libpng +, smartcardSupport ? true, libcacard , spiceSupport ? !stdenv.isDarwin, spice, spice-protocol , usbredirSupport ? spiceSupport, usbredir , xenSupport ? false, xen @@ -58,6 +59,7 @@ stdenv.mkDerivation rec { ++ optionals sdlSupport [ SDL2 ] ++ optionals gtkSupport [ gtk3 gettext gnome3.vte ] ++ optionals vncSupport [ libjpeg libpng ] + ++ optionals smartcardSupport [ libcacard ] ++ optionals spiceSupport [ spice-protocol spice ] ++ optionals usbredirSupport [ usbredir ] ++ optionals stdenv.isLinux [ alsaLib libaio libcap_ng libcap attr ] @@ -108,6 +110,7 @@ stdenv.mkDerivation rec { ++ optional stdenv.isDarwin "--cpu=x86_64" ++ optional numaSupport "--enable-numa" ++ optional seccompSupport "--enable-seccomp" + ++ optional smartcardSupport "--enable-smartcard" ++ optional spiceSupport "--enable-spice" ++ optional usbredirSupport "--enable-usb-redir" ++ optional hostCpuOnly "--target-list=${hostCpuTargets}" diff --git a/pkgs/development/libraries/libcacard/default.nix b/pkgs/development/libraries/libcacard/default.nix new file mode 100644 index 000000000000..f116360474e4 --- /dev/null +++ b/pkgs/development/libraries/libcacard/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl, pkgconfig, glib, nss }: + +stdenv.mkDerivation rec { + name = "libcacard-${version}"; + version = "2.6.1"; + + src = fetchurl { + url = "https://www.spice-space.org/download/libcacard/${name}.tar.xz"; + sha256 = "1w6y0kiakhg7dgyf8yqpm4jj6jiv17zhy9lp3d7z32q1pniccxk2"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ glib nss ]; + + meta = with stdenv.lib; { + description = "Smart card emulation library"; + homepage = https://gitlab.freedesktop.org/spice/libcacard; + license = licenses.lgpl21; + maintainers = with maintainers; [ yegortimoshenko ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix index ba3791a8a8bd..e9b12d169849 100644 --- a/pkgs/development/libraries/spice/default.nix +++ b/pkgs/development/libraries/spice/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, pkgconfig, pixman, celt, alsaLib , openssl, libXrandr, libXfixes, libXext, libXrender, libXinerama , libjpeg, zlib, spice-protocol, python, pyparsing, glib, cyrus_sasl -, lz4 }: +, libcacard, lz4 }: with stdenv.lib; @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ pixman celt alsaLib openssl libjpeg zlib libXrandr libXfixes libXrender libXext libXinerama - python pyparsing glib cyrus_sasl lz4 ]; + python pyparsing glib cyrus_sasl libcacard lz4 ]; nativeBuildInputs = [ pkgconfig spice-protocol ]; @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-sasl" - "--disable-smartcard" + "--enable-smartcard" "--enable-client" "--enable-lz4" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e1879dc063ee..b0ac63a3e975 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10305,6 +10305,8 @@ with pkgs; inherit (xorg) libX11 libXext; }; + libcacard = callPackage ../development/libraries/libcacard { }; + libcanberra = callPackage ../development/libraries/libcanberra { inherit (darwin.apple_sdk.frameworks) CoreServices; };