2009-11-30 02:05:04 +01:00
args : with args ;
2009-12-11 14:58:23 +01:00
let
src_haxe_swflib = {
2010-04-19 00:01:50 +02: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 _ 2 3 - 4 5 - 4 3 . 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 _ 2 3 - 4 5 - 4 3 . t a r . g z " ; sha256 = " a 7 7 c e 2 d d a 4 8 d 2 8 f 8 2 b 4 8 b 9 6 f 7 1 4 0 4 e d b f 7 f 5 8 e 4 c 3 0 5 8 b 4 2 5 a 4 7 3 c 0 8 d 2 6 0 e 0 8 1 6 " ; } ) ;
2009-12-11 14:58:23 +01:00
# END
} . src ;
src_haxe_extc = {
2010-04-19 00:01:50 +02: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 _ 2 3 - 4 5 - 4 4 . 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 _ 2 3 - 4 5 - 4 4 . t a r . g z " ; sha256 = " d d 4 9 e b 7 7 1 d 5 2 f 4 d 6 7 c a 1 e b d a b 1 c e d 9 a 2 5 1 d c 5 7 9 9 f 9 1 8 9 6 c 3 3 b d 2 3 4 6 9 0 9 9 7 8 2 0 f " ; } ) ;
2009-12-11 14:58:23 +01:00
# END
} . src ;
src_haxe_extlib_dev = {
2010-04-19 00:01:50 +02: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 _ 2 3 - 4 5 - 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 _ e x t l i b _ d e v - F _ 2 3 - 4 5 - 4 6 . t a r . g z " ; sha256 = " 0 a 3 5 6 6 b 6 1 1 9 d e 9 0 6 3 4 4 1 c e c d 5 5 3 2 4 8 f 3 b f c 0 0 3 6 0 e d d 7 1 4 3 f 1 3 b 3 a b 0 d b c 5 7 b 3 1 0 " ; } ) ;
2009-12-11 14:58:23 +01:00
# END
} . src ;
src_haxe_xml_light = {
2010-04-19 00:01:50 +02: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 _ 2 3 - 4 5 - 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 _ x m l _ l i g h t - F _ 2 3 - 4 5 - 4 7 . t a r . g z " ; sha256 = " 8 e 1 b 5 a 7 f 1 a f c b 7 a 6 c d 8 b c a c 7 9 4 c 3 7 1 4 3 0 5 c e 9 4 a 9 8 e 9 8 9 c c f 2 3 a 3 8 d e f b 6 2 0 5 e d 2 " ; } ) ;
2009-12-11 14:58:23 +01:00
# END
} . src ;
src_haxe_neko_include = {
2010-04-19 00:01:50 +02: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 _ 2 3 - 4 5 - 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 _ n e k o _ i n c l u d e - F _ 2 3 - 4 5 - 4 8 . t a r . g z " ; sha256 = " 7 8 4 4 1 e c 5 a 2 0 f 2 5 c 7 5 1 a f e b 4 6 e 0 e a 6 1 d b 6 3 5 0 7 9 4 f 6 c 5 9 5 9 2 6 4 0 5 9 9 1 4 6 8 2 c 5 2 1 a 9 " ; } ) ;
2009-12-11 14:58:23 +01:00
# END
} . src ;
2010-03-17 00:34:56 +01:00
src_haxe = {
2010-04-19 00:01:50 +02: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 0 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 - r e a d - o n l y - 3 2 0 7 . t a r . g z " ; sha256 = " 2 d 3 1 5 c a 6 9 f a c 6 9 6 7 4 e b 5 6 2 e 1 3 4 9 f d e b e f b 0 d c a 4 a 9 1 e b 4 e e 2 8 3 7 1 2 3 0 a a a f 6 0 d f 1 " ; } ) ;
2010-03-17 00:34:56 +01: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 = ''
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 @ / 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 14:58:23 +01:00
in
2010-03-17 00:34:56 +01: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 02:05:04 +01:00
} ;
2010-03-17 00:34:56 +01:00
2009-11-30 02:05:04 +01:00
}