Skip to content

Commit

Permalink
Merge #10104: picolisp, ccl and sbcl improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Oct 1, 2015
2 parents d5c92d5 + 673f3de commit 00935b2
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 58 deletions.
45 changes: 35 additions & 10 deletions pkgs/development/compilers/ccl/default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
{ stdenv, fetchsvn, gcc, glibc, m4, coreutils }:

/* TODO: there are also MacOS, FreeBSD and Windows versions */
assert stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux";
let
options = rec {
/* TODO: there are also MacOS, FreeBSD and Windows versions */
x86_64-linux = {
arch = "linuxx86";
sha256 = "04p77n18cw0bc8i66mp2vfrhlliahrx66lm004a3nw3h0mdk0gd8";
runtime = "lx86cl64";
kernel = "linuxx8664";
};
i686-linux = {
arch = "linuxx86";
sha256 = x86_64-linux.sha256;
runtime = "lx86cl";
kernel = "linuxx8632";
};
armv7l-linux = {
arch = "linuxarm";
sha256 = "0xg9p1q1fpgyfhwjk2hh24vqzddzx5zqff04lycf0vml5qw1gnkv";
runtime = "armcl";
kernel = "linuxarm";
};
armv6l-linux = armv7l-linux;
};
cfg = options.${stdenv.system};
in

assert builtins.hasAttr stdenv.system options;

