Skip to content

Commit

Permalink
Merge pull request #136 from ngi-nix/add/anastasis
Browse files Browse the repository at this point in the history
anastasis: init at 0.4.0
  • Loading branch information
alejandrosame authored Dec 28, 2023
2 parents d999b58 + a998e09 commit a9b16ad
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions pkgs/by-name/anastasis/package.nix
Original file line number Diff line number Diff line change
@@ -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";
};
})

0 comments on commit a9b16ad

Please sign in to comment.