dtools: 2.075.1 -> 2.078.0

This commit is contained in:
Thomas Mader 2018-01-06 23:28:07 +01:00
parent 45f6d97e6e
commit 9ae35802d8

View File

@ -2,14 +2,31 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "dtools-${version}"; name = "dtools-${version}";
version = "2.075.1"; version = "2.078.0";
src = fetchFromGitHub { srcs = [
owner = "dlang"; (fetchFromGitHub {
repo = "tools"; owner = "dlang";
rev = "v${version}"; repo = "dmd";
sha256 = "0lxn400s9las9hq6h9vj4mis2jr662k2yw0zcrvqcm1yg9pd245d"; rev = "v${version}";
}; sha256 = "1ia4swyq0xqppnpmcalh2yxywdk2gv3kvni2abx1mq6wwqgmwlcr";
name = "dmd";
})
(fetchFromGitHub {
owner = "dlang";
repo = "tools";
rev = "v${version}";
sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
name = "dtools";
})
];
sourceRoot = ".";
postUnpack = ''
mv dmd dtools
cd dtools
'';
postPatch = '' postPatch = ''
substituteInPlace posix.mak \ substituteInPlace posix.mak \
@ -26,27 +43,22 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ dmd ]; nativeBuildInputs = [ dmd ];
buildInputs = [ curl ]; buildInputs = [ curl ];
makeCmd = ''
make -f posix.mak DMD=${dmd.out}/bin/dmd DMD_DIR=dmd
'';
buildPhase = '' buildPhase = ''
make -f posix.mak DMD=${dmd.out}/bin/dmd INSTALL_DIR=$out $makeCmd
''; '';
doCheck = true; doCheck = true;
checkPhase = '' checkPhase = ''
export BITS=${builtins.toString stdenv.hostPlatform.parsed.cpu.bits} $makeCmd test_rdmd
export OSNAME=${if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name}
./generated/$OSNAME/$BITS/rdmd -main -unittest rdmd.d
${dmd.out}/bin/dmd rdmd_test.d
./rdmd_test
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin $makeCmd INSTALL_DIR=$out install
${
let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
"find $PWD/generated/${osname}/${bits} -perm /a+x -type f -exec cp {} $out/bin \\;"
}
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {