Skip to content

Commit

Permalink
feat(pkgs/dmd): Version 2.092.1 supported
Browse files Browse the repository at this point in the history
Also fixed some build errors for 2.088.1, but it doesn't yet build with these since we're using a newer bootstrap compiler than OldDDerivations did.
  • Loading branch information
dukc committed Feb 3, 2024
1 parent 0aa3a21 commit 94561da
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkgs/dmd/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
((builtins.compareVersions version after) >= 0)
&& ((builtins.compareVersions version before) < 0);
in {
isVersionSupported = version: versionBetween "2.098.1" "2.105.2" version;
isVersionSupported = version: versionBetween "2.092.1" "2.105.2" version;
};
}
30 changes: 27 additions & 3 deletions pkgs/dmd/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,25 @@ in
sha256 = "sha256-N21mAPfaTo+zGCip4njejasraV5IsWVqlGR5eOdFZZE=";
})
]
++ lib.optionals (lib.versionOlder version "2.091.0") [
# Patches deprecated printf formats in dmd backend
(fetchpatch {
url = "https://github.com/dlang/dmd/commit/efe6d473c30c07074461f3de0b7a8ba1343c5429.patch";
stripLen = 1;
extraPrefix = "dmd/";
sha256 = "sha256-DdAIHK42q4vyVJsuTN0nRZAAjWXRBZHY8oUidW4pMwI=";
})
]
++ lib.optionals (lib.versionOlder version "2.096.1") [
# Stop using feature deprecated from 2.097.0 on, link:
# https://dlang.org/changelog/2.097.0.html#fqn-bypass-deprecation
(fetchpatch {
url = "https://github.com/dlang/dmd/commit/5198eedf6ef4e113773c15eff42de195be438fa1.patch";
stripLen = 1;
extraPrefix = "dmd/";
sha256 = "sha256-4Bd3YD14jzMelVvR2t738Dtrf7xMlWJM6AdsB34wKyM=";
})
]
++ lib.optionals (lib.versionOlder version "2.092.2") [
# Fixes C++ tests that compiled on older C++ but not on the current one
(fetchpatch {
Expand All @@ -179,6 +198,7 @@ in
})
];


postPatch =
''
patchShebangs ${dmdPrefix}/test/{runnable,fail_compilation,compilable,tools}{,/extra-files}/*.sh
Expand Down Expand Up @@ -221,9 +241,13 @@ in
''
# This test causes a linking failure before
# https://github.com/dlang/dmd/commit/cab51f946a8b2d3f0fcb856cf6c52a18a6779930
+ lib.optionalString (lib.versionOlder version "2.103.0") ''
rm ${dmdPrefix}/test/runnable_cxx/cppa.d
''
+ lib.optionalString (lib.versionOlder version "2.103.0")
(if lib.versionAtLeast version "2.092.0" then ''
rm ${dmdPrefix}/test/runnable_cxx/cppa.d
''
else ''
rm ${dmdPrefix}/test/runnable/cppa.d
'')
+ lib.optionalString stdenv.isLinux ''
substituteInPlace phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
''
Expand Down
6 changes: 6 additions & 0 deletions pkgs/dmd/supported-source-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"2.092.1": {
"dmd": "1x4fspsk91cdf3pc3sfhhk47511acdbwd458wai2sirkqsdypmnm",
"druntime": "0rmqlnw1jlgsh6jjvw6bbmyn26v0xnygqdny699y93g0jldasas4",
"phobos": "0mw4bad9af7z54dc2rs1aa9h63p3z6bf0fq14v2iyyq4y08ikxzc",
"tools": "sha256-74DcCIZZFzQt3GvxwsNMmM+X5Du18UG2fRral95amtI="
},
"2.098.1": {
"dmd": "sha256-61hViU/IBUKHwXO+mt63lo3kBGL4Gtve83Uxi32gwnU=",
"druntime": "sha256-HN/bxmGJHqubiUESZ7Y/4gdUj8ja9WhyLq24IDdZoe0=",
Expand Down

0 comments on commit 94561da

Please sign in to comment.