diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-04 18:18:21 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-04 19:21:34 -0400 |
commit | 446c0feadf7ca4a3289a5a0c9e0bbe0e74801f12 (patch) | |
tree | 50ce50da1ed20937182fe82fd7b27ff680648dae /nix-overlays/dtools | |
parent | dub nix (diff) |
nix use overlays when convenient
Diffstat (limited to 'nix-overlays/dtools')
-rw-r--r-- | nix-overlays/dtools/default.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/nix-overlays/dtools/default.nix b/nix-overlays/dtools/default.nix new file mode 100644 index 0000000..d605e4d --- /dev/null +++ b/nix-overlays/dtools/default.nix @@ -0,0 +1,51 @@ +{ stdenv, lib, fetchFromGitHub, fetchpatch, ldc, curl, gnumake42 }: + +stdenv.mkDerivation rec { + pname = "dtools"; + version = "2.103.1"; + + src = fetchFromGitHub { + owner = "dlang"; + repo = "tools"; + rev = "v${version}"; + sha256 = "sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4="; + name = "dtools"; + }; + + patches = [ + (fetchpatch { + # part of https://github.com/dlang/tools/pull/441 + url = "https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch"; # Fix LDC arm64 build + sha256 = "sha256-x6EclTYN1Y5FG57KLhbBK0BZicSYcZoWO7MTVcP4T18="; + }) + ]; + + nativeBuildInputs = [ ldc gnumake42 ]; # fails with make 4.4 + buildInputs = [ curl ]; + + makeCmd = '' + make -f posix.mak all DMD_DIR=dmd DMD=${ldc.out}/bin/ldmd2 CC=${stdenv.cc}/bin/cc + ''; + + buildPhase = '' + $makeCmd + ''; + + doCheck = true; + + checkPhase = '' + $makeCmd test_rdmd + ''; + + installPhase = '' + $makeCmd INSTALL_DIR=$out install + ''; + + meta = with 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 = lib.platforms.unix; + }; +} |