Skip to content

Commit

Permalink
Merge pull request #48282 from transumption/201810/qemu-smartcard
Browse files Browse the repository at this point in the history
qemu: enable smartcard support
  • Loading branch information
lukateras committed Oct 16, 2018
2 parents a65f0b3 + 02602b2 commit e31942c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkgs/applications/virtualization/qemu/default.nix
Expand Up @@ -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
Expand Down Expand Up @@ -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 ]
Expand Down Expand Up @@ -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}"
Expand Down
22 changes: 22 additions & 0 deletions 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;
};
}
6 changes: 3 additions & 3 deletions 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;

Expand All @@ -15,15 +15,15 @@ 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 ];

NIX_CFLAGS_COMPILE = "-fno-stack-protector";

configureFlags = [
"--with-sasl"
"--disable-smartcard"
"--enable-smartcard"
"--enable-client"
"--enable-lz4"
];
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -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;
};
Expand Down

0 comments on commit e31942c

Please sign in to comment.