From a998e097b2e1589ff243c40e9f7845f3a0f53fa3 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Fri, 22 Dec 2023 10:46:56 +1100 Subject: [PATCH] anastasis: init at 0.4.0 --- pkgs/by-name/anastasis/package.nix | 93 ++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 pkgs/by-name/anastasis/package.nix diff --git a/pkgs/by-name/anastasis/package.nix b/pkgs/by-name/anastasis/package.nix new file mode 100644 index 00000000..89413ef8 --- /dev/null +++ b/pkgs/by-name/anastasis/package.nix @@ -0,0 +1,93 @@ +{ + stdenv, + fetchzip, + pkg-config, + autoreconfHook, + taler-exchange, + taler-merchant, + libgcrypt, + libmicrohttpd, + jansson, + libsodium, + postgresql, + curl, + recutils, + libuuid, + lib, + gnunet, + makeWrapper, + which, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "anastasis"; + version = "0.4.0"; + + src = fetchzip { + url = "mirror://gnu/anastasis/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; + sha256 = "sha256-PMBHfJsrL/7w2s03J9hmeuZZJDt1p9wJ8iA4HykU3E8="; + }; + + postPatch = '' + patchShebangs src/cli + ''; + + outputs = ["out" "configured"]; + + nativeBuildInputs = [ + pkg-config # hook that adds pkg-config files of buildInputs + autoreconfHook # hook that triggers autoreconf to get the configure script + makeWrapper # for wrapProgram + ]; + + buildInputs = [ + taler-exchange + taler-merchant + libgcrypt + libmicrohttpd + libsodium + postgresql + curl + jansson + recutils + libuuid + ]; + + configureFlags = [ + "--with-gnunet=${gnunet}" + "--with-exchange=${taler-exchange}" + "--with-merchant=${taler-merchant}" + ]; + + postConfigure = '' + mkdir -p $configured + cp -r ./* $configured/ + ''; + + postInstall = '' + wrapProgram $out/bin/anastasis-config --prefix PATH : ${lib.makeBinPath [ + # Fix "anastasis-config-wrapped needs gnunet-config to be installed" + # in src/cli/test_anastasis_reducer_backup_enter_user_attributes.sh + # (NB: --with-gnunet was not enough) + gnunet + # needed by $out/bin/anastasis-config during postInstallCheck + which + ]} + ''; + + doInstallCheck = true; + + postInstallCheck = '' + # Check that anastasis-config can find gnunet at runtime + $out/bin/anastasis-config --help > /dev/null + ''; + + meta = { + description = '' + GNU Anastasis is a key backup and recovery tool from the GNU project. + This package includes the backend run by the Anastasis providers as + well as libraries for clients and a command-line interface. + ''; + license = lib.licenses.agpl3Plus; # from the README + homepage = "https://anastasis.lu"; + }; +})