2009-11-30 01:05:04 +00:00
args : with args ;
2009-12-11 13:58:23 +00:00
let
src_haxe_swflib = {
2010-05-29 19:26:45 +01:00
# REGION AUTO UPDATE: { name = "haxe_swflib"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/swflib"; groups = "haxe_group"; }
src = sourceFromHead " h a x e _ s w f l i b - F _ 1 0 - 4 3 - 4 6 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e _ s w f l i b - F _ 1 0 - 4 3 - 4 6 . t a r . g z " ; sha256 = " a 6 3 d e 7 5 e 4 8 b f 5 0 0 e f 0 e 8 e f 7 1 5 d 1 7 8 d 3 2 f 0 e f 1 1 3 d e d 8 c 2 1 b b c a 6 9 8 a 8 c c 7 0 e 7 b 5 8 " ; } ) ;
2009-12-11 13:58:23 +00:00
# END
} . src ;
src_haxe_extc = {
2010-05-29 19:26:45 +01:00
# REGION AUTO UPDATE: { name = "haxe_extc"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extc"; groups = "haxe_group"; }
src = sourceFromHead " h a x e _ e x t c - F _ 1 0 - 4 3 - 4 7 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e _ e x t c - F _ 1 0 - 4 3 - 4 7 . t a r . g z " ; sha256 = " d 0 a 9 9 8 0 5 2 7 d 6 2 a c 6 c f e 2 7 9 2 5 d d b 0 9 6 4 d 3 3 4 e c 3 8 2 f 8 1 3 f d f b 8 b d 6 c 5 9 f b b e d e 7 3 0 " ; } ) ;
2009-12-11 13:58:23 +00:00
# END
} . src ;
src_haxe_extlib_dev = {
2010-05-29 19:26:45 +01:00
# 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 " h a x e _ e x t l i b _ d e v - F _ 1 0 - 4 3 - 4 8 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e _ e x t l i b _ d e v - F _ 1 0 - 4 3 - 4 8 . t a r . g z " ; sha256 = " 6 b 9 0 3 7 2 3 0 e 2 6 1 5 d d 5 e 2 2 f 4 e 7 f 4 1 6 5 c 8 4 f 2 8 1 6 b c 5 2 6 9 5 7 6 8 3 a f c 9 4 5 3 9 4 f c d f 6 7 e " ; } ) ;
2009-12-11 13:58:23 +00:00
# END
} . src ;
src_haxe_xml_light = {
2010-05-29 19:26:45 +01:00
# 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 " h a x e _ x m l _ l i g h t - F _ 1 0 - 4 3 - 4 8 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e _ x m l _ l i g h t - F _ 1 0 - 4 3 - 4 8 . t a r . g z " ; sha256 = " b e 2 9 d 9 e 2 2 a d 0 d b c b 3 d 4 4 7 c b b c 1 4 9 0 7 a f f 5 f 8 9 b b 5 6 2 b 8 d b 3 6 9 6 5 9 d 2 9 9 f 3 a 5 b 4 4 f " ; } ) ;
2009-12-11 13:58:23 +00:00
# END
} . src ;
src_haxe_neko_include = {
2010-05-29 19:26:45 +01:00
# 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 " h a x e _ n e k o _ i n c l u d e - F _ 1 0 - 4 3 - 4 9 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e _ n e k o _ i n c l u d e - F _ 1 0 - 4 3 - 4 9 . t a r . g z " ; sha256 = " e 4 9 e f c 1 b 3 4 8 f a 6 e 0 f 6 f b 4 0 0 7 9 a 2 d 3 8 0 b 9 4 7 d 9 e b d a 3 1 8 4 3 b c 2 9 3 f 3 c c 7 7 f 8 4 5 3 d b " ; } ) ;
2009-12-11 13:58:23 +00:00
# END
} . src ;
2010-03-16 23:34:56 +00:00
src_haxe = {
2010-05-29 19:26:45 +01:00
# REGION AUTO UPDATE: { name="haxe-read-only"; type="svn"; url="http://haxe.googlecode.com/svn/trunk"; groups = "haxe_group"; }
src = sourceFromHead " h a x e - r e a d - o n l y - 3 2 2 0 . t a r . g z "
( fetchurl { url = " h t t p : / / m a w e r c e r . d e / ~ n i x / r e p o s / h a x e - r e a d - o n l y - 3 2 2 0 . t a r . g z " ; sha256 = " 2 b 6 7 0 2 d c a 9 5 d 0 8 2 9 e 5 3 9 c e a 0 7 b 8 2 2 4 e 3 8 4 8 e 5 8 4 a 4 2 5 c e 8 f 8 e 0 9 8 4 a 7 a 2 b f 7 b 1 f 8 " ; } ) ;
2010-03-16 23:34:56 +00:00
# END
} . src ;
# the HaXe compiler
haxe = stdenv . mkDerivation {
name = " h a x e - c v s " ;
buildInputs = [ ocaml zlib makeWrapper ] ;
src = src_haxe ;
inherit zlib ;
buildPhase = ''
2010-05-29 19:26:45 +01:00
set - x
2010-03-16 23:34:56 +00:00
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!
2010-05-29 19:26:45 +01:00
mkdir haxe
2010-03-16 23:34:56 +00:00
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 @ / u s r / l i b / @ ' ' ${ zlib } / l i b / @ 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 " $ o u t / b i n / h a x e " \
- - set " L D _ L I B R A R Y _ P A T H " $ zlib/lib \
- - set HAXE_LIBRARY_PATH " ' ' ${ HAXE_LIBRARY_PATH } ' ' ${ HAXE_LIBRARY_PATH : - : } : $ o u t / l i b / h a x e / s t d : . "
cp - r std $ out/lib/haxe /
'' ;
meta = {
description = " p r o g r a m m i n g l a n g u a g e t a r g e t i n g J a v a S c r i p t , F l a s h , N e k V M , P H P , C + + " ;
homepage = http://haxe.org ;
license = [ " G P L v 2 " " B S D 2 " /* ? */ ] ; # -> 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 ;
} ;
} ;
2009-12-11 13:58:23 +00:00
in
2010-03-16 23:34:56 +00:00
{
inherit haxe ;
haxelib = tool {
name = " h a x e l i b " ;
description = " h a x e l i b i s a H a X e l i b r a r y m a n a g e m e n t t o o l s i m i l a r t o e a s y i n s t a l l o r r u b y g e m s " ;
2009-11-30 01:05:04 +00:00
} ;
2010-03-16 23:34:56 +00:00
2009-11-30 01:05:04 +00:00
}