nixpkgs/pkgs/development/tools/dtools/default.nix
2018-08-11 16:53:00 +02:00

60 lines
1.2 KiB
Nix

{stdenv, lib, fetchFromGitHub, dmd, curl}:
stdenv.mkDerivation rec {
name = "dtools-${version}";
version = "2.081.1";
srcs = [
(fetchFromGitHub {
owner = "dlang";
repo = "dmd";
rev = "v${version}";
sha256 = "1xdz7p0pdzwkn57ai93mavgdkd8xb1sr2brlc6y3c12x84h43s8z";
name = "dmd";
})
(fetchFromGitHub {
owner = "dlang";
repo = "tools";
rev = "v${version}";
sha256 = "1sbcfj8r1nvy7ynh9dy55q9bvfvxwf1z3llpxckvi8p6yvf35qn2";
name = "dtools";
})
];
sourceRoot = ".";
postUnpack = ''
mv dmd dtools
cd dtools
'';
nativeBuildInputs = [ dmd ];
buildInputs = [ curl ];
makeCmd = ''
make -f posix.mak DMD_DIR=dmd DMD=${dmd.out}/bin/dmd CC=${stdenv.cc}/bin/cc
'';
buildPhase = ''
$makeCmd
'';
doCheck = true;
checkPhase = ''
$makeCmd test_rdmd
'';
installPhase = ''
$makeCmd INSTALL_DIR=$out install
'';
meta = with stdenv.lib; {
description = "Ancillary tools for the D programming language compiler";
homepage = https://github.com/dlang/tools;
license = lib.licenses.boost;
maintainers = with maintainers; [ ThomasMader ];
platforms = stdenv.lib.platforms.unix;
};
}