2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, cmake, minizip, pcsclite, opensc, openssl
|
2021-02-05 17:12:51 +00:00
|
|
|
, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "3.14.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libdigidocpp";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
|
2022-05-18 14:49:53 +00:00
|
|
|
sha256 = "sha256-U5i5IAyJF4359q6M6mQemEuG7+inPYIXqLy8GHv4dkg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# fix runtime crashes when signing with OpenSSL>1.1.1l
|
|
|
|
# https://github.com/open-eid/libdigidocpp/issues/474 asks for a new release
|
|
|
|
url = "https://github.com/open-eid/libdigidocpp/commit/42a8cfd834c10bdd206fe784a13217df222b1c8e.patch";
|
|
|
|
sha256 = "sha256-o3ZT0dXhIu79C5ZR+2HPdLMZ3YwPG1v3vly5bseuxtU=";
|
|
|
|
excludes = [
|
|
|
|
".github/workflows/build.yml" # failed hunk
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config xxd ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-09-23 15:35:13 +00:00
|
|
|
minizip pcsclite opensc openssl xercesc
|
2020-04-24 23:36:52 +00:00
|
|
|
xml-security-c xsd zlib xalanc
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
outputs = [ "out" "lib" "dev" "bin" ];
|
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for creating DigiDoc signature files";
|
|
|
|
homepage = "http://www.id.ee/";
|
2021-09-23 15:35:13 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.jagajaga ];
|
|
|
|
};
|
|
|
|
}
|