2017-08-19 17:20:34 +02:00
|
|
|
{stdenv, lib, fetchFromGitHub, dmd, curl}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "dtools";
|
2019-03-30 10:33:49 +01:00
|
|
|
version = "2.085.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}";
|
2019-03-30 10:33:49 +01:00
|
|
|
sha256 = "0ccidfcawrcwdpfjwjiln5xwr4ffp8i2hwx52p8zn3xmc5yxm660";
|
2018-01-06 23:28:07 +01:00
|
|
|
name = "dmd";
|
|
|
|
})
|
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "v${version}";
|
2019-03-30 10:33:49 +01:00
|
|
|
sha256 = "1x85w4k2zqgv2bjbvhschxdc6kq8ygp89h499cy8rfqm6q23g0ws";
|
2018-01-06 23:28:07 +01:00
|
|
|
name = "dtools";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mv dmd dtools
|
|
|
|
cd dtools
|
2019-02-17 10:48:00 +01:00
|
|
|
|
|
|
|
substituteInPlace posix.mak --replace "\$(DMD) \$(DFLAGS) -unittest -main -run rdmd.d" ""
|
2018-01-06 23:28:07 +01:00
|
|
|
'';
|
2017-08-19 17:20:34 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ dmd ];
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
|
2018-01-06 23:28:07 +01:00
|
|
|
makeCmd = ''
|
2018-02-10 10:49:17 +01:00
|
|
|
make -f posix.mak DMD_DIR=dmd DMD=${dmd.out}/bin/dmd CC=${stdenv.cc}/bin/cc
|
2018-01-06 23:28:07 +01:00
|
|
|
'';
|
|
|
|
|
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
|
2021-01-21 01:55:55 +01:00
|
|
|
'';
|
2017-08-19 17:20:34 +02:00
|
|
|
|
2021-01-23 13:26:19 +01:00
|
|
|
meta = with lib; {
|
2017-08-19 17:20:34 +02:00
|
|
|
description = "Ancillary tools for the D programming language compiler";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/dlang/tools";
|
2017-08-19 17:20:34 +02:00
|
|
|
license = lib.licenses.boost;
|
2017-08-27 19:07:15 +02:00
|
|
|
maintainers = with maintainers; [ ThomasMader ];
|
2021-01-23 13:26:19 +01:00
|
|
|
platforms = lib.platforms.unix;
|
2017-08-19 17:20:34 +02:00
|
|
|
};
|
|
|
|
}
|