Merge remote-tracking branch 'upstream/master' into jhc

This commit is contained in:
Alexander Foremny
2012-10-07 17:58:43 +02:00
11 changed files with 239 additions and 278 deletions

View File

@@ -1,141 +1,33 @@
args: with args;
{ stdenv, fetchsvn, ocaml, zlib, neko }:
let
stdenv.mkDerivation {
name = "haxe-2.10";
src_haxe_swflib = {
# REGION AUTO UPDATE: { name = "haxe_swflib"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/swflib"; groups = "haxe_group"; }
src = sourceFromHead "haxe_swflib-F_10-43-46.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe_swflib-F_10-43-46.tar.gz"; sha256 = "a63de75e48bf500ef0e8ef715d178d32f0ef113ded8c21bbca698a8cc70e7b58"; });
# END
}.src;
buildInputs = [ocaml zlib neko];
src_haxe_extc = {
# REGION AUTO UPDATE: { name = "haxe_extc"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extc"; groups = "haxe_group"; }
src = sourceFromHead "haxe_extc-F_10-43-47.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extc-F_10-43-47.tar.gz"; sha256 = "d0a9980527d62ac6cfe27925ddb0964d334ec382f813fdfb8bd6c59fbbede730"; });
# END
}.src;
src_haxe_extlib_dev = {
# REGION AUTO UPDATE: { name = "haxe_extlib_dev"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extlib-dev"; groups = "haxe_group"; }
src = sourceFromHead "haxe_extlib_dev-F_10-43-48.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extlib_dev-F_10-43-48.tar.gz"; sha256 = "6b9037230e2615dd5e22f4e7f4165c84f2816bc526957683afc945394fcdf67e"; });
# END
}.src;
src_haxe_xml_light = {
# REGION AUTO UPDATE: { name = "haxe_xml_light"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/xml-light"; groups = "haxe_group"; }
src = sourceFromHead "haxe_xml_light-F_10-43-48.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe_xml_light-F_10-43-48.tar.gz"; sha256 = "be29d9e22ad0dbcb3d447cbbc14907aff5f89bb562b8db369659d299f3a5b44f"; });
# END
}.src;
src_haxe_neko_include = {
# REGION AUTO UPDATE: { name = "haxe_neko_include"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko/libs/include/ocaml"; groups = "haxe_group"; }
src = sourceFromHead "haxe_neko_include-F_10-43-49.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe_neko_include-F_10-43-49.tar.gz"; sha256 = "e49efc1b348fa6e0f6fb40079a2d380b947d9ebda31843bc293f3cc77f8453db"; });
# END
}.src;
src_haxe = {
# REGION AUTO UPDATE: { name="haxe-read-only"; type="svn"; url="http://haxe.googlecode.com/svn/trunk"; groups = "haxe_group"; }
src = sourceFromHead "haxe-read-only-3220.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/haxe-read-only-3220.tar.gz"; sha256 = "2b6702dca95d0829e539cea07b8224e3848e584a425ce8f8e0984a7a2bf7b1f8"; });
# END
}.src;
# the HaXe compiler
haxe = stdenv.mkDerivation {
name = "haxe-cvs";
buildInputs = [ocaml zlib makeWrapper];
src = src_haxe;
inherit zlib;
buildPhase = ''
set -x
mkdir -p ocaml/{swflib,extc,extlib-dev,xml-light} neko/libs
# strange setup. install.ml seems to co the same repo again into haxe directory!
mkdir haxe
tar xfz $src --strip-components=1 -C haxe
t(){ tar xfz $1 -C $2 --strip-components=2; }
t ${src_haxe_swflib} ocaml/swflib
t ${src_haxe_extc} ocaml/extc
t ${src_haxe_extlib_dev} ocaml/extlib-dev
t ${src_haxe_xml_light} ocaml/xml-light
t ${src_haxe_neko_include} neko/libs
sed -e '/download();/d' \
-e "s@/usr/lib/@''${zlib}/lib/@g" \
doc/install.ml > install.ml
ocaml install.ml
'';
# probably rpath should be set properly
installPhase = ''
mkdir -p $out/lib/haxe
cp -r bin $out/bin
wrapProgram "$out/bin/haxe" \
--set "LD_LIBRARY_PATH" $zlib/lib \
--set HAXE_LIBRARY_PATH "''${HAXE_LIBRARY_PATH}''${HAXE_LIBRARY_PATH:-:}:$out/lib/haxe/std:."
cp -r std $out/lib/haxe/
'';
meta = {
description = "programming language targeting JavaScript, Flash, NekVM, PHP, C++";
homepage = http://haxe.org;
license = ["GPLv2" "BSD2" /*?*/ ]; # -> docs/license.txt
maintainers = [args.lib.maintainers.marcweber];
platforms = args.lib.platforms.linux;
};
};
# build a tool found in std/tools/${name} source directory
# the .hxml files contain a recipe to cerate a binary.
tool = { name, description }: stdenv.mkDerivation {
inherit name;
src = src_haxe;
buildPhase = ''
cd std/tools/${name};
haxe *.hxml
mkdir -p $out/bin
mv ${name} $out/bin/
'';
buildInputs = [haxe neko];
dontStrip=1;
installPhase=":";
meta = {
inherit description;
homepage = http://haxe.org;
# license = "?"; TODO
maintainers = [args.lib.maintainers.marcweber];
platforms = args.lib.platforms.linux;
};
};
in
{
inherit haxe;
haxelib = tool {
name = "haxelib";
description = "haxelib is a HaXe library management tool similar to easyinstall or ruby gems";
src = fetchsvn {
url = "http://haxe.googlecode.com/svn/tags/v2-10";
sha256 = "dbd3c655e4136eb68a165ef83b96bfc1f0f2eb9ec8729603b19bcd717a61a679";
};
prePatch = ''
sed -i -e 's|com.class_path <- \[|&"'"$out/lib/haxe/std/"'";|' main.ml
'';
installPhase = ''
install -vd "$out/bin" "$out/lib/haxe/std"
install -vt "$out/bin" haxe haxelib haxedoc
find std -mindepth 1 -maxdepth 1 -path std/tools -o \
-exec cp -vr '{}' "$out/lib/haxe/std" \;
'';
dontStrip = true;
meta = {
description = "Programming language targeting JavaScript, Flash, NekoVM, PHP, C++";
homepage = http://haxe.org;
license = ["GPLv2" "BSD2" /*?*/ ]; # -> docs/license.txt
maintainers = [stdenv.lib.maintainers.marcweber];
platforms = stdenv.lib.platforms.linux;
};
}

View File

@@ -1,69 +1,42 @@
{ composableDerivation, lib, fetchurl, mysql, apacheHttpd, zlib, sqlite
, pcre, apr, gtk, boehmgc, pkgconfig, makeWrapper, sourceFromHead }:
{ stdenv, fetchurl, boehmgc, zlib, sqlite, pcre }:
let
stdenv.mkDerivation rec {
name = "neko-${version}";
version = "1.8.2";
inherit (composableDerivation) edf wwf;
libs = [ mysql apacheHttpd zlib sqlite pcre apr gtk ];
includes = lib.concatMapStrings (x: ''"${x}/include",'' ) libs + ''"{gkt}/include/gtk-2.0",'';
in
composableDerivation.composableDerivation {} ( fixed : {
name = "neko-cvs";
# REGION AUTO UPDATE: { name="neko"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko"; groups = "haxe_group"; }
src = sourceFromHead "neko-F_16-06-48.tar.gz"
(fetchurl { url = "http://mawercer.de/~nix/repos/neko-F_16-06-48.tar.gz"; sha256 = "e952582a26099b7a5568d0798839a6d349331510ffe6d7936b4537d60b6ccf26"; });
# END
# optionally remove apache mysql like gentoo does?
# they just remove libs/{apache,mod_neko}
buildInputs = [boehmgc pkgconfig makeWrapper] ++ libs;
# apr should be in apacheHttpd propagatedBuildInputs
preConfigure = ''
sed -i \
-e 's@"/usr/include",@${includes}@' \
src/tools/install.neko
sed -i "s@/usr/local@$out@" Makefile vm/load.c
# make sure that nekotools boot finds the neko executable and not our wrapper:
mkdir -p $out/{bin,lib}
sed -i "s@\"neko\"@\".neko-wrapped\"@" src/tools/nekoboot.neko
ln -s ./neko bin/.neko-wrapped
'';
inherit zlib;
meta = {
description = "Neko is an high-level dynamicly typed programming language";
homepage = http://nekovm.org;
license = ["GPLv2" ]; # -> docs/license.txt
maintainers = [ lib.maintainers.marcweber ];
platforms = lib.platforms.linux;
src = fetchurl {
url = "http://nekovm.org/_media/neko-${version}.tar.gz";
sha256 = "099727w6dk689z3pcgbhsqjl74zzrh82a5vb2abxynamcqxcgz1w";
};
# if stripping was done neko and nekoc would be the same. ?!
dontStrip = 1;
prePatch = with stdenv.lib; let
libs = concatStringsSep "," (map (lib: "\"${lib}/include\"") buildInputs);
in ''
sed -i -e '/^search_includes/,/^}/c \
search_includes = function(_) { return $array(${libs}) }
' src/tools/install.neko
sed -i -e '/allocated = strdup/s|"[^"]*"|"'"$out/lib/neko:$out/bin"'"|' \
vm/load.c
# neko-wrapped: nekotools boot has to find it. So don't prefix wrapped executable by "."
postInstall = ''
for prog in nekotools nekoc; do
wrapProgram "$out/bin/$prog" \
--prefix "LD_LIBRARY_PATH" $out/lib/neko
for disabled_mod in mod_neko{,2} mod_tora{,2} mysql ui; do
sed -i -e '/^libs/,/^}/{/^\s*'"$disabled_mod"'\s*=>/,/^\s*}/d}' \
src/tools/install.neko
done
wrapProgram "$out/bin/neko" \
--prefix "LD_LIBRARY_PATH" $out/lib/neko
# create symlink so that nekotools boot finds not wrapped neko-wrapped executable
ln -s ln -s ../../bin/.neko-wrapped $out/lib/neko
'';
# TODO make them optional and make them work
patches = [ ./disable-modules.patch ];
})
makeFlags = "INSTALL_PREFIX=$(out)";
buildInputs = [ boehmgc zlib sqlite pcre ];
dontStrip = true;
preInstall = ''
install -vd "$out/lib" "$out/bin"
'';
meta = {
description = "A high-level dynamically typed programming language";
homepage = http://nekovm.org;
license = stdenv.lib.licenses.lgpl21;
maintainers = [ stdenv.lib.maintainers.marcweber ];
platforms = stdenv.lib.platforms.linux;
};
}

View File

@@ -1,59 +0,0 @@
diff --git a/src/tools/install.neko b/src/tools/install.neko
index 4cffa5e..5702add 100644
--- a/src/tools/install.neko
+++ b/src/tools/install.neko
@@ -39,26 +39,6 @@ buffer_string = $loader.loadprim("std@buffer_string",1);
// LIBS DATAS
libs = {
- mod_neko => {
- src => $array("../../vm/stats","mod_neko","cgi"),
- inc => "httpd.h",
- incname => "Apache 1.3.x"
- },
- mod_neko2 => {
- src => $array("../../vm/stats","mod_neko","cgi"),
- inc => $array("httpd.h","apr.h"),
- incname => "Apache 2.2.x",
- cflags => "-D_LARGEFILE64_SOURCE",
- realdir => "mod_neko",
- apache2 => true,
- },
- mysql => {
- src => $array("mysql"),
- inc => "mysql.h",
- incname => "MySQL 4.+"
- lib => "libmysqlclient_r.a",
- lparams => "-lz -lssl"
- },
mysql5 => {
src => $array("../common/sha1","../common/socket","my_proto/my_proto","my_proto/my_api","mysql"),
inc => $array(),
@@ -83,27 +63,6 @@ libs = {
incname => "Sqlite 3",
lparams => "-lsqlite3",
},
- ui => {
- src => $array("ui"),
- inc => switch system { "Mac" => "Carbon.h" default => "gtk/gtk.h" },
- incname => switch system { "Mac" => "Carbon" default => "GTK+2.0" },
- cflags => switch system { "Mac" => "" default => "`pkg-config --cflags gtk+-2.0`" },
- lparams => switch system { "Mac" => "-framework Carbon" default => "`pkg-config --libs gtk+-2.0` -lgthread-2.0" },
- },
- mod_tora => {
- src => $array("../common/socket","protocol","mod_tora"),
- inc => "httpd.h",
- incname => "Apache 1.3.x",
- cflags => "-I../common",
- },
- mod_tora2 => {
- src => $array("../common/socket","protocol","mod_tora"),
- inc => $array("httpd.h","apr.h"),
- incname => "Apache 2.2.x",
- cflags => "-D_LARGEFILE64_SOURCE -I../common",
- realdir => "mod_tora",
- apache2 => true,
- },
}
// PLATFORM