about summary refs log tree commit diff
path: root/pkgs/development/compilers/dmd
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-11-14 14:11:38 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-11-14 14:12:32 +0100
commit961ed7c8b41bb80cdf5f4f0f5e49093ad171393b (patch)
treeb998b32eee47044c152f4b4169a54d96fae01ec2 /pkgs/development/compilers/dmd
parentea05587309cfd27f112da523af8fcac67733d9a3 (diff)
downloadnixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar.gz
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar.bz2
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar.lz
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar.xz
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.tar.zst
nixlib-961ed7c8b41bb80cdf5f4f0f5e49093ad171393b.zip
dmd: fix 32-bit build and some nitpicks
CC #4976.
Diffstat (limited to 'pkgs/development/compilers/dmd')
-rw-r--r--pkgs/development/compilers/dmd/default.nix27
1 files changed, 15 insertions, 12 deletions
diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix
index 78ce19713e3c..c48d74249e19 100644
--- a/pkgs/development/compilers/dmd/default.nix
+++ b/pkgs/development/compilers/dmd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gcc, unzip, curl }:
+{ stdenv, fetchurl, unzip, curl }:
 
 stdenv.mkDerivation {
   name = "dmd-2.066.1";
@@ -8,13 +8,13 @@ stdenv.mkDerivation {
     sha256 = "1qifwgrl6h232zsnvcx3kmb5d0fsy7j9zv17r3b4vln7x5rvzc66";
   };
 
-  buildInputs = [ gcc unzip curl ];
+  buildInputs = [ unzip curl ];
 
   buildPhase = ''
       cd src/dmd
       make -f posix.mak INSTALL_DIR=$out
       export DMD=$PWD/dmd
-      cd ../druntime 
+      cd ../druntime
       make -f posix.mak INSTALL_DIR=$out DMD=$DMD
       cd ../phobos
       make -f posix.mak INSTALL_DIR=$out DMD=$DMD
@@ -26,30 +26,33 @@ stdenv.mkDerivation {
       mkdir $out
       mkdir $out/bin
       cp dmd $out/bin
-       
+
       cd ../druntime
       mkdir $out/include
       mkdir $out/include/d2
       cp -r import/* $out/include/d2
-       
+
       cd ../phobos
       mkdir $out/lib
-      cp generated/linux/release/64/libphobos2.a $out/lib    # for 64-bit version
+      ${let bits = if stdenv.is64bit then "64" else "32"; in
+      "cp generated/linux/release/${bits}/libphobos2.a $out/lib"
+      }
 
       cp -r std $out/include/d2
       cp -r etc $out/include/d2
 
       cd $out/bin
       tee dmd.conf << EOF
-[Environment]
-DFLAGS=-I$out/include/d2 -L-L$out/lib -L--no-warn-search-mismatch -L--export-dynamic
-EOF
+      [Environment]
+      DFLAGS=-I$out/include/d2 -L-L$out/lib -L--no-warn-search-mismatch -L--export-dynamic
+      EOF
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "D language compiler";
     homepage = http://dlang.org/;
-    license = "open source, see included files";
-    platforms = stdenv.lib.platforms.unix;
+    license = licenses.free; # parts under different licenses
+    platforms = platforms.unix;
   };
 }
+