1 { lib, stdenv, fetchurl, jdk, w3m, openssl, makeWrapper }:
3 stdenv.mkDerivation rec {
7 url = "https://www.software-lab.de/${pname}-${version}.tgz";
8 sha256 = "0l51x98bn1hh6kv40sdgp0x09pzg5i8yxbcjvm9n5bxsd6bbk5w2";
10 nativeBuildInputs = [ makeWrapper ];
11 buildInputs = [openssl] ++ lib.optional stdenv.is64bit jdk;
13 sed -i "s/which java/command -v java/g" mkAsm
15 ${lib.optionalString stdenv.isAarch32 ''
16 sed -i s/-m32//g Makefile
19 \$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
21 \$(CC) \$(CFLAGS) -fPIC -D_OS='"\$(OS)"' \$*.c
25 sourceRoot = ''picoLisp/src${lib.optionalString stdenv.is64bit "64"}'';
32 mkdir -p "$out/share/picolisp" "$out/lib" "$out/bin"
33 cp -r . "$out/share/picolisp/build-dir"
34 ln -s "$out/share/picolisp/build-dir" "$out/lib/picolisp"
35 ln -s "$out/lib/picolisp/bin/picolisp" "$out/bin/picolisp"
36 ln -s "$out/lib/picolisp/bin/httpGate" "$out/bin/httpGate"
39 makeWrapper $out/bin/picolisp $out/bin/pil \
40 --prefix PATH : ${w3m}/bin \
41 --add-flags "$out/lib/picolisp/lib.l" \
42 --add-flags "@lib/misc.l" \
43 --add-flags "@lib/btree.l" \
44 --add-flags "@lib/db.l" \
45 --add-flags "@lib/pilog.l"
47 mkdir -p "$out/share/emacs"
48 ln -s "$out/lib/picolisp/lib/el" "$out/share/emacs/site-lisp"
52 # darwin: build times out
53 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
54 description = "A simple Lisp with an integrated database";
55 homepage = "https://picolisp.com/";
56 license = licenses.mit;
57 maintainers = with maintainers; [ raskin ];
58 platforms = platforms.all;
63 downloadPage = "https://www.software-lab.de/down.html";