2021-01-23 13:15:07 +00:00
|
|
|
{ lib, stdenv, fetchurl, jdk, w3m, openssl, makeWrapper }:
|
|
|
|
with lib;
|
2015-03-21 20:28:11 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "picoLisp";
|
2020-07-06 04:04:30 +00:00
|
|
|
version = "20.6";
|
2015-03-21 20:28:11 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://www.software-lab.de/${pname}-${version}.tgz";
|
2020-07-06 04:04:30 +00:00
|
|
|
sha256 = "0l51x98bn1hh6kv40sdgp0x09pzg5i8yxbcjvm9n5bxsd6bbk5w2";
|
2011-03-28 08:16:15 +00:00
|
|
|
};
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [openssl] ++ optional stdenv.is64bit jdk;
|
2018-12-28 14:30:57 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i "s/which java/command -v java/g" mkAsm
|
|
|
|
|
|
|
|
${optionalString stdenv.isAarch32 ''
|
|
|
|
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
|
|
|
|
''}
|
2015-10-01 09:20:24 +00:00
|
|
|
'';
|
2015-03-21 20:28:11 +00:00
|
|
|
sourceRoot = ''picoLisp/src${optionalString stdenv.is64bit "64"}'';
|
2019-06-17 19:00:57 +00:00
|
|
|
postBuild = ''
|
|
|
|
cd ../src; make gate
|
|
|
|
'';
|
2015-03-21 20:28:11 +00:00
|
|
|
installPhase = ''
|
2011-03-28 08:16:15 +00:00
|
|
|
cd ..
|
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
|
2011-03-28 08:16:15 +00:00
|
|
|
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"
|
2019-06-17 19:00:57 +00:00
|
|
|
ln -s "$out/lib/picolisp/bin/httpGate" "$out/bin/httpGate"
|
2015-03-21 20:28:11 +00:00
|
|
|
|
2018-12-28 14:30:57 +00:00
|
|
|
|
|
|
|
makeWrapper $out/bin/picolisp $out/bin/pil \
|
2019-06-14 21:41:39 +00:00
|
|
|
--prefix PATH : ${w3m}/bin \
|
2018-12-28 14:30:57 +00:00
|
|
|
--add-flags "$out/lib/picolisp/lib.l" \
|
|
|
|
--add-flags "@lib/misc.l" \
|
|
|
|
--add-flags "@lib/btree.l" \
|
|
|
|
--add-flags "@lib/db.l" \
|
|
|
|
--add-flags "@lib/pilog.l"
|
2015-03-21 20:28:11 +00:00
|
|
|
|
|
|
|
mkdir -p "$out/share/emacs"
|
|
|
|
ln -s "$out/lib/picolisp/lib/el" "$out/share/emacs/site-lisp"
|
|
|
|
'';
|
|
|
|
|
2011-03-28 08:16:15 +00:00
|
|
|
meta = {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "A simple Lisp with an integrated database";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://picolisp.com/";
|
2015-03-21 20:28:11 +00:00
|
|
|
license = licenses.mit;
|
2016-08-02 14:41:28 +00:00
|
|
|
platforms = platforms.all;
|
2018-06-23 21:31:44 +00:00
|
|
|
broken = stdenv.isDarwin; # times out
|
2015-11-24 22:27:16 +00:00
|
|
|
maintainers = with maintainers; [ raskin tohl ];
|
2011-03-28 08:16:15 +00:00
|
|
|
};
|
2015-03-21 20:28:11 +00:00
|
|
|
|
2011-03-28 08:16:15 +00:00
|
|
|
passthru = {
|
|
|
|
updateInfo = {
|
|
|
|
downloadPage = "http://www.software-lab.de/down.html";
|
|
|
|
};
|
|
|
|
};
|
2015-03-21 20:28:11 +00:00
|
|
|
}
|