stdenv.mkDerivation rec {
name = "ccl-${version}";
version = "1.10";
revision = "16313";

src = fetchsvn {
url = http://svn.clozure.com/publicsvn/openmcl/release/1.10/linuxx86/ccl;
url = "http://svn.clozure.com/publicsvn/openmcl/release/${version}/${cfg.arch}/ccl";
rev = revision;
sha256 = "04p77n18cw0bc8i66mp2vfrhlliahrx66lm004a3nw3h0mdk0gd8";
sha256 = cfg.sha256;
};

buildInputs = [ gcc glibc m4 ];

CCL_RUNTIME = if stdenv.system == "x86_64-linux" then "lx86cl64" else "lx86cl";
CCL_KERNEL = if stdenv.system == "x86_64-linux" then "linuxx8664" else "linuxx8632";
CCL_RUNTIME = cfg.runtime;
CCL_KERNEL = cfg.kernel;

patchPhase = ''
substituteInPlace lisp-kernel/${CCL_KERNEL}/Makefile \
Expand Down Expand Up @@ -45,11 +70,11 @@ stdenv.mkDerivation rec {
chmod a+x "$out"/bin/"${CCL_RUNTIME}"
'';

meta = {
meta = with stdenv.lib; {
description = "Clozure Common Lisp";
homepage = http://ccl.clozure.com/;
maintainers = with stdenv.lib.maintainers; [ raskin muflax ];
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.lgpl21;
maintainers = with maintainers; [ raskin muflax ];
platforms = attrNames options;
license = licenses.lgpl21;
};
}
63 changes: 46 additions & 17 deletions pkgs/development/compilers/sbcl/bootstrap.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, makeWrapper }:

let
options = rec {
x86_64-darwin = rec {
version = "1.1.8";
system = "x86-64-darwin";
sha256 = "006pr88053wclvbjfjdypnbiw8wymbzdzi7a6kbkpdfn4zf5943j";
};
x86_64-linux = rec {
version = "1.2.15";
system = "x86-64-linux";
sha256 = "1bpbfz9x2w73hy2kh8p0kd4m1p6pin90h2zycq52r3bbz8yv47aw";
};
i686-linux = rec {
version = "1.2.7";
system = "x86-linux";
sha256 = "07f3bz4br280qvn85i088vpzj9wcz8wmwrf665ypqx181pz2ai3j";
};
armv7l-linux = rec {
version = "1.2.14";
system = "armhf-linux";
sha256 = "0sp5445rbvms6qvzhld0kwwvydw51vq5iaf4kdqsf2d9jvaz3yx5";
};
armv6l-linux = armv7l-linux;
};
cfg = options.${stdenv.system};
in
stdenv.mkDerivation rec {
name = "sbcl-bootstrap-${version}";
version = "1.1.8";
version = cfg.version;

src = if stdenv.isDarwin
then fetchurl {
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-darwin-binary.tar.bz2;
sha256 = "006pr88053wclvbjfjdypnbiw8wymbzdzi7a6kbkpdfn4zf5943j";
}
else fetchurl {
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-linux-binary.tar.bz2;
sha256 = "0lh1jglxlfwk4cm6sgwk1jnb6ikhbrkx7p5aha2nbmkd6zl96prx";
};
src = fetchurl {
url = "mirror://sourceforge/project/sbcl/sbcl/${version}/sbcl-${version}-${cfg.system}-binary.tar.bz2";
sha256 = cfg.sha256;
};

buildInputs = [ makeWrapper ];

installPhase = ''
mkdir -p $out/bin
cp -p src/runtime/sbcl $out/bin
mkdir -p $out/share/sbcl
cp -p src/runtime/sbcl $out/share/sbcl
cp -p output/sbcl.core $out/share/sbcl
mkdir -p $out/bin
makeWrapper $out/share/sbcl/sbcl $out/bin/sbcl \
--add-flags "--core $out/share/sbcl/sbcl.core"
'';

postFixup = stdenv.lib.optionalString (!stdenv.isArm) ''
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/share/sbcl/sbcl

This comment has been minimized.

Copy link
@jwiegley

jwiegley Oct 1, 2015

Contributor

@vcunat This breaks Darwin because patchelf is not a binary there.

building path(s) ‘/nix/store/i0brqwigq6kszrn2c05jidakn954yn1q-sbcl-bootstrap-1.1.8’
unpacking sources
unpacking source archive /nix/store/dvw28bnnlcfhnf7zz1n3k6mnxp8rnbap-sbcl-1.1.8-x86-64-darwin-binary.tar.bz2
source root is sbcl-1.1.8-x86-64-darwin
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
post-installation fixup
gzipping man pages in /nix/store/i0brqwigq6kszrn2c05jidakn954yn1q-sbcl-bootstrap-1.1.8
stripping (with flags -S) in /nix/store/i0brqwigq6kszrn2c05jidakn954yn1q-sbcl-bootstrap-1.1.8/bin
strip: can't process non-object and non-archive file: /nix/store/i0brqwigq6kszrn2c05jidakn954yn1q-sbcl-bootstrap-1.1.8/bin/sbcl
patching script interpreter paths in /nix/store/i0brqwigq6kszrn2c05jidakn954yn1q-sbcl-bootstrap-1.1.8
cat: /nix/store/6ki2jnlp5b8fk4xmifrcpisxxspaby4c-clang-wrapper-3.6.2/nix-support/dynamic-linker: No such file or directory
/nix/store/5ykvbvl5147xk6s8cgx9f45z1p5mvibb-stdenv-darwin-boot-3/setup: line 78: patchelf: command not found

This comment has been minimized.

Copy link
@vcunat

vcunat Oct 2, 2015

Author Member

Hmm, I did notice this, but something confused me to believe the patchelf command was in the expression even before the PR and I saw it succeeding on Hydra.

/cc @tohl. Does this work well on Darwin when deleting this postFixup?

This comment has been minimized.

Copy link
@vcunat

vcunat Oct 2, 2015

Author Member

I don't fully understand, what are the rules for using patchelf are.

AFAIK darwin doesn't use ELF.

This comment has been minimized.

Copy link
@jwiegley

jwiegley Oct 6, 2015

Contributor

I haven't the time to build it this week, but the change looks like the right one to me.

'';

meta = {
meta = with stdenv.lib; {
description = "Lisp compiler";
homepage = "http://www.sbcl.org";
license = "bsd";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.unix;
license = licenses.publicDomain; # and FreeBSD
maintainers = [maintainers.raskin];
platforms = attrNames options;
};
}
33 changes: 12 additions & 21 deletions pkgs/development/compilers/sbcl/default.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{ stdenv, fetchurl, sbclBootstrap, clisp, which}:
{ stdenv, fetchurl, sbclBootstrap, sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit", which }:

stdenv.mkDerivation rec {
name = "sbcl-${version}";
version = "1.2.14";
version = "1.2.15";

src = fetchurl {
url = "mirror://sourceforge/project/sbcl/sbcl/${version}/${name}-source.tar.bz2";
sha256 = "01jw1w5siv6q16y1vmgd7s1i22aq0cqaipgn12jvq18c8vb6s55r";
sha256 = "0l8nrf5qnr8c9hr6bn1kd86mnr2s37b493azh9rrk3v59f56wnnr";
};

buildInputs = [ which ]
++ (stdenv.lib.optional stdenv.isDarwin sbclBootstrap)
++ (stdenv.lib.optional stdenv.isLinux clisp)
;
buildInputs = [ which ];

patchPhase = ''
echo '"${version}.nixos"' > version.lisp-expr
Expand All @@ -22,7 +19,10 @@ stdenv.mkDerivation rec {
(pushnew x features))
(disable (x)
(setf features (remove x features))))
(enable :sb-thread))) " > customize-target-features.lisp
#-arm
(enable :sb-thread)
#+arm
(enable :arm))) " > customize-target-features.lisp
pwd
Expand Down Expand Up @@ -64,24 +64,15 @@ stdenv.mkDerivation rec {
export HOME=$PWD/test-home
'';

buildPhase = if stdenv.isLinux
then ''
sh make.sh clisp --prefix=$out
''
else ''
sh make.sh --prefix=$out --xc-host='${sbclBootstrap}/bin/sbcl --core ${sbclBootstrap}/share/sbcl/sbcl.core --disable-debugger --no-userinit --no-sysinit'
'';
buildPhase = ''
sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}"
'';

