From 94a4eb7da36d654325bc5acd930502b91fa8ef99 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Thu, 19 Jun 2025 17:23:38 +0200 Subject: [PATCH] Inject the key into the recipe (#937) --- bits_helpers/build.py | 1 + bits_helpers/utilities.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bits_helpers/build.py b/bits_helpers/build.py index fb37da66..7c2c3b42 100644 --- a/bits_helpers/build.py +++ b/bits_helpers/build.py @@ -1064,6 +1064,7 @@ def doBuild(args, parser): ("FULL_RUNTIME_REQUIRES", " ".join(spec["full_runtime_requires"])), ("FULL_BUILD_REQUIRES", " ".join(spec["full_build_requires"])), ("FULL_REQUIRES", " ".join(spec["full_requires"])), + ("BITS_PREFER_SYSTEM_KEY", spec.get("key", "")), ] # Add the extra environment as passed from the command line. buildEnvironment += [e.partition('=')[::2] for e in args.environment] diff --git a/bits_helpers/utilities.py b/bits_helpers/utilities.py index 4766fc63..6a48205d 100644 --- a/bits_helpers/utilities.py +++ b/bits_helpers/utilities.py @@ -592,6 +592,8 @@ def getPackageList(packages, specs, configDir, preferSystem, noSystem, spec = replacement # Allows generalising the version based on the actual key provided spec["version"] = spec["version"].replace("%(key)s", key) + # We need the key to inject the version into the replacement recipe later. + spec["key"] = key recipe = replacement.get("recipe", "") # If there's an explicitly-specified recipe, we're still building # the package. If not, aliBuild will still "build" it, but it's