summaryrefslogtreecommitdiffhomepage
path: root/nix-overlays/dmd/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix-overlays/dmd/generic.nix')
-rw-r--r--nix-overlays/dmd/generic.nix76
1 files changed, 43 insertions, 33 deletions
diff --git a/nix-overlays/dmd/generic.nix b/nix-overlays/dmd/generic.nix
index 63c2bd1..59a781e 100644
--- a/nix-overlays/dmd/generic.nix
+++ b/nix-overlays/dmd/generic.nix
@@ -1,28 +1,30 @@
-{ version
-, dmdHash
-, phobosHash
+{
+ version,
+ dmdHash,
+ phobosHash,
}:
-{ stdenv
-, lib
-, fetchFromGitHub
-, removeReferencesTo
-, makeWrapper
-, which
-, writeTextFile
-, curl
-, tzdata
-, gdb
-#, Foundation
-, callPackage
-, targetPackages
-, fetchpatch
-, bash
-, installShellFiles
-, git
-, unzip
-, dmdBootstrap ? callPackage ./bootstrap.nix { }
-, dmdBin ? "${dmdBootstrap}/bin"
+{
+ stdenv,
+ lib,
+ fetchFromGitHub,
+ removeReferencesTo,
+ makeWrapper,
+ which,
+ writeTextFile,
+ curl,
+ tzdata,
+ gdb,
+ # Foundation,
+ callPackage,
+ targetPackages,
+ fetchpatch,
+ bash,
+ installShellFiles,
+ git,
+ unzip,
+ dmdBootstrap ? callPackage ./bootstrap.nix { },
+ dmdBin ? "${dmdBootstrap}/bin",
}:
let
@@ -36,11 +38,8 @@ let
};
bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
- osname =
- if stdenv.isDarwin then
- "osx"
- else
- stdenv.hostPlatform.parsed.kernel.name;
+ osname = if stdenv.hostPlatform.isDarwin then "osx"
+ else stdenv.hostPlatform.parsed.kernel.name;
pathToDmd = "\${NIX_BUILD_TOP}/dmd/generated/${osname}/release/${bits}/dmd";
in
@@ -97,6 +96,9 @@ stdenv.mkDerivation (finalAttrs: {
rm dmd/compiler/test/runnable/gdb4149.d
rm dmd/compiler/test/runnable/gdb4181.d
rm dmd/compiler/test/compilable/ddocYear.d
+ rm dmd/compiler/test/compilable/sarif_success_test.d
+ rm dmd/compiler/test/fail_compilation/sarif_test.d
+ rm dmd/compiler/test/fail_compilation/sarifmultiple_test.d
# Disable tests that rely on objdump whitespace until fixed upstream:
# https://issues.dlang.org/show_bug.cgi?id=23317
@@ -106,11 +108,11 @@ stdenv.mkDerivation (finalAttrs: {
rm dmd/compiler/test/dshell/test6952.d
'' + lib.optionalString (lib.versionAtLeast version "2.092.2") ''
substituteInPlace dmd/compiler/test/dshell/test6952.d --replace-fail "/usr/bin/env bash" "${bash}/bin/bash"
- '' + lib.optionalString stdenv.isLinux ''
+ '' + lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
- '' + lib.optionalString stdenv.isDarwin ''
- substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
- '';
+ ''; # + lib.optionalString stdenv.hostPlatform.isDarwin ''
+ # substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
+ #'';
nativeBuildInputs = [
makeWrapper
@@ -123,7 +125,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
curl
tzdata
- # ] ++ lib.optionals stdenv.isDarwin [
+ # ] ++ lib.optionals stdenv.hostPlatform.isDarwin []
# Foundation
];
@@ -208,14 +210,22 @@ stdenv.mkDerivation (finalAttrs: {
disallowedReferences = [ dmdBootstrap ];
+ passthru = {
+ inherit dmdBootstrap;
+ };
+
meta = with lib; {
description = "Official reference compiler for the D language";
homepage = "https://dlang.org/";
+ changelog = "https://dlang.org/changelog/${finalAttrs.version}.html";
# Everything is now Boost licensed, even the backend.
# https://github.com/dlang/dmd/pull/6680
license = licenses.boost;
mainProgram = "dmd";
maintainers = with maintainers; [ lionello dukc jtbx ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
+ # ld: section __DATA/__thread_bss has type zero-fill but non-zero file offset file '/private/tmp/nix-build-dmd-2.109.1.drv-0/.rdmd-301/rdmd-build.d-A1CF043A7D87C5E88A58F3C0EF5A0DF7/objs/build.o' for architecture x86_64
+ # clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
+ broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64;
};
})