2022-06-07 10:10:35 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, cmake, minizip, pcsclite, opensc, openssl
|
2021-01-19 06:50:56 +00:00
|
|
|
, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
|
2016-04-26 20:12:55 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-07-21 13:01:19 +00:00
|
|
|
version = "3.14.10";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libdigidocpp";
|
2016-04-26 20:12:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-21 08:38:33 +00:00
|
|
|
url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
|
2022-07-22 07:09:33 +00:00
|
|
|
hash = "sha256-n/+R4ho1Qcft3YSKE12oxZjbFHAsUDwoLFNuk5GXf5c=";
|
2016-04-26 20:12:55 +00:00
|
|
|
};
|
|
|
|
|
2022-06-07 10:10:35 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config xxd ];
|
2018-06-21 08:38:33 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-08-14 11:42:06 +00:00
|
|
|
minizip pcsclite opensc openssl xercesc
|
2018-06-21 08:38:33 +00:00
|
|
|
xml-security-c xsd zlib xalanc
|
|
|
|
];
|
2016-04-26 20:12:55 +00:00
|
|
|
|
2022-06-02 19:32:04 +00:00
|
|
|
outputs = [ "out" "lib" "dev" "bin" ];
|
|
|
|
|
2022-06-07 10:10:35 +00:00
|
|
|
# libdigidocpp.so's `PKCS11Signer::PKCS11Signer()` dlopen()s "opensc-pkcs11.so"
|
|
|
|
# itself, so add OpenSC to its DT_RUNPATH after the fixupPhase shrinked it.
|
|
|
|
# https://github.com/open-eid/cmake/pull/35 might be an alternative.
|
|
|
|
postFixup = ''
|
|
|
|
patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so
|
2022-05-22 22:10:33 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2016-04-26 20:12:55 +00:00
|
|
|
description = "Library for creating DigiDoc signature files";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.id.ee/";
|
2021-08-14 11:42:06 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2016-04-26 20:12:55 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.jagajaga ];
|
|
|
|
};
|
|
|
|
}
|