39 lines
961 B
Nix
39 lines
961 B
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
pname = "gulie";
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
buildInputs = [ pkgs.guile ];
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
# Install Guile source modules
|
|
install -d $out/share/guile/site/3.0
|
|
cp -r gulie $out/share/guile/site/3.0/
|
|
|
|
# Install binary, patching the shebang to use the Nix store guile
|
|
install -D -m 755 bin/gulie $out/bin/gulie
|
|
substituteInPlace $out/bin/gulie \
|
|
--replace-fail '#!/usr/bin/env -S guile' '#!${pkgs.guile}/bin/guile'
|
|
|
|
# Wrap so GUILE_LOAD_PATH is set at runtime — modules live under site/3.0
|
|
wrapProgram $out/bin/gulie \
|
|
--set GUILE_LOAD_PATH "$out/share/guile/site/3.0"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "Linter and formatter for Guile Scheme";
|
|
mainProgram = "gulie";
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|