1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/tools/dtools/default.nix

72 lines
1.5 KiB
Nix
Raw Normal View History

{stdenv, lib, fetchFromGitHub, dmd, curl}:
stdenv.mkDerivation rec {
name = "dtools-${version}";
2018-01-06 22:28:07 +00:00
version = "2.078.0";
2018-01-06 22:28:07 +00:00
srcs = [
(fetchFromGitHub {
owner = "dlang";
repo = "dmd";
rev = "v${version}";
sha256 = "1ia4swyq0xqppnpmcalh2yxywdk2gv3kvni2abx1mq6wwqgmwlcr";
name = "dmd";
})
(fetchFromGitHub {
owner = "dlang";
repo = "tools";
rev = "v${version}";
sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
name = "dtools";
})
];
sourceRoot = ".";
postUnpack = ''
mv dmd dtools
cd dtools
'';
postPatch = ''
substituteInPlace posix.mak \
--replace "../dmd/generated/\$(OS)/release/\$(MODEL)/dmd" ${dmd.out}/bin/dmd
substituteInPlace posix.mak \
--replace gcc $CC
# To fix rdmd test with newer phobos
substituteInPlace rdmd.d \
--replace " std.stdiobase," ""
'';
nativeBuildInputs = [ dmd ];
buildInputs = [ curl ];
2018-01-06 22:28:07 +00:00
makeCmd = ''
make -f posix.mak DMD=${dmd.out}/bin/dmd DMD_DIR=dmd
'';
buildPhase = ''
2018-01-06 22:28:07 +00:00
$makeCmd
'';
doCheck = true;
checkPhase = ''
2018-01-06 22:28:07 +00:00
$makeCmd test_rdmd
'';
installPhase = ''
2018-01-06 22:28:07 +00:00
$makeCmd INSTALL_DIR=$out install
'';
2017-08-27 18:07:15 +01:00
meta = with stdenv.lib; {
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 ];
platforms = stdenv.lib.platforms.unix;
};
}