From b5db2a401a22bf1e8fa1798187351aa863c83a4c Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 13:59:44 +0100 Subject: [PATCH] gnatPackages.gnatcoll-core: 24.0.0 -> 25.0.0 gnatcoll-core now ships up to four gpr files: - gnatcoll (for backwards compat) - gnatcoll_minimal - gnatcoll_core - gnatcoll_projects Unfortunately, you can't freely choose which to build, so this package hasn't been split up into two to three packages. --- .../development/ada-modules/gnatcoll/core.nix | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ada-modules/gnatcoll/core.nix b/pkgs/development/ada-modules/gnatcoll/core.nix index 0180558e1b96..a121eec212eb 100644 --- a/pkgs/development/ada-modules/gnatcoll/core.nix +++ b/pkgs/development/ada-modules/gnatcoll/core.nix @@ -3,39 +3,80 @@ , gnat , gprbuild , fetchFromGitHub +, fetchpatch2 , which +, python3 +, rsync +, enableGnatcollCore ? true + # TODO(@sternenseemann): figure out a way to split this up into three packages +, enableGnatcollProjects ? true + # for tests +, gnatcoll-core }: +# gnatcoll-projects depends on gnatcoll-core +assert enableGnatcollProjects -> enableGnatcollCore; + stdenv.mkDerivation rec { pname = "gnatcoll-core"; - version = "24.0.0"; + version = "25.0.0"; src = fetchFromGitHub { owner = "AdaCore"; repo = "gnatcoll-core"; rev = "v${version}"; - sha256 = "1cks2w0inj9hvamsdxjriwxnx1igmx2khhr6kwxshsl30rs8nzvb"; + sha256 = "1srnh7vhs46c2zy4hcy4pg0a0prghfzlpv7c82k0jan384yz1g6g"; }; + patches = [ + # Fix compilation with GNAT 12 https://github.com/AdaCore/gnatcoll-core/issues/88 + (fetchpatch2 { + name = "gnatcoll-core-gnat-12.patch"; + url = "https://github.com/AdaCore/gnatcoll-core/commit/515db1c9f1eea8095f2d9ff9570159a78c981ec6.patch"; + sha256 = "1ghnkhp5fncb7qcmf59kyqvy0sd0pzf1phnr2z7b4ljwlkbmcp36"; + }) + ]; + + postPatch = '' + patchShebangs */*.gpr.py + ''; + nativeBuildInputs = [ gprbuild which gnat + python3 + rsync ]; # propagate since gprbuild needs to find # referenced GPR project definitions - propagatedBuildInputs = [ + propagatedBuildInputs = lib.optionals enableGnatcollProjects [ gprbuild # libgpr ]; + strictDeps = true; + makeFlags = [ "prefix=${placeholder "out"}" "PROCESSORS=$(NIX_BUILD_CORES)" # confusingly, for gprbuild --target is autoconf --host "TARGET=${stdenv.hostPlatform.config}" + "GNATCOLL_MINIMAL_ONLY=${if !enableGnatcollCore then "yes" else "no"}" + "GNATCOLL_PROJECTS=${if enableGnatcollProjects then "yes" else "no"}" ]; + passthru.tests = { + minimalOnly = gnatcoll-core.override { + enableGnatcollProjects = false; + enableGnatcollCore = false; + }; + noProjects = gnatcoll-core.override { + enableGnatcollProjects = false; + enableGnatcollCore = true; + }; + }; + meta = with lib; { homepage = "https://github.com/AdaCore/gnatcoll-core"; description = "GNAT Components Collection - Core packages";