2017-08-19 17:20:34 +02:00
|
|
|
{stdenv, lib, fetchFromGitHub, dmd, curl}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "dtools-${version}";
|
2018-01-26 22:18:48 +01:00
|
|
|
version = "2.078.1";
|
2017-08-19 17:20:34 +02:00
|
|
|
|
2018-01-06 23:28:07 +01:00
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "dmd";
|
|
|
|
rev = "v${version}";
|
2018-01-26 22:18:48 +01:00
|
|
|
sha256 = "0b9lphh4g3r9cyzv4wcfppv9j3w952vvwv615za23acgwav3mqg2";
|
2018-01-06 23:28:07 +01:00
|
|
|
name = "dmd";
|
|
|
|
})
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
|
|
|
|
name = "dtools";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mv dmd dtools
|
|
|
|
cd dtools
|
|
|
|
'';
|
2017-08-19 17:20:34 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace posix.mak \
|
|
|
|
--replace "../dmd/generated/\$(OS)/release/\$(MODEL)/dmd" ${dmd.out}/bin/dmd
|
|
|
|
|
|
|
|
substituteInPlace posix.mak \
|
|
|
|
--replace gcc $CC
|
2017-08-28 17:00:45 +02:00
|
|
|
|
|
|
|
# To fix rdmd test with newer phobos
|
|
|
|
substituteInPlace rdmd.d \
|
|
|
|
--replace " std.stdiobase," ""
|
2017-08-19 17:20:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dmd ];
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
|
2018-01-06 23:28:07 +01:00
|
|
|
makeCmd = ''
|
|
|
|
make -f posix.mak DMD=${dmd.out}/bin/dmd DMD_DIR=dmd
|
|
|
|
'';
|
|
|
|
|
2017-08-19 17:20:34 +02:00
|
|
|
buildPhase = ''
|
2018-01-06 23:28:07 +01:00
|
|
|
$makeCmd
|
2017-08-19 17:20:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2018-01-06 23:28:07 +01:00
|
|
|
$makeCmd test_rdmd
|
2017-08-19 17:20:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-01-06 23:28:07 +01:00
|
|
|
$makeCmd INSTALL_DIR=$out install
|
2017-08-19 17:20:34 +02:00
|
|
|
'';
|
|
|
|
|
2017-08-27 19:07:15 +02:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-19 17:20:34 +02:00
|
|
|
description = "Ancillary tools for the D programming language compiler";
|
|
|
|
homepage = https://github.com/dlang/tools;
|
|
|
|
license = lib.licenses.boost;
|
2017-08-27 19:07:15 +02:00
|
|
|
maintainers = with maintainers; [ ThomasMader ];
|
2017-08-19 17:20:34 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|