From e5239b78bdade58995b0741b82987fa0676da8c9 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 7 Oct 2012 11:18:25 +0200 Subject: [PATCH] neko: Rewrite package from scratch, version 1.8.2. This should simplify the input of the derivation builder significantly and of course we don't need to rely on mawercer.de to supply the needed files. Also, the derivation name doesn't include "-cvs" anymore, as we're building from the release tarball. In addition, we don't need the patch anymore, as it was so simple that it could be done easily with sed. Signed-off-by: aszlig --- pkgs/development/compilers/neko/default.nix | 95 +++++++------------ .../compilers/neko/disable-modules.patch | 59 ------------ 2 files changed, 34 insertions(+), 120 deletions(-) delete mode 100644 pkgs/development/compilers/neko/disable-modules.patch diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix index 28a98fe1e258..64e1741ae5c3 100644 --- a/pkgs/development/compilers/neko/default.nix +++ b/pkgs/development/compilers/neko/default.nix @@ -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; + }; +} diff --git a/pkgs/development/compilers/neko/disable-modules.patch b/pkgs/development/compilers/neko/disable-modules.patch deleted file mode 100644 index d4d5a8eb30ee..000000000000 --- a/pkgs/development/compilers/neko/disable-modules.patch +++ /dev/null @@ -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