nixpkgs/pkgs/by-name/li/libdigidocpp/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

76 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchurl,
cmake,
libtool,
libxml2,
minizip,
pcsclite,
opensc,
openssl,
xercesc,
pkg-config,
xsd,
zlib,
xmlsec,
xxd,
}:
stdenv.mkDerivation rec {
version = "4.0.0";
pname = "libdigidocpp";
src = fetchurl {
url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
hash = "sha256-0G7cjJEgLJ24SwHRznKJ18cRY0m50lr6HXstfbYq9f8=";
};
nativeBuildInputs = [
cmake
pkg-config
xxd
];
buildInputs = [
libxml2
minizip
pcsclite
opensc
openssl
xercesc
xsd
zlib
xmlsec
];
outputs = [
"out"
"lib"
"dev"
"bin"
];
# This wants to link to ${CMAKE_DL_LIBS} (ltdl), and there doesn't seem to be
# a way to tell CMake where this should be pulled from.
# A cleaner fix would probably be to patch cmake to use
# `-L${libtool.lib}/lib -ltdl` for `CMAKE_DL_LIBS`, but that's a world rebuild.
env.NIX_LDFLAGS = "-L${libtool.lib}/lib";
# 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
'';
meta = with lib; {
description = "Library for creating DigiDoc signature files";
mainProgram = "digidoc-tool";
homepage = "https://www.id.ee/";
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = [ maintainers.jagajaga ];
};
}