1 { lib, stdenv, fetchurl, fetchpatch, cmake, minizip, pcsclite, opensc, openssl
2 , xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
4 stdenv.mkDerivation rec {
6 pname = "libdigidocpp";
9 url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
10 hash = "sha256-XgObeVQJ2X7hNIelGK55RTtkKvU6D+RkLMc24/PZCzY=";
13 nativeBuildInputs = [ cmake pkg-config xxd ];
16 minizip pcsclite opensc openssl xercesc
17 xml-security-c xsd zlib xalanc
20 outputs = [ "out" "lib" "dev" "bin" ];
22 # libdigidocpp.so's `PKCS11Signer::PKCS11Signer()` dlopen()s "opensc-pkcs11.so"
23 # itself, so add OpenSC to its DT_RUNPATH after the fixupPhase shrinked it.
24 # https://github.com/open-eid/cmake/pull/35 might be an alternative.
26 patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so
30 description = "Library for creating DigiDoc signature files";
31 homepage = "https://www.id.ee/";
32 license = licenses.lgpl21Plus;
33 platforms = platforms.linux;
34 maintainers = [ maintainers.jagajaga ];