From e3e4e27911a4193ac069235c9a39ff16642643bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Mon, 4 Apr 2022 16:39:43 +0200 Subject: [PATCH] decouple dependency bundling from bootstrapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We probably should stop (ab)using the bootstrap macro for module builds with bundled dependencies. This patch decouples one from the other; use --with=bundled for just bundling and --with=bootstrap for full bootstrapping. Related: rhbz#2056971 Signed-off-by: Jan Staněk --- nodejs.spec | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/nodejs.spec b/nodejs.spec index c7a96e0..ed02cca 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -6,8 +6,24 @@ %global with_debug 0 %endif -# bundle dependencies that are not available as Fedora modules +# The following macros control the usage of dependencies bundled from upstream. +# +# When to use what: +# - Regular (presumably non-modular) build: use neither (the default in Fedora) +# - Early bootstrapping build that is not intended to be shipped: +# use --with=bootstrap; this will bundle deps and add `~bootstrap` release suffix +# - Build with some dependencies not avalaible in necessary versions (i.e. module build): +# use --with=bundled; will bundle deps, but do not add the suffix +# +# create bootstrapping build with bundled deps and extra release suffix %bcond_with bootstrap +# bundle dependencies that are not available as Fedora modules +%if %{with bootstrap} +%bcond_without bundled +%else +%bcond_with bundled +%endif + %bcond_without python3_fixup # == Master Relase == @@ -188,14 +204,14 @@ BuildRequires: chrpath BuildRequires: libatomic BuildRequires: systemtap-sdt-devel -%if %{with bootstrap} +%if %{with bundled} Provides: bundled(libuv) = %{libuv_version} %else BuildRequires: libuv-devel >= 1:%{libuv_version} Requires: libuv >= 1:%{libuv_version} %endif -%if %{with bootstrap} +%if %{with bundled} Provides: bundled(nghttp2) = %{nghttp2_version} %else BuildRequires: libnghttp2-devel >= %{nghttp2_version} @@ -292,7 +308,7 @@ Requires: zlib-devel%{?_isa} Requires: brotli-devel%{?_isa} Requires: nodejs-packaging -%if %{without bootstrap} +%if %{without bundled} Requires: libuv-devel%{?_isa} %endif @@ -394,8 +410,8 @@ export LDFLAGS="%{build_ldflags}" --shared-openssl \ --shared-zlib \ --shared-brotli \ - %{!?with_bootstrap:--shared-libuv} \ - %{!?with_bootstrap:--shared-nghttp2} \ + %{!?with_bundled:--shared-libuv} \ + %{!?with_bundled:--shared-nghttp2} \ --with-dtrace \ --with-intl=small-icu \ --with-icu-default-data-dir=%{icudatadir} \ @@ -682,6 +698,7 @@ end * Mon Apr 25 2022 Jan Staněk - 1:16.14.0-5 - Unify configure calls into single command - Refactor bootstrap-related parts +- Decouple dependency bundling from bootstrapping * Mon Apr 11 2022 Zuzana Svetlikova - 1:16.14.0-4 - Apply lock file validation fixes