2014-11-14 13:11:38 +00:00
|
|
|
{ stdenv, fetchurl, unzip, curl }:
|
2014-01-10 18:09:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2015-04-08 04:23:12 +00:00
|
|
|
name = "dmd-2.067.0";
|
2014-01-10 18:09:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-08 04:23:12 +00:00
|
|
|
url = http://downloads.dlang.org/releases/2015/dmd.2.067.0.zip;
|
|
|
|
sha256 = "0b1b65694846ef3430de1de341c8cf353151a1a39656e6a1065fe56bc90fb60b";
|
2014-01-10 18:09:52 +00:00
|
|
|
};
|
|
|
|
|
2014-11-14 13:11:38 +00:00
|
|
|
buildInputs = [ unzip curl ];
|
2014-01-10 18:09:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
cd src/dmd
|
|
|
|
make -f posix.mak INSTALL_DIR=$out
|
|
|
|
export DMD=$PWD/dmd
|
2014-11-14 13:11:38 +00:00
|
|
|
cd ../druntime
|
2014-01-10 18:09:52 +00:00
|
|
|
make -f posix.mak INSTALL_DIR=$out DMD=$DMD
|
|
|
|
cd ../phobos
|
|
|
|
make -f posix.mak INSTALL_DIR=$out DMD=$DMD
|
|
|
|
cd ../..
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cd src/dmd
|
2014-11-13 14:57:58 +00:00
|
|
|
mkdir $out
|
|
|
|
mkdir $out/bin
|
|
|
|
cp dmd $out/bin
|
2014-11-14 13:11:38 +00:00
|
|
|
|
2014-11-13 14:57:58 +00:00
|
|
|
cd ../druntime
|
|
|
|
mkdir $out/include
|
|
|
|
mkdir $out/include/d2
|
|
|
|
cp -r import/* $out/include/d2
|
2014-11-14 13:11:38 +00:00
|
|
|
|
2014-01-10 18:09:52 +00:00
|
|
|
cd ../phobos
|
2014-11-13 14:57:58 +00:00
|
|
|
mkdir $out/lib
|
2014-11-14 13:11:38 +00:00
|
|
|
${let bits = if stdenv.is64bit then "64" else "32"; in
|
|
|
|
"cp generated/linux/release/${bits}/libphobos2.a $out/lib"
|
|
|
|
}
|
2014-11-13 14:57:58 +00:00
|
|
|
|
|
|
|
cp -r std $out/include/d2
|
|
|
|
cp -r etc $out/include/d2
|
|
|
|
|
|
|
|
cd $out/bin
|
|
|
|
tee dmd.conf << EOF
|
2014-11-14 13:11:38 +00:00
|
|
|
[Environment]
|
|
|
|
DFLAGS=-I$out/include/d2 -L-L$out/lib -L--no-warn-search-mismatch -L--export-dynamic
|
|
|
|
EOF
|
2014-01-10 18:09:52 +00:00
|
|
|
'';
|
|
|
|
|
2014-11-14 13:11:38 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-01-10 18:09:52 +00:00
|
|
|
description = "D language compiler";
|
|
|
|
homepage = http://dlang.org/;
|
2014-11-14 13:11:38 +00:00
|
|
|
license = licenses.free; # parts under different licenses
|
|
|
|
platforms = platforms.unix;
|
2014-01-10 18:09:52 +00:00
|
|
|
};
|
|
|
|
}
|
2014-11-14 13:11:38 +00:00
|
|
|
|