Skip to content

Commit

Permalink
dub: 1.1.0 -> 1.4.1 (#28396)
Browse files Browse the repository at this point in the history
- gcc not needed at all as dependency
- other D compilers can be used instead of dmd, so it's not good to use it as a runtime dependency.
- Adding checkPhase (disabled for now because network access is limited in sandbox mode)
- Improve package description.
  • Loading branch information
ThomasMader authored and joachifm committed Oct 20, 2017
1 parent dab7ecc commit 75a5364
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions pkgs/development/tools/build-managers/dub/default.nix
@@ -1,37 +1,64 @@
{ stdenv, fetchFromGitHub, curl, dmd, gcc }:
{ stdenv, fetchFromGitHub, curl, dmd, libevent, rsync }:

stdenv.mkDerivation rec {
name = "dub-${version}";
version = "1.1.0";
version = "1.5.0";

src = fetchFromGitHub {
sha256 = "1smzlfs5gjmrlghccdgn04qzy5b8l0xm8y2virayb2adrwqviscm";
rev = "v${version}";
owner = "dlang";
repo = "dub";
owner = "D-Programming-Language";
rev = "v${version}";
sha256 = "0kmirx4ijhzirjwdqmnwqhngg38zdaydpvny2p0yj3afqgkj6vq5";
};

buildInputs = [ curl ];
propagatedBuildInputs = [ gcc dmd ];

buildPhase = ''
postPatch = ''
# Avoid that the version file is overwritten
substituteInPlace build.sh \
--replace source/dub/version_.d /dev/null
patchShebangs ./build.sh
substituteInPlace build.sh \
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
patchShebangs build.sh
patchShebangs test
# Remove unittest which is not working for now (upstream already fixed: https://github.com/dlang/dub/issues/1224)
rm test/interactive-remove.sh
# Fix test as long as there is no upstream solution. (see https://github.com/dlang/dub/pull/1227)
substituteInPlace test/issue884-init-defer-file-creation.sh \
--replace "< /dev/stdin" "<(while :; do sleep 1; done)" \
--replace "sleep 1" ""
'';

nativeBuildInputs = [ dmd libevent rsync ];
buildInputs = [ curl ];

buildPhase = ''
export DMD=${dmd.out}/bin/dmd
./build.sh
'';

doCheck = false;

checkPhase = ''
export DUB=$PWD/bin/dub
export DC=${dmd.out}/bin/dmd
export HOME=$TMP
./test/run-unittest.sh
'';

installPhase = ''
mkdir $out
mkdir $out/bin
cp bin/dub $out/bin
'';

meta = with stdenv.lib; {
description = "Build tool for D projects";
description = "Package and build manager for D applications and libraries";
homepage = http://code.dlang.org/;
license = licenses.mit;
maintainers = with maintainers; [ ThomasMader ];
platforms = platforms.unix;
};
}
Expand Down

0 comments on commit 75a5364

Please sign in to comment.