diff --git a/pkgs/applications/misc/haunt/default.nix b/pkgs/applications/misc/haunt/default.nix index c5794591edf6..989fce392b28 100644 --- a/pkgs/applications/misc/haunt/default.nix +++ b/pkgs/applications/misc/haunt/default.nix @@ -3,6 +3,7 @@ , fetchurl , fetchpatch , autoreconfHook +, callPackage , guile , guile-commonmark , guile-reader @@ -10,12 +11,12 @@ , pkg-config }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "haunt"; version = "0.2.6"; src = fetchurl { - url = "https://files.dthompson.us/${pname}/${pname}-${version}.tar.gz"; + url = "https://files.dthompson.us/haunt/haunt-${finalAttrs.version}.tar.gz"; hash = "sha256-vPKLQ9hDJdimEAXwIBGgRRlefM8/77xFQoI+0J/lkNs="; }; @@ -40,6 +41,7 @@ stdenv.mkDerivation rec { makeWrapper pkg-config ]; + buildInputs = [ guile guile-commonmark @@ -55,14 +57,13 @@ stdenv.mkDerivation rec { --prefix GUILE_LOAD_COMPILED_PATH : "$out/${guile.siteCcacheDir}:$GUILE_LOAD_COMPILED_PATH" ''; - doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - $out/bin/haunt --version - runHook postInstallCheck - ''; + passthru = { + tests = { + expectVersion = callPackage ./tests/001-test-version.nix { }; + }; + }; - meta = with lib; { + meta = { homepage = "https://dthompson.us/projects/haunt.html"; description = "Guile-based static site generator"; longDescription = '' @@ -81,8 +82,8 @@ stdenv.mkDerivation rec { feeds, authors should feel empowered to tweak, replace, or create builders to do things that aren't provided out-of-the-box. ''; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres AluisioASG ]; - platforms = guile.meta.platforms; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ AndersonTorres AluisioASG ]; + inherit (guile.meta) platforms; }; -} +}) diff --git a/pkgs/applications/misc/haunt/tests/001-test-version.nix b/pkgs/applications/misc/haunt/tests/001-test-version.nix new file mode 100644 index 000000000000..726a7ac95713 --- /dev/null +++ b/pkgs/applications/misc/haunt/tests/001-test-version.nix @@ -0,0 +1,21 @@ +{ lib +, stdenv +, haunt +}: + +stdenv.mkDerivation { + pname = "haunt-test-version"; + inherit (haunt) version; + + nativeBuildInputs = [ haunt ]; + + dontInstall = true; + + buildCommand = '' + haunt --version + + touch $out + ''; + + meta.timeout = 10; +}