From fb73330d0ccdc50c79a8fe0675c51022ee64b367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 9 Apr 2022 10:15:09 +0200 Subject: pkgs: add libatsha204 --- pkgs/libatsha204/default.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/libatsha204/default.nix (limited to 'pkgs/libatsha204') diff --git a/pkgs/libatsha204/default.nix b/pkgs/libatsha204/default.nix new file mode 100644 index 0000000..2415985 --- /dev/null +++ b/pkgs/libatsha204/default.nix @@ -0,0 +1,37 @@ +{ stdenv, lib, fetchgit +, pkg-config, perl, patchelf +,glibc , openssl, unbound +}: + +stdenv.mkDerivation rec { + pname = "libatsha204"; + version = "29.2"; + meta = with lib; { + homepage = "https://gitlab.nic.cz/turris/libatsha204"; + description = "Turris Atsha204 library and tools"; + platforms = platforms.linux; + license = licenses.gpl3; + }; + + src = fetchgit { + url = "https://gitlab.nic.cz/turris/libatsha204.git"; + rev = "v" + version; + fetchSubmodules = true; + sha256 = "1lhvqdy2sfbvz9y9lwqhxggpr8rwfd66v73gv9s7b7811r6way20"; + }; + + buildInputs = [openssl unbound]; + nativeBuildInputs = [pkg-config perl patchelf]; + + makeFlags = [ "RELEASE=1" "NO_DOC=1" ]; + configurePhase = '' + sed -i 's|/usr/bin/perl|${perl}/bin/perl|' build/embed_gen.pl build/normalize_dep_file.pl + ''; + installPhase = '' + mkdir -p $out/usr/include $out/lib $out/bin + cp src/libatsha204/atsha204.h $out/usr/include/ + cp lib/libatsha204.so* $out/lib + cp bin/atsha204cmd $out/bin + patchelf --set-rpath $out/lib:${openssl.out}/lib:${unbound.lib}/lib:${glibc}/lib $out/bin/atsha204cmd + ''; +} -- cgit v1.2.3