diff options
author | Marc Weber <marco-oweber@gmx.de> | 2010-03-16 23:34:56 +0000 |
---|---|---|
committer | Marc Weber <marco-oweber@gmx.de> | 2010-03-16 23:34:56 +0000 |
commit | 19f0cd20fd92423497056a28362344bf6f79f3d6 (patch) | |
tree | 567c531023e970d852b37fb7286fba21d3d386ee /pkgs/development | |
parent | 23809aa68101f49b6b5c3c99e712e1debde70a08 (diff) | |
download | nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar.gz nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar.bz2 nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar.lz nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar.xz nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.tar.zst nixlib-19f0cd20fd92423497056a28362344bf6f79f3d6.zip |
HaXe: support nekotools boot - add haxelib
svn path=/nixpkgs/trunk/; revision=20674
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/haxe/default.nix | 144 | ||||
-rw-r--r-- | pkgs/development/compilers/neko/default.nix | 18 |
2 files changed, 110 insertions, 52 deletions
diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix index 0f1aeddf64bc..72c423cbcd80 100644 --- a/pkgs/development/compilers/haxe/default.nix +++ b/pkgs/development/compilers/haxe/default.nix @@ -37,55 +37,103 @@ let # END }.src; + src_haxe = { + # REGION AUTO UPDATE: { name="haxe"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "haxe"; groups = "haxe_group"; } + src= sourceFromHead "haxe-F_01-25-35.tar.gz" + (fetchurl { url = "http://mawercer.de/~nix/repos/haxe-F_01-25-35.tar.gz"; sha256 = "8e5e5330e2fd7ffbbfe48d40bda03256aefbe30cf1be1d9c9065117b2b179f24"; }); + # END + }.src; + + + # the HaXe compiler + haxe = stdenv.mkDerivation { + name = "haxe-cvs"; + + buildInputs = [ocaml zlib makeWrapper]; + + src = src_haxe; + + inherit zlib; + + buildPhase = '' + 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! + 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 = '' + ensureDir $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 + ensureDir $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 -stdenv.mkDerivation { - name = "haxe-cvs"; - - # REGION AUTO UPDATE: { name="haxe"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "haxe"; groups = "haxe_group"; } - src= sourceFromHead "haxe-F_01-25-35.tar.gz" - (fetchurl { url = "http://mawercer.de/~nix/repos/haxe-F_01-25-35.tar.gz"; sha256 = "8e5e5330e2fd7ffbbfe48d40bda03256aefbe30cf1be1d9c9065117b2b179f24"; }); - # END - - buildInputs = [ocaml zlib makeWrapper]; - - inherit zlib; - - buildPhase = '' - 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! - 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 = '' - ensureDir $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; +{ + + inherit haxe; + + haxelib = tool { + name = "haxelib"; + description = "haxelib is a HaXe library management tool similar to easyinstall or ruby gems"; }; + } diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix index e229bd0db028..945359e75904 100644 --- a/pkgs/development/compilers/neko/default.nix +++ b/pkgs/development/compilers/neko/default.nix @@ -28,8 +28,12 @@ composableDerivation {} ( fixed : { sed -i \ -e 's@"/usr/include",@${includes}@' \ src/tools/install.neko - sed -i "s@/usr/local@$out@" Makefile + sed -i "s@/usr/local@$out@" Makefile vm/load.c + # make sure that nekotools boot finds the neko executable and not our wrapper: ensureDir $out/{bin,lib} + + sed -i "s@\"neko\"@\".neko-wrapped\"@" src/tools/nekoboot.neko + ln -s ./neko bin/.neko-wrapped ''; inherit zlib; @@ -45,12 +49,18 @@ composableDerivation {} ( fixed : { # 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 = '' - wrapProgram "$out/bin/nekoc" \ - --set "LD_LIBRARY_PATH" $out/lib/neko \ + for prog in nekotools nekoc; do + wrapProgram "$out/bin/$prog" \ + --prefix "LD_LIBRARY_PATH" $out/lib/neko + done wrapProgram "$out/bin/neko" \ - --set "LD_LIBRARY_PATH" $out/lib/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 |