adding two versions of metaocaml
svn path=/nixpkgs/trunk/; revision=31026
This commit is contained in:
parent
f821677f67
commit
83452ba0ab
3 changed files with 99 additions and 0 deletions
63
pkgs/development/compilers/ocaml/ber-metaocaml-003.nix
Normal file
63
pkgs/development/compilers/ocaml/ber-metaocaml-003.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ stdenv, fetchurl, ncurses, x11 }:
|
||||
|
||||
let
|
||||
useX11 = stdenv.isi686 || stdenv.isx86_64;
|
||||
useNativeCompilers = stdenv.isi686 || stdenv.isx86_64 || stdenv.isMips;
|
||||
inherit (stdenv.lib) optionals optionalString;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
name = "ber-metaocaml-003";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.2.tar.bz2";
|
||||
sha256 = "0hw1yp1mmfyn1pmda232d0ry69m7ln1z0fn5lgi8nz3y1mx3iww6";
|
||||
};
|
||||
|
||||
metaocaml = fetchurl {
|
||||
url = "http://okmij.org/ftp/ML/ber-metaocaml.tar.gz";
|
||||
sha256 = "1kq1if25c1wvcdiy4g46xk05dkc1am2gc4qvmg4x19wvvaz09gzf";
|
||||
};
|
||||
|
||||
# Needed to avoid a SIGBUS on the final executable on mips
|
||||
NIX_CFLAGS_COMPILE = if stdenv.isMips then "-fPIC" else "";
|
||||
|
||||
patches = optionals stdenv.isDarwin [ ./gnused-on-osx-fix.patch ];
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11 ];
|
||||
buildFlags = "core coreboot all"; # "world" + optionalString useNativeCompilers " bootstrap world.opt";
|
||||
buildInputs = [ncurses] ++ optionals useX11 [ x11 ];
|
||||
installFlags = "-i";
|
||||
installTargets = "install"; # + optionalString useNativeCompilers " installopt";
|
||||
prePatch = ''
|
||||
CAT=$(type -tp cat)
|
||||
sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
|
||||
patch -p0 < ${./mips64.patch}
|
||||
'';
|
||||
postConfigure = ''
|
||||
tar -xvzf $metaocaml
|
||||
cd ${name}
|
||||
make patch
|
||||
cd ..
|
||||
'';
|
||||
postBuild = ''
|
||||
ensureDir $out/include
|
||||
ln -sv $out/lib/ocaml/caml $out/include/caml
|
||||
'';
|
||||
postInstall = ''
|
||||
cd ${name}
|
||||
make all
|
||||
make install
|
||||
make test
|
||||
make test-compile
|
||||
cd ..
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://okmij.org/ftp/ML/index.html#ber-metaocaml";
|
||||
licenses = [ "QPL" /* compiler */ "LGPLv2" /* library */ ];
|
||||
description = "a conservative extension of OCaml with the primitive type of code values, and three basic multi-stage expression forms: Brackets, Escape, and Run";
|
||||
};
|
||||
}
|
32
pkgs/development/compilers/ocaml/metaocaml-3.09.nix
Normal file
32
pkgs/development/compilers/ocaml/metaocaml-3.09.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ stdenv, fetchurl, x11, ncurses }:
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
|
||||
name = "metaocaml-3.09-alpha-30";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.metaocaml.org/dist/old/MetaOCaml_309_alpha_030.tar.gz";
|
||||
sha256 = "0migbn0zwfb7yb24dy7qfqi19sv3drqcv4369xi7xzpds2cs35fd";
|
||||
};
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
configureFlags = ["-no-tk" "-x11lib" x11];
|
||||
buildFlags = "world bootstrap world.opt";
|
||||
buildInputs = [x11 ncurses];
|
||||
installTargets = "install installopt";
|
||||
patchPhase = ''
|
||||
CAT=$(type -tp cat)
|
||||
sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
|
||||
'';
|
||||
postBuild = ''
|
||||
ensureDir $out/include
|
||||
ln -sv $out/lib/ocaml/caml $out/include/caml
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://www.metaocaml.org/;
|
||||
license = "QPL, LGPL2 (library part)";
|
||||
desctiption = "A compiled, type-safe, multi-stage programming language";
|
||||
};
|
||||
|
||||
})
|
|
@ -2335,6 +2335,10 @@ let
|
|||
|
||||
ocaml_3_12_1 = lowPrio (callPackage ../development/compilers/ocaml/3.12.1.nix { });
|
||||
|
||||
metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { };
|
||||
|
||||
ber_metaocaml_003 = callPackage ../development/compilers/ocaml/ber-metaocaml-003.nix { };
|
||||
|
||||
mkOcamlPackages = ocaml: self: let callPackage = newScope self; in rec {
|
||||
inherit ocaml;
|
||||
|
||||
|
|
Loading…
Reference in a new issue