diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 707770cdc820..a95b60a1b57e 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -575,6 +575,7 @@ thammers = "Tobias Hammerschmidt "; the-kenny = "Moritz Ulrich "; theuni = "Christian Theune "; + ThomasMader = "Thomas Mader "; thoughtpolice = "Austin Seipp "; timbertson = "Tim Cuthbertson "; titanous = "Jonathan Rudenberg "; diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index a7f710520d4d..e18391ba8968 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -158,6 +158,7 @@ stdenv.mkDerivation rec { # Everything is now Boost licensed, even the backend. # https://github.com/dlang/dmd/pull/6680 license = licenses.boost; + maintainers = with maintainers; [ ThomasMader ]; platforms = platforms.unix; }; } diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix new file mode 100644 index 000000000000..22d2923897cd --- /dev/null +++ b/pkgs/development/compilers/ldc/default.nix @@ -0,0 +1,98 @@ +{ stdenv, fetchFromGitHub, cmake, llvm, dmd, curl, tzdata, python, + lit, gdb, unzip, darwin }: + +stdenv.mkDerivation rec { + name = "ldc-${version}"; + version = "1.3.0"; + + srcs = [ + (fetchFromGitHub { + owner = "ldc-developers"; + repo = "ldc"; + rev = "v${version}"; + sha256 = "1ac3j4cwwgjpayhijxx4d6478bc3iqksjxkd7xp7byx7k8w1ppdl"; + }) + (fetchFromGitHub { + owner = "ldc-developers"; + repo = "druntime"; + rev = "ldc-v${version}"; + sha256 = "1m13370wnj3sizqk3sdpzi9am5d24srf27d613qblhqa9n8vwz30"; + }) + (fetchFromGitHub { + owner = "ldc-developers"; + repo = "phobos"; + rev = "ldc-v${version}"; + sha256 = "0fhcdfi7a00plwj27ysfyv783nhk0kspq7hawf6vbsl3s1nyvn8g"; + }) + (fetchFromGitHub { + owner = "ldc-developers"; + repo = "dmd-testsuite"; + rev = "ldc-v${version}"; + sha256 = "0dmdkp220gqhxjrmrjfkf0vsvylwfaj70hswavq4q3v4dg17pzmj"; + }) + ]; + + sourceRoot = "."; + + postUnpack = '' + mv ldc-v${version}-src/* . + + mv druntime-ldc-v${version}-src/* runtime/druntime + + mv phobos-ldc-v${version}-src/* runtime/phobos + + mv dmd-testsuite-ldc-v${version}-src/* tests/d2/dmd-testsuite + + # Remove cppa test for now because it doesn't work. + rm tests/d2/dmd-testsuite/runnable/cppa.d + rm tests/d2/dmd-testsuite/runnable/extra-files/cppb.cpp + ''; + + postPatch = '' + substituteInPlace runtime/phobos/std/net/curl.d \ + --replace libcurl.so ${curl.out}/lib/libcurl.so + + # Ugly hack to fix the hardcoded path to zoneinfo in the source file. + # https://issues.dlang.org/show_bug.cgi?id=15391 + substituteInPlace runtime/phobos/std/datetime.d \ + --replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/ + '' + + + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace driver/tool.cpp \ + --replace "gcc" "clang" + ''; + + nativeBuildInputs = [ cmake llvm dmd python lit gdb unzip ] + + ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ + Foundation + ]); + + buildInputs = [ curl tzdata stdenv.cc ]; + + preConfigure = '' + cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc") + ''; + + postConfigure = '' + export DMD=$PWD/bin/ldc2 + ''; + + makeFlags = [ "DMD=$DMD" ]; + + doCheck = true; + + checkPhase = '' + ctest -j $NIX_BUILD_CORES -V DMD=$DMD + ''; + + meta = with stdenv.lib; { + description = "The LLVM-based D compiler"; + homepage = https://github.com/ldc-developers/ldc; + # from https://github.com/ldc-developers/ldc/blob/master/LICENSE + license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ]; + maintainers = with maintainers; [ ThomasMader ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/tools/dtools/default.nix b/pkgs/development/tools/dtools/default.nix index 28d0c57f2e3b..4d93eda24df7 100644 --- a/pkgs/development/tools/dtools/default.nix +++ b/pkgs/development/tools/dtools/default.nix @@ -45,10 +45,11 @@ stdenv.mkDerivation rec { } ''; - meta = { + meta = with stdenv.lib; { description = "Ancillary tools for the D programming language compiler"; homepage = https://github.com/dlang/tools; license = lib.licenses.boost; + maintainers = with maintainers; [ ThomasMader ]; platforms = stdenv.lib.platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 885faf457fea..720a96df7d99 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2784,6 +2784,8 @@ with pkgs; kytea = callPackage ../tools/text/kytea { }; + ldc = callPackage ../development/compilers/ldc { }; + lbreakout2 = callPackage ../games/lbreakout2 { }; leocad = callPackage ../applications/graphics/leocad { };