2013-12-02 13:26:21 +01:00
|
|
|
{ stdenv, fetchurl, writeScript, patchelf, glib, opensc, openssl, openct
|
|
|
|
, libtool, pcsclite, zlib
|
|
|
|
}:
|
2010-01-10 01:22:29 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2010-01-15 00:21:46 +01:00
|
|
|
name = "libopensc-dnie-1.4.6-2";
|
2013-12-02 13:26:21 +01:00
|
|
|
|
2012-12-28 19:54:15 +01:00
|
|
|
src = if stdenv.system == "i686-linux" then (fetchurl {
|
2010-01-10 01:22:29 +01:00
|
|
|
url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar;
|
|
|
|
sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i";
|
|
|
|
})
|
2012-12-28 19:54:15 +01:00
|
|
|
else if stdenv.system == "x86_64-linux" then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
|
2010-01-10 01:22:29 +01:00
|
|
|
sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9";
|
|
|
|
})
|
|
|
|
else throw "Architecture not supported";
|
|
|
|
|
|
|
|
buildInputs = [ patchelf glib ];
|
|
|
|
|
|
|
|
builder = writeScript (name + "-builder.sh") ''
|
|
|
|
source $stdenv/setup
|
|
|
|
tar xf $src
|
|
|
|
ar x opensc-dnie*
|
|
|
|
tar xf data.tar.gz
|
|
|
|
|
|
|
|
RPATH=${glib}/lib:${opensc}/lib:${openssl}/lib:${openct}/lib:${libtool}/lib:${pcsclite}/lib:${stdenv.gcc.libc}/lib:${zlib}/lib
|
|
|
|
|
2013-12-02 13:26:21 +01:00
|
|
|
for a in "usr/lib/"*.so*; do
|
2010-01-10 01:22:29 +01:00
|
|
|
if ! test -L $a; then
|
|
|
|
patchelf --set-rpath $RPATH $a
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-12-02 13:26:21 +01:00
|
|
|
sed -i s,/usr,$out, "usr/lib/pkgconfig/"*
|
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out
|
2010-01-10 01:22:29 +01:00
|
|
|
cp -R usr/lib $out
|
|
|
|
cp -R usr/share $out
|
|
|
|
'';
|
|
|
|
|
2010-01-15 00:43:56 +01:00
|
|
|
passthru = {
|
|
|
|
# This will help keeping the proper opensc version when using this libopensc-dnie library
|
|
|
|
inherit opensc;
|
|
|
|
};
|
|
|
|
|
2010-01-10 01:22:29 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.dnielectronico.es/descargas/;
|
|
|
|
description = "Opensc plugin to access the Spanish national ID smartcard";
|
|
|
|
license = "nonfree";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2013-11-04 21:07:57 +01:00
|
|
|
broken = true;
|
2010-01-10 01:22:29 +01:00
|
|
|
};
|
|
|
|
}
|