dmd: Tweaks so that it compiles on darwin
- Patching the makefile so use "clang++" as compiler. This was commented out inside of the makefile. - Fix the path to copy libphobos from.
This commit is contained in:
parent
4c01e6d919
commit
2bc69990cc
|
@ -10,6 +10,11 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
buildInputs = [ unzip curl ];
|
buildInputs = [ unzip curl ];
|
||||||
|
|
||||||
|
# Allow to use "clang++", commented in Makefile
|
||||||
|
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
|
substituteInPlace src/dmd/posix.mak --replace g++ clang++
|
||||||
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd src/dmd
|
cd src/dmd
|
||||||
make -f posix.mak INSTALL_DIR=$out
|
make -f posix.mak INSTALL_DIR=$out
|
||||||
|
@ -34,8 +39,9 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
cd ../phobos
|
cd ../phobos
|
||||||
mkdir $out/lib
|
mkdir $out/lib
|
||||||
${let bits = if stdenv.is64bit then "64" else "32"; in
|
${let bits = if stdenv.is64bit then "64" else "32";
|
||||||
"cp generated/linux/release/${bits}/libphobos2.a $out/lib"
|
osname = if stdenv.isDarwin then "osx" else "linux"; in
|
||||||
|
"cp generated/${osname}/release/${bits}/libphobos2.a $out/lib"
|
||||||
}
|
}
|
||||||
|
|
||||||
cp -r std $out/include/d2
|
cp -r std $out/include/d2
|
||||||
|
@ -55,4 +61,3 @@ stdenv.mkDerivation {
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue