diff options
author | Aleksana <me@aleksana.moe> | 2024-06-22 18:45:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-22 18:45:21 +0800 |
commit | f56c8069d6e296403c5b889b039f970bda640f52 (patch) | |
tree | b3e12a86e7946b1c0a831dce619a3d375a4b3fc6 /pkgs/tools | |
parent | cfa9fc3e8028e788a401d272d14b8e333d7a5a7f (diff) | |
parent | ecb29e46676b21fa3dcd5ce6779b15cb32ce202c (diff) |
Merge pull request #304303 from anthonyroussel/yubico-piv-tool
yubico-piv-tool: add meta.pkgConfigModules, passthru.tests.pkg-config
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/misc/yubico-piv-tool/default.nix | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/pkgs/tools/misc/yubico-piv-tool/default.nix b/pkgs/tools/misc/yubico-piv-tool/default.nix index d3c73b62a7b6..eb3a88d1faac 100644 --- a/pkgs/tools/misc/yubico-piv-tool/default.nix +++ b/pkgs/tools/misc/yubico-piv-tool/default.nix @@ -10,9 +10,9 @@ , help2man , cmake , zlib -, withApplePCSC ? stdenv.isDarwin , nix-update-script , testers +, withApplePCSC ? stdenv.isDarwin }: stdenv.mkDerivation (finalAttrs: { @@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: { }; postPatch = '' - substituteInPlace CMakeLists.txt --replace "-Werror" "" + substituteInPlace CMakeLists.txt --replace-fail "-Werror" "" ''; nativeBuildInputs = [ @@ -41,32 +41,37 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ openssl - check zlib.dev ] ++ (if withApplePCSC then [ PCSC ] else [ pcsclite ]); cmakeFlags = [ - "-DGENERATE_MAN_PAGES=ON" - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_MANDIR=share/man" - "-DCMAKE_INSTALL_LIBDIR=lib" + (lib.cmakeBool "GENERATE_MAN_PAGES" true) + (lib.cmakeFeature "BACKEND" (if withApplePCSC then "macscard" else "pcsc")) + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") + (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") + (lib.cmakeFeature "CMAKE_INSTALL_MANDIR" "share/man") ]; - configureFlags = [ "--with-backend=${if withApplePCSC then "macscard" else "pcsc"}" ]; + doCheck = true; + + nativeCheckInputs = [ check ]; passthru = { updateScript = nix-update-script { extraArgs = [ "--version-regex" "yubico-piv-tool-([0-9.]+)$" ]; }; - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "yubico-piv-tool --version"; + tests = { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "yubico-piv-tool --version"; + }; }; }; - meta = with lib; { + meta = { homepage = "https://developers.yubico.com/yubico-piv-tool/"; changelog = "https://developers.yubico.com/yubico-piv-tool/Release_Notes.html"; description = '' @@ -80,9 +85,10 @@ stdenv.mkDerivation (finalAttrs: { certificates, and create certificate requests, and other operations. A shared library and a command-line tool is included. ''; - license = licenses.bsd2; - platforms = platforms.all; - maintainers = with maintainers; [ viraptor anthonyroussel ]; + license = lib.licenses.bsd2; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ viraptor anthonyroussel ]; mainProgram = "yubico-piv-tool"; + pkgConfigModules = [ "ykcs11" "ykpiv" ]; }; }) |