Created
August 22, 2020 05:32
-
-
Save LaloHao/f690ca8c3f331894e9d5e1ecba86d6a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
inherit (pkgs) ecl gcc readline stdenv writeTextFile; | |
inherit (builtins) fetchurl; | |
in stdenv.mkDerivation rec { | |
name = "ecl-readline"; | |
version = "0.4.1"; | |
buildInputs = [ | |
gcc readline ecl | |
]; | |
binary = '' | |
#!/usr/bin/env bash | |
${ecl}/bin/ecl -load "$out/lib/init.lsp" "\$@" | |
''; | |
library = '' | |
(load #P\"$out/lib/ecl-readline.fas\") | |
(load #P\"$out/lib/ecl-completions.fas\") | |
(ecl-readline::enable) | |
''; | |
src = fetchurl { | |
url = "http://www.common-lisp.net/project/ecl-readline/releases/${name}-${version}.tar.gz"; | |
sha256 = "1d83hixfi6144ai55nplzxpqwy4xcnz21q4y1xq57h021y8pbh89"; | |
}; | |
unpackPhase = "tar xzf $src"; | |
buildPhases = [ "unpackPhase" "buildPhase" "installPhase" ]; | |
buildPhase = '' | |
cd ${name}-${version} | |
${ecl}/bin/ecl -compile ecl-readline.lisp -o ecl-readline.fas | |
${ecl}/bin/ecl -load ecl-readline.fas -compile ecl-completions.lisp -o ecl-completions.fas | |
''; | |
installPhase = '' | |
mkdir -p "$out/bin" "$out/lib" | |
mv *.fas "$out/lib" | |
echo "${binary}" > "$out/bin/ecl" | |
echo "${library}" > "$out/lib/init.lsp" | |
chmod +x "$out/bin/ecl" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment