about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorThomas Mader <thomas.mader@gmail.com>2017-10-20 22:12:17 +0200
committerJoachim F <joachifm@users.noreply.github.com>2017-10-20 20:12:17 +0000
commit75a536459a45689680e1169ca0a2dda8d30d9589 (patch)
treeb9f6d7cd942a411cd59242f7d614925376b327f9 /pkgs
parentdab7ecc0542c024f9725216edfbddefafc910413 (diff)
downloadnixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar.gz
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar.bz2
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar.lz
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar.xz
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.tar.zst
nixlib-75a536459a45689680e1169ca0a2dda8d30d9589.zip
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.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/build-managers/dub/default.nix49
1 files 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 7f178babf32e..007ce5b07cde 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;
   };
 }