diff --git a/pkgs/dmd/flake.nix b/pkgs/dmd/flake.nix index 60364bdd..b6941435 100644 --- a/pkgs/dmd/flake.nix +++ b/pkgs/dmd/flake.nix @@ -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; }; } diff --git a/pkgs/dmd/generic.nix b/pkgs/dmd/generic.nix index d8f1dcb6..ac7f0cad 100644 --- a/pkgs/dmd/generic.nix +++ b/pkgs/dmd/generic.nix @@ -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 { @@ -179,6 +198,7 @@ in }) ]; + postPatch = '' patchShebangs ${dmdPrefix}/test/{runnable,fail_compilation,compilable,tools}{,/extra-files}/*.sh @@ -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);" "" '' diff --git a/pkgs/dmd/supported-source-versions.json b/pkgs/dmd/supported-source-versions.json index 73730912..a7562b06 100644 --- a/pkgs/dmd/supported-source-versions.json +++ b/pkgs/dmd/supported-source-versions.json @@ -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=",