installPhase = ''
INSTALL_ROOT=$out sh install.sh
'';

meta = {
description = "Lisp compiler";
homepage = http://www.sbcl.org;
license = stdenv.lib.licenses.bsd3;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.all;
meta = sbclBootstrap.meta // {
inherit version;
updateWalker = true;
};
Expand Down
15 changes: 12 additions & 3 deletions pkgs/development/interpreters/picolisp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ with stdenv.lib;

stdenv.mkDerivation rec {
name = "picoLisp-${version}";
version = "3.1.10";
version = "3.1.11";
src = fetchurl {
url = "http://www.software-lab.de/${name}.tgz";
sha256 = "1pn5c0d81rz1fazsdijhw4cqybaad2wn6qramdj2qqkzxa3vvll1";
sha256 = "01kgyz0lkz36lxvibv07qd06gwdxvvbain9f9cnya7a12kq3009i";
};
buildInputs = [ jdk ];
buildInputs = optional stdenv.is64bit jdk;
patchPhase = optionalString stdenv.isArm ''
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 ..
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/lisp-modules/lisp-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ let lispPackages = rec {
# Source type: git
src = pkgs.fetchgit {
url =
#''http://git.b9.com/clsql.git''
#''http://git.kpe.io/clsql.git''
"http://repo.or.cz/r/clsql.git"
;
sha256 = "1wzc7qsnq8hk0j0h9jmj4xczmh7h6njafwab2zylh8wxmfzwp2nw";
Expand All @@ -217,7 +217,7 @@ let lispPackages = rec {
deps = [];
# Source type: git
src = pkgs.fetchgit {
url = ''http://git.b9.com/uffi.git'';
url = ''http://git.kpe.io/uffi.git'';
sha256 = "219e4cfebfac251c922bcb9d517980b0988d765bd18b7f5cc765a43913aaacc6";
rev = ''a63da5b764b6fa30e32fcda4ddac88de385c9d5b'';
};
Expand Down Expand Up @@ -467,7 +467,7 @@ let lispPackages = rec {
deps = [];
# Source type: git
src = pkgs.fetchgit {
url = ''http://git.b9.com/cl-base64.git'';
url = ''http://git.kpe.io/cl-base64.git'';
sha256 = "a34196544cc67d54aef74e31eff2cee62a7861a5675d010fcd925f1c61c23e81";
rev = ''f375d1fc3a6616e95ae88bb33493bb99f920ba13'';
};
Expand All @@ -480,7 +480,7 @@ let lispPackages = rec {
deps = [];
# Source type: git
src = pkgs.fetchgit {
url = ''http://git.b9.com/puri.git'';
url = ''http://git.kpe.io/puri.git'';
sha256 = "71804698e7f3009fb7f570656af5d952465bfe77f72e9c41f7e2dda8a5b45c5e";
rev = ''68260dbf320c01089c8cee54ef32c800eefcde7f'';
};
Expand Down
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4701,9 +4701,7 @@ let
rustfmt = callPackage ../development/tools/rust/rustfmt { };

sbclBootstrap = callPackage ../development/compilers/sbcl/bootstrap.nix {};
sbcl = callPackage ../development/compilers/sbcl {
clisp = clisp;
};
sbcl = callPackage ../development/compilers/sbcl {};
# For StumpWM
sbcl_1_2_5 = callPackage ../development/compilers/sbcl/1.2.5.nix {
clisp = clisp;
Expand Down

0 comments on commit 00935b2

Please sign in to comment.