summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2012-10-07 11:18:25 +0200
committeraszlig <aszlig@redmoonstudios.org>2012-10-07 11:41:19 +0200
commite5239b78bdade58995b0741b82987fa0676da8c9 (patch)
tree5ca1be676a46c70da08d44d41a570a4677a6cf72 /pkgs/development/compilers
parent79fa3e218136b777c6498fe7915aa244979f739f (diff)
downloadnixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar.gz
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar.bz2
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar.lz
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar.xz
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.tar.zst
nixpkgs-e5239b78bdade58995b0741b82987fa0676da8c9.zip
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/neko/default.nix93
-rw-r--r--pkgs/development/compilers/neko/disable-modules.patch59
2 files changed, 33 insertions, 119 deletions
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix
index 28a98fe1e25..64e1741ae5c 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
+  src = fetchurl {
+    url = "http://nekovm.org/_media/neko-${version}.tar.gz";
+    sha256 = "099727w6dk689z3pcgbhsqjl74zzrh82a5vb2abxynamcqxcgz1w";
+  };
 
-  # 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
+  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
+
+    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
+  '';
 
-  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}
+  makeFlags = "INSTALL_PREFIX=$(out)";
+  buildInputs = [ boehmgc zlib sqlite pcre ];
+  dontStrip = true;
 
-    sed -i "s@\"neko\"@\".neko-wrapped\"@" src/tools/nekoboot.neko
-    ln -s ./neko bin/.neko-wrapped
+  preInstall = ''
+    install -vd "$out/lib" "$out/bin"
   '';
 
-  inherit zlib;
-
-  meta = { 
-    description = "Neko is an high-level dynamicly typed programming language";
+  meta = {
+    description = "A high-level dynamically typed programming language";
     homepage = http://nekovm.org;
-    license = ["GPLv2" ];  # -> docs/license.txt
-    maintainers = [ lib.maintainers.marcweber ];
-    platforms = lib.platforms.linux;
+    license = stdenv.lib.licenses.lgpl21;
+    maintainers = [ stdenv.lib.maintainers.marcweber ];
+    platforms = stdenv.lib.platforms.linux;
   };
-
-  # if stripping was done neko and nekoc would be the same. ?!
-  dontStrip = 1;
-
-  # 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
-    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 ];
-})
+}
diff --git a/pkgs/development/compilers/neko/disable-modules.patch b/pkgs/development/compilers/neko/disable-modules.patch
deleted file mode 100644
index d4d5a8eb30e..00000000000
--- 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