diff options
author | Karel Kočí <cynerd@email.cz> | 2022-04-09 10:15:09 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-04-12 21:48:06 +0200 |
commit | fb73330d0ccdc50c79a8fe0675c51022ee64b367 (patch) | |
tree | 09b4e327026494c0d00a2604c4cf61c6497ceea2 /pkgs | |
parent | 1c2206f46fc9f608f805071dd5e036d46249756d (diff) | |
download | nixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.tar.gz nixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.tar.bz2 nixturris-fb73330d0ccdc50c79a8fe0675c51022ee64b367.zip |
pkgs: add libatsha204
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/default.nix | 2 | ||||
-rw-r--r-- | pkgs/libatsha204/default.nix | 37 |
2 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index 41b2985..e85fffe 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,6 +12,8 @@ let turrispkgs = with pkgs; { + # Crypto + libatsha204 = callPackage ./libatsha204 { }; # Overrides to get armv7 to work bison = armv7lDisableCheck nixpkgs.bison; 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 + ''; +} |