Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libdigidocpp / default.nix
blob49c3713bbe0e0d5cfda4879a8ef8e0e53909fe8f
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 {
5   version = "3.16.0";
6   pname = "libdigidocpp";
8   src = fetchurl {
9      url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
10      hash = "sha256-XgObeVQJ2X7hNIelGK55RTtkKvU6D+RkLMc24/PZCzY=";
11   };
13   nativeBuildInputs = [ cmake pkg-config xxd ];
15   buildInputs = [
16     minizip pcsclite opensc openssl xercesc
17     xml-security-c xsd zlib xalanc
18   ];
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.
25   postFixup = ''
26     patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so
27   '';
29   meta = with lib; {
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 ];
35   };