haxe: Add setup-hook and patch to add haxlib path.
Introduces a new environment variable called HAXELIB_PATH and the patch
for haxelib is trying to search that environment variable for other
libraries. If the haxelib path for a particular library isn't found, it
reverts to the normal behaviour of searching the user's home directory
for a file called .haxelib, which in turn points to a repsitory path and
that in turn has .current/.dev files to point it to the right version
number.
This avoids workarounds like this when using Nix to build Haxe projects:
configurePhase = ''
export HOME="$(pwd)"
echo "$(pwd)" > .haxelib
mkdir dependency1
echo dev > dependency1/.current
echo "${dependency1}" > dependency1/.dev
mkdir dependency2
echo dev > dependency2/.current
echo "${dependency2}" > dependency2/.dev
'';
Now every haxelib is expected to be in $out/lib/haxe/$name and whenever
it is listed in buildInputs of another Haxe derivation, HAXELIB_PATH
gets automatically set in the build environment.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
@@ -18,6 +18,8 @@ stdenv.mkDerivation {
|
||||
sed -i -e 's|com.class_path <- \[|&"'"$out/lib/haxe/std/"'";|' main.ml
|
||||
'';
|
||||
|
||||
patches = [ ./haxelib-nix.patch ];
|
||||
|
||||
buildFlags = [ "all" "tools" ];
|
||||
|
||||
installPhase = ''
|
||||
@@ -26,6 +28,8 @@ stdenv.mkDerivation {
|
||||
cp -vr std "$out/lib/haxe"
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
|
||||
Reference in New Issue
Block a user