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 {
name = "dtools-${version}";
version = "2.075.1";
version = "2.078.0";
src = fetchFromGitHub {
owner = "dlang";
repo = "tools";
rev = "v${version}";
sha256 = "0lxn400s9las9hq6h9vj4mis2jr662k2yw0zcrvqcm1yg9pd245d";
};
srcs = [
(fetchFromGitHub {
owner = "dlang";
repo = "dmd";
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 = ''
substituteInPlace posix.mak \
@ -26,27 +43,22 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ dmd ];
buildInputs = [ curl ];
makeCmd = ''
make -f posix.mak DMD=${dmd.out}/bin/dmd DMD_DIR=dmd
'';
buildPhase = ''
make -f posix.mak DMD=${dmd.out}/bin/dmd INSTALL_DIR=$out
$makeCmd
'';
doCheck = true;
checkPhase = ''
export BITS=${builtins.toString stdenv.hostPlatform.parsed.cpu.bits}
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
$makeCmd test_rdmd
'';
installPhase = ''
mkdir -p $out/bin
${
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 \\;"
}
$makeCmd INSTALL_DIR=$out install
'';
meta = with stdenv.lib; {