2022-12-16 18:59:39 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, ldc, curl, gnumake42 }:
|
2017-08-19 15:20:34 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "dtools";
|
2024-01-08 04:08:49 +00:00
|
|
|
version = "2.106.1";
|
2017-08-19 15:20:34 +00:00
|
|
|
|
2021-11-24 05:12:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dlang";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "v${version}";
|
2023-09-19 04:38:38 +00:00
|
|
|
sha256 = "sha256-Y8jSwd6tldCnq3yEuO/xUYrSV+lp7tBPMiheMA06f0M=";
|
2021-11-24 05:12:55 +00:00
|
|
|
name = "dtools";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2021-11-24 08:05:33 +00:00
|
|
|
# part of https://github.com/dlang/tools/pull/441
|
|
|
|
url = "https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch"; # Fix LDC arm64 build
|
2021-11-24 05:12:55 +00:00
|
|
|
sha256 = "sha256-x6EclTYN1Y5FG57KLhbBK0BZicSYcZoWO7MTVcP4T18=";
|
2018-01-06 22:28:07 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-12-16 18:59:39 +00:00
|
|
|
nativeBuildInputs = [ ldc gnumake42 ]; # fails with make 4.4
|
2017-08-19 15:20:34 +00:00
|
|
|
buildInputs = [ curl ];
|
|
|
|
|
2018-01-06 22:28:07 +00:00
|
|
|
makeCmd = ''
|
2021-03-06 15:43:24 +00:00
|
|
|
make -f posix.mak all DMD_DIR=dmd DMD=${ldc.out}/bin/ldmd2 CC=${stdenv.cc}/bin/cc
|
2018-01-06 22:28:07 +00:00
|
|
|
'';
|
|
|
|
|
2017-08-19 15:20:34 +00:00
|
|
|
buildPhase = ''
|
2018-01-06 22:28:07 +00:00
|
|
|
$makeCmd
|
2017-08-19 15:20:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2023-09-19 04:38:38 +00:00
|
|
|
$makeCmd test_rdmd
|
2017-08-19 15:20:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-09-19 04:38:38 +00:00
|
|
|
$makeCmd INSTALL_DIR=$out install
|
2021-01-21 00:55:55 +00:00
|
|
|
'';
|
2017-08-19 15:20:34 +00:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2017-08-19 15:20:34 +00:00
|
|
|
description = "Ancillary tools for the D programming language compiler";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/dlang/tools";
|
2017-08-19 15:20:34 +00:00
|
|
|
license = lib.licenses.boost;
|
2023-09-19 22:00:16 +00:00
|
|
|
maintainers = with maintainers; [ ThomasMader jtbx ];
|
2021-01-23 12:26:19 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2017-08-19 15:20:34 +00:00
|
|
|
};
|
|
|
|
}
|