From 5f0b2a573c14e979ee708b970c69dd40ebc4e8a4 Mon Sep 17 00:00:00 2001 From: Emily Date: Fri, 8 Nov 2024 00:35:46 +0000 Subject: [PATCH] ninja_1_11: init at 1.11.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swift 5.8 doesn’t reliably build with Ninja 1.12, and apparently neither do old versions of ROCm, due to a build scheduling change breaking builds with undeclared dependencies. Upstream Swift have pinned 1.11 for now. Reintroducing it isn’t a good long‐term solution, but seems like the easiest way to avoid shipping 24.11 with a broken Swift on Darwin. The patch for 32‐bit systems has not been restored, as Swift doesn’t support them anyway. --- pkgs/by-name/ni/ninja/package.nix | 31 ++++++++++++++++++++++++------- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ni/ninja/package.nix b/pkgs/by-name/ni/ninja/package.nix index 23d279e362d76d..d64b21a896f906 100644 --- a/pkgs/by-name/ni/ninja/package.nix +++ b/pkgs/by-name/ni/ninja/package.nix @@ -11,18 +11,35 @@ , buildPackages , buildDocs ? true , nix-update-script +, ninjaRelease ? "latest" }: +let + releases = { + # TODO: Remove Ninja 1.11 as soon as possible. + "1.11" = fetchFromGitHub { + owner = "ninja-build"; + repo = "ninja"; + rev = "v1.11.1"; + hash = "sha256-LvV/Fi2ARXBkfyA1paCRmLUwCh/rTyz+tGMg2/qEepI="; + }; + + latest = fetchFromGitHub { + owner = "ninja-build"; + repo = "ninja"; + rev = "v1.12.1"; + hash = "sha256-RT5u+TDvWxG5EVQEYj931EZyrHUSAqK73OKDAascAwA="; + }; + }; +in + +assert lib.assertMsg (releases ? ${ninjaRelease}) "Unsupported Ninja release: ${ninjaRelease}"; + stdenv.mkDerivation (finalAttrs: { pname = "ninja"; - version = "1.12.1"; + version = lib.removePrefix "v" finalAttrs.src.rev; - src = fetchFromGitHub { - owner = "ninja-build"; - repo = "ninja"; - rev = "v${finalAttrs.version}"; - hash = "sha256-RT5u+TDvWxG5EVQEYj931EZyrHUSAqK73OKDAascAwA="; - }; + src = releases.${ninjaRelease}; depsBuildBuild = [ buildPackages.stdenv.cc ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b21dc2f649b8dc..f4d5db1f59cd6a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30944,6 +30944,8 @@ with pkgs; node-problem-detector = callPackage ../applications/networking/cluster/node-problem-detector { }; + ninja_1_11 = callPackage ../by-name/ni/ninja/package.nix { ninjaRelease = "1.11"; }; + ninjas2 = callPackage ../applications/audio/ninjas2 { }; nootka = qt5.callPackage ../applications/audio/nootka { };