summary refs log tree commit diff
path: root/pkgs/development/tools/dtools
diff options
context:
space:
mode:
authorThomas Mader <thomas.mader@gmail.com>2017-08-19 17:20:34 +0200
committerThomas Mader <thomas.mader@gmail.com>2017-08-19 23:11:12 +0200
commit58ed023bc63a30d758116113891cf3fb3d1946a9 (patch)
tree17e5c735bd4201b713801e979c99fff368d22d28 /pkgs/development/tools/dtools
parent9d4d9630972afcebc70e5d5138a1216f2f344f02 (diff)
downloadnixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar.gz
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar.bz2
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar.lz
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar.xz
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.tar.zst
nixlib-58ed023bc63a30d758116113891cf3fb3d1946a9.zip
dtools: rdmd -> dtools
- Remove single rdmd derivation and introduce new dtools derivation with more tools from the repository.
- Update rdmd/dtools 2.067.0 -> 2.075.1
- Adding checkPhase
- Fixing dependencies
- Update derivation description
Diffstat (limited to 'pkgs/development/tools/dtools')
-rw-r--r--pkgs/development/tools/dtools/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/tools/dtools/default.nix b/pkgs/development/tools/dtools/default.nix
new file mode 100644
index 000000000000..28d0c57f2e3b
--- /dev/null
+++ b/pkgs/development/tools/dtools/default.nix
@@ -0,0 +1,54 @@
+{stdenv, lib, fetchFromGitHub, dmd, curl}:
+
+stdenv.mkDerivation rec {
+  name = "dtools-${version}";
+  version = "2.075.1";
+
+  src = fetchFromGitHub {
+    owner = "dlang";
+    repo = "tools";
+    rev = "v${version}";
+    sha256 = "0lxn400s9las9hq6h9vj4mis2jr662k2yw0zcrvqcm1yg9pd245d";
+  };
+
+  postPatch = ''
+      substituteInPlace posix.mak \
+          --replace "../dmd/generated/\$(OS)/release/\$(MODEL)/dmd" ${dmd.out}/bin/dmd
+
+      substituteInPlace posix.mak \
+          --replace gcc $CC
+  '';
+
+  nativeBuildInputs = [ dmd ];
+  buildInputs = [ curl ];
+
+  buildPhase = ''
+    make -f posix.mak DMD=${dmd.out}/bin/dmd INSTALL_DIR=$out
+  '';
+
+  doCheck = true;
+
+  checkPhase = ''
+      export BITS=${builtins.toString stdenv.hostPlatform.parsed.cpu.bits}
+      export OSNAME=${if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name}
+      ./generated/$OSNAME/$BITS/rdmd -main -unittest rdmd.d
+      ${dmd.out}/bin/dmd rdmd_test.d
+      ./rdmd_test
+    '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    ${
+      let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
+      osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
+      "find $PWD/generated/${osname}/${bits} -perm /a+x -type f -exec cp {} $out/bin \\;"
+    }
+	'';
+
+  meta = {
+    description = "Ancillary tools for the D programming language compiler";
+    homepage = https://github.com/dlang/tools;
+    license = lib.licenses.boost;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}