aboutsummaryrefslogtreecommitdiff
path: root/pkgs/libatsha204
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-04-09 10:15:09 +0200
committerKarel Kočí <cynerd@email.cz>2022-04-12 21:48:06 +0200
commitfb73330d0ccdc50c79a8fe0675c51022ee64b367 (patch)
tree09b4e327026494c0d00a2604c4cf61c6497ceea2 /pkgs/libatsha204
parent1c2206f46fc9f608f805071dd5e036d46249756d (diff)
downloadnixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.tar.gz
nixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.tar.bz2
nixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.zip
pkgs: add libatsha204
Diffstat (limited to 'pkgs/libatsha204')
-rw-r--r--pkgs/libatsha204/default.nix37
1 files changed, 37 insertions, 0 deletions
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
+ '';
+}