2017-08-19 16:20:34 +01:00
|
|
|
{stdenv, lib, fetchFromGitHub, dmd, curl}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "dtools-${version}";
|
2019-02-17 09:48:00 +00:00
|
|
|
version = "2.084.1";
|
2017-08-19 16:20:34 +01:00
|
|
|
|
2018-01-06 22:28:07 +00:00
|
|
|
srcs = [
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "dmd";
|
|
|
|
rev = "v${version}";
|
2019-02-17 09:48:00 +00:00
|
|
|
sha256 = "10ll5072rkv3ln7i5l88h2f9mzda567kw2jwh6466vm6ylzl4jms";
|
2018-01-06 22:28:07 +00:00
|
|
|
name = "dmd";
|
|
|
|
})
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "v${version}";
|
2018-12-27 12:23:57 +00:00
|
|
|
sha256 = "0z3xkv9s1pdx8zdhsb92mwax2q5xhwjgh6g3iv53xip1nsxygn48";
|
2018-01-06 22:28:07 +00:00
|
|
|
name = "dtools";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mv dmd dtools
|
|
|
|
cd dtools
|
2019-02-17 09:48:00 +00:00
|
|
|
|
|
|
|
substituteInPlace posix.mak --replace "\$(DMD) \$(DFLAGS) -unittest -main -run rdmd.d" ""
|
2018-01-06 22:28:07 +00:00
|
|
|
'';
|
2017-08-19 16:20:34 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ dmd ];
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
|
2018-01-06 22:28:07 +00:00
|
|
|
makeCmd = ''
|
2018-02-10 09:49:17 +00:00
|
|
|
make -f posix.mak DMD_DIR=dmd DMD=${dmd.out}/bin/dmd CC=${stdenv.cc}/bin/cc
|
2018-01-06 22:28:07 +00:00
|
|
|
'';
|
|
|
|
|
2017-08-19 16:20:34 +01:00
|
|
|
buildPhase = ''
|
2018-01-06 22:28:07 +00:00
|
|
|
$makeCmd
|
2017-08-19 16:20:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2018-01-06 22:28:07 +00:00
|
|
|
$makeCmd test_rdmd
|
2017-08-19 16:20:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-01-06 22:28:07 +00:00
|
|
|
$makeCmd INSTALL_DIR=$out install
|
2017-08-19 16:20:34 +01:00
|
|
|
'';
|
|
|
|
|
2017-08-27 18:07:15 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-19 16:20:34 +01:00
|
|
|
description = "Ancillary tools for the D programming language compiler";
|
|
|
|
homepage = https://github.com/dlang/tools;
|
|
|
|
license = lib.licenses.boost;
|
2017-08-27 18:07:15 +01:00
|
|
|
maintainers = with maintainers; [ ThomasMader ];
|
2017-08-19 16:20:34 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|