1{stdenv, lib, fetchFromGitHub, dmd, curl}:
2
3stdenv.mkDerivation rec {
4 name = "dtools-${version}";
5 version = "2.079.0";
6
7 srcs = [
8 (fetchFromGitHub {
9 owner = "dlang";
10 repo = "dmd";
11 rev = "v${version}";
12 sha256 = "1k6cky71pqnss6h6391p1ich2mjs598f5fda018aygnxg87qgh4y";
13 name = "dmd";
14 })
15 (fetchFromGitHub {
16 owner = "dlang";
17 repo = "tools";
18 rev = "v${version}";
19 sha256 = "0fvpfwh3bh3fymrmis3n39x9hkfklmv81lrlqcyl8fmmk694yvad";
20 name = "dtools";
21 })
22 ];
23
24 sourceRoot = ".";
25
26 postUnpack = ''
27 mv dmd dtools
28 cd dtools
29 '';
30
31 nativeBuildInputs = [ dmd ];
32 buildInputs = [ curl ];
33
34 makeCmd = ''
35 make -f posix.mak DMD_DIR=dmd DMD=${dmd.out}/bin/dmd CC=${stdenv.cc}/bin/cc
36 '';
37
38 buildPhase = ''
39 $makeCmd
40 '';
41
42 doCheck = true;
43
44 checkPhase = ''
45 $makeCmd test_rdmd
46 '';
47
48 installPhase = ''
49 $makeCmd INSTALL_DIR=$out install
50 '';
51
52 meta = with stdenv.lib; {
53 description = "Ancillary tools for the D programming language compiler";
54 homepage = https://github.com/dlang/tools;
55 license = lib.licenses.boost;
56 maintainers = with maintainers; [ ThomasMader ];
57 platforms = stdenv.lib.platforms.unix;
58 };
59}