Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picoLisp 16.12 -> 18.12 #53010

Merged
merged 1 commit into from Dec 31, 2018
Merged

picoLisp 16.12 -> 18.12 #53010

merged 1 commit into from Dec 31, 2018

Conversation

osmano807
Copy link
Contributor

@osmano807 osmano807 commented Dec 28, 2018

Motivation for this change

picoLisp has an old package, and the default package doesn't pass shell arguments to the installed binary

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

{ stdenv, fetchurl, jdk, makeWrapper }:
with stdenv.lib;

stdenv.mkDerivation rec {
  name = "picoLisp-${version}";
  version = "18.12";
  src = fetchurl {
    url = "https://www.software-lab.de/${name}.tgz";
    sha256 = "0hvgq2vc03bki528jqn95xmvv7mw8xx832spfczhxc16wwbrnrhk";
  };
  buildInputs = [makeWrapper] ++ optional stdenv.is64bit jdk;
  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
    ''}
  '';
  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"


    makeWrapper $out/bin/picolisp $out/bin/pil \
      --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"

    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 = https://picolisp.com/;
    license = licenses.mit;
    platforms = platforms.all;
    broken = stdenv.isDarwin; # times out
    maintainers = with maintainers; [ raskin tohl ];
  };

  passthru = {
    updateInfo = {
      downloadPage = "http://www.software-lab.de/down.html";
    };
  };
}
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@infinisil infinisil merged commit 61e4654 into NixOS:master Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants