1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 11:02:05 +00:00
nixpkgs/pkgs/development/interpreters/picolisp/default.nix

55 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, jdk }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "picoLisp-${version}";
2015-09-27 21:31:08 +01:00
version = "3.1.11";
src = fetchurl {
url = "http://www.software-lab.de/${name}.tgz";
2015-09-27 21:31:08 +01:00
sha256 = "01kgyz0lkz36lxvibv07qd06gwdxvvbain9f9cnya7a12kq3009i";
};
2015-09-27 21:36:58 +01:00
buildInputs = if stdenv.is64bit then [ jdk ] else [];
patchPhase = if stdenv.isArm then ''
sed -i s/-m32//g Makefile
cat >>Makefile <<EOF
ext.o: ext.c
\$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
ht.o: ht.c
\$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
EOF
''
else "";
sourceRoot = ''picoLisp/src${optionalString stdenv.is64bit "64"}'';
installPhase = ''
cd ..
mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
cp -r . "$out/share/picolisp/build-dir"
ln -s "$out/share/picolisp/build-dir" "$out/lib/picolisp"
ln -s "$out/lib/picolisp/bin/picolisp" "$out/bin/picolisp"
cat >"$out/bin/pil" <<EOF
#! /bin/sh
$out/bin/picolisp $out/lib/picolisp/lib.l @lib/misc.l @lib/btree.l @lib/db.l @lib/pilog.l
EOF
chmod +x "$out/bin/pil"
mkdir -p "$out/share/emacs"
ln -s "$out/lib/picolisp/lib/el" "$out/share/emacs/site-lisp"
'';
meta = {
description = "A simple Lisp with an integrated database.";
homepage = http://picolisp.com/;
license = licenses.mit;
platform = platforms.all;
maintainers = with maintainers; [ raskin ];
};
passthru = {
updateInfo = {
downloadPage = "http://www.software-lab.de/down.html";
};
};
}