From bd722f1105462dab55246d179711e917b72477d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Augusto=20Silva=20Gon=C3=A7alves?= Date: Fri, 30 Apr 2021 20:58:58 -0300 Subject: [PATCH 1/2] haunt: enable tests and verify that the binary works --- pkgs/applications/misc/haunt/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/haunt/default.nix b/pkgs/applications/misc/haunt/default.nix index 124e441a5af2..599403925254 100644 --- a/pkgs/applications/misc/haunt/default.nix +++ b/pkgs/applications/misc/haunt/default.nix @@ -27,12 +27,21 @@ stdenv.mkDerivation rec { guile-reader ]; + doCheck = true; + postInstall = '' wrapProgram $out/bin/haunt \ --prefix GUILE_LOAD_PATH : "$out/share/guile/site:${guile-commonmark}/share/guile/site:${guile-reader}/share/guile/site" \ --prefix GUILE_LOAD_COMPILED_PATH : "$out/share/guile/site:${guile-commonmark}/share/guile/site:${guile-reader}/share/guile/site" ''; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/haunt --version + runHook postInstallCheck + ''; + meta = with lib; { homepage = "https://dthompson.us/projects/haunt.html"; description = "Guile-based static site generator"; @@ -53,7 +62,7 @@ stdenv.mkDerivation rec { to do things that aren't provided out-of-the-box. ''; license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; + maintainers = with maintainers; [ AndersonTorres AluisioASG ]; platforms = guile.meta.platforms; }; } From a5c7cd5779954d345035ef152e99a82bd7691d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Augusto=20Silva=20Gon=C3=A7alves?= Date: Fri, 30 Apr 2021 21:09:05 -0300 Subject: [PATCH 2/2] haunt: fix Guile load paths Guile's version is part of the path and the installed files won't be found if we don't include it. Also, we can rely on the paths of build inputs being added to $GUILE_LOAD_PATH and $GUILE_LOAD_COMPILED_PATH by Guile's setup hook. --- pkgs/applications/misc/haunt/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/misc/haunt/default.nix b/pkgs/applications/misc/haunt/default.nix index 599403925254..87656d730b27 100644 --- a/pkgs/applications/misc/haunt/default.nix +++ b/pkgs/applications/misc/haunt/default.nix @@ -29,11 +29,15 @@ stdenv.mkDerivation rec { doCheck = true; - postInstall = '' - wrapProgram $out/bin/haunt \ - --prefix GUILE_LOAD_PATH : "$out/share/guile/site:${guile-commonmark}/share/guile/site:${guile-reader}/share/guile/site" \ - --prefix GUILE_LOAD_COMPILED_PATH : "$out/share/guile/site:${guile-commonmark}/share/guile/site:${guile-reader}/share/guile/site" - ''; + postInstall = + let + guileVersion = lib.versions.majorMinor guile.version; + in + '' + wrapProgram $out/bin/haunt \ + --prefix GUILE_LOAD_PATH : "$out/share/guile/site/${guileVersion}:$GUILE_LOAD_PATH" \ + --prefix GUILE_LOAD_COMPILED_PATH : "$out/lib/guile/${guileVersion}/site-ccache:$GUILE_LOAD_COMPILED_PATH" + ''; doInstallCheck = true; installCheckPhase = ''