nixos-config/pkgs/guile-hall.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

2022-01-17 07:29:14 +00:00
{ stdenv, lib, guile_3_0, guile-config, fetchFromGitLab, autoreconfHook
2022-01-25 08:37:33 +00:00
, pkg-config, texinfo, makeWrapper }:
2022-01-17 07:29:14 +00:00
2022-03-28 00:18:15 +00:00
let modules = [ guile-config ];
in stdenv.mkDerivation rec {
2022-01-17 07:29:14 +00:00
pname = "guile-hall";
version = "0.4.1";
src = fetchFromGitLab {
owner = "a-sassmannshausen";
repo = pname;
rev = version;
sha256 = "sha256-TUCN8kW44X6iGbSJURurcz/Tc2eCH1xgmXH1sMOMOXs=";
};
2022-01-25 08:37:33 +00:00
nativeBuildInputs = [ pkg-config autoreconfHook texinfo makeWrapper ];
propagatedBuildInputs = [ guile_3_0 ];
buildInputs = modules;
postConfigure = ''
sed -i '/moddir\s*=/s%=.*%=''${out}/share/guile/site%' Makefile
sed -i '/godir\s*=/s%=.*%=''${out}/share/guile/site%' Makefile
sed -i '/ccachedir\s*=/s%=.*%=''${out}/share/guile/site%' Makefile
'';
GUILE_LOAD_PATH = let
2022-03-28 00:18:15 +00:00
guilePath = [ "\${out}/share/guile/site" ] ++ (lib.concatMap (module: [
2022-01-25 08:37:33 +00:00
"${module}/share/guile/site"
"${module}/share/guile"
"${module}/share"
]) modules);
in lib.concatStringsSep ":" guilePath;
GUILE_LOAD_COMPILED_PATH = let
2022-03-28 00:18:15 +00:00
guilePath = [ "\${out}/share/guile/ccache" "\${out}/share/guile/site" ]
++ (lib.concatMap (module: [
"${module}/share/guile/ccache"
"${module}/share/guile/site"
"${module}/share/guile"
"${module}/share"
]) modules);
2022-01-25 08:37:33 +00:00
in lib.concatStringsSep ":" guilePath;
postInstall = ''
wrapProgram $out/bin/hall \
--prefix GUILE_LOAD_PATH : "${GUILE_LOAD_PATH}" \
--prefix GUILE_LOAD_COMPILED_PATH : "${GUILE_LOAD_COMPILED_PATH}"
'';
2022-01-17 07:29:14 +00:00
meta = with lib; {
description = "Command-line application for managing Guile projects";
homepage = "https://gitlab.com/a-sassmannshausen/guile-hall";
license = licenses.gpl3Only;
2022-01-25 08:37:33 +00:00
mainProgram = "hall";
2022-01-17 07:29:14 +00:00
};
}