From 75a536459a45689680e1169ca0a2dda8d30d9589 Mon Sep 17 00:00:00 2001 From: Thomas Mader Date: Fri, 20 Oct 2017 22:12:17 +0200 Subject: [PATCH] dub: 1.1.0 -> 1.4.1 (#28396) - 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. --- .../tools/build-managers/dub/default.nix | 49 ++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/build-managers/dub/default.nix b/pkgs/development/tools/build-managers/dub/default.nix index 7f178babf32..007ce5b07cd 100644 --- a/pkgs/development/tools/build-managers/dub/default.nix +++ b/pkgs/development/tools/build-managers/dub/default.nix @@ -1,27 +1,53 @@ -{ 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 @@ -29,9 +55,10 @@ stdenv.mkDerivation rec { ''; 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; }; }