Merge pull request #7661 from johbo/dmd-darwin
Be able to compile dmd on darwin, update dmd
This commit is contained in:
commit
ea8441fe6b
@ -1,15 +1,20 @@
|
|||||||
{ stdenv, fetchurl, unzip, curl }:
|
{ stdenv, fetchurl, unzip, curl }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "dmd-2.067.0";
|
name = "dmd-2.067.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://downloads.dlang.org/releases/2015/dmd.2.067.0.zip;
|
url = http://downloads.dlang.org/releases/2015/dmd.2.067.1.zip;
|
||||||
sha256 = "0b1b65694846ef3430de1de341c8cf353151a1a39656e6a1065fe56bc90fb60b";
|
sha256 = "0ny99vfllvvgcl79pwisxcdnb3732i827k9zg8c0j4s0n79k5z94";
|
||||||
};
|
};
|
||||||
|
|
||||||
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
Block a user