diff options
Diffstat (limited to 'pkgs/development/compilers/neko/default.nix')
-rw-r--r-- | pkgs/development/compilers/neko/default.nix | 95 |
1 files changed, 35 insertions, 60 deletions
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix index 28a98fe1e258..ddeeb51c25e4 100644 --- a/pkgs/development/compilers/neko/default.nix +++ b/pkgs/development/compilers/neko/default.nix @@ -1,69 +1,44 @@ -{ 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 + # temporarily, fixed in 1.8.3 + sed -i -e 's/^#if defined(_64BITS)/& || defined(__x86_64__)/' vm/neko.h + + 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 ]; -}) +} |