19 stdenv.mkDerivation rec {
21 pname = "libdigidocpp";
24 url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
25 hash = "sha256-0G7cjJEgLJ24SwHRznKJ18cRY0m50lr6HXstfbYq9f8=";
28 nativeBuildInputs = [ cmake pkg-config xxd ];
42 outputs = [ "out" "lib" "dev" "bin" ];
44 # This wants to link to ${CMAKE_DL_LIBS} (ltdl), and there doesn't seem to be
45 # a way to tell CMake where this should be pulled from.
46 # A cleaner fix would probably be to patch cmake to use
47 # `-L${libtool.lib}/lib -ltdl` for `CMAKE_DL_LIBS`, but that's a world rebuild.
48 env.NIX_LDFLAGS = "-L${libtool.lib}/lib";
50 # libdigidocpp.so's `PKCS11Signer::PKCS11Signer()` dlopen()s "opensc-pkcs11.so"
51 # itself, so add OpenSC to its DT_RUNPATH after the fixupPhase shrinked it.
52 # https://github.com/open-eid/cmake/pull/35 might be an alternative.
54 patchelf --add-rpath ${opensc}/lib/pkcs11 $lib/lib/libdigidocpp.so
58 description = "Library for creating DigiDoc signature files";
59 mainProgram = "digidoc-tool";
60 homepage = "https://www.id.ee/";
61 license = licenses.lgpl21Plus;
62 platforms = platforms.linux;
63 maintainers = [ maintainers.jagajaga ];