From bb7c0670b2723e3d0eea72f51df7a85219388772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Mon, 24 Feb 2025 13:42:20 +0100 Subject: [PATCH] Use stream-specific ABI dependency generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, the nodejs_abi dependency generator has lived in nodejs-packaging. However, it depends on (an uses only) /usr/bin/node, thus only working and being accurate for the default stream. Moving the generator into a specific stream and modifying it to use the versioned binary should ensure that it is valid for whatever stream is used for compiling the binary extension in question. Related: RHEL-67814 Signed-off-by: Jan Staněk --- nodejs22.spec | 8 ++++++++ nodejs22_abi.attr | 2 ++ nodejs22_abi.req | 4 ++++ 3 files changed, 14 insertions(+) create mode 100644 nodejs22_abi.attr create mode 100644 nodejs22_abi.req diff --git a/nodejs22.spec b/nodejs22.spec index b446bea..e7bbd72 100644 --- a/nodejs22.spec +++ b/nodejs22.spec @@ -161,6 +161,8 @@ Source200: nodejs-tarball.sh Source201: npmrc.builtin.in Source202: nodejs.pc.in Source203: v8.pc.in +Source204: nodejs22_abi.req +Source205: nodejs22_abi.attr Patch: 0001-Remove-unused-OpenSSL-config.patch @@ -778,6 +780,10 @@ sed -e 's#@PREFIX@#%{_prefix}#g' \ -e 's#@V8_VERSION@#%{v8_version}#g' \ %{SOURCE203} > %{buildroot}%{_libdir}/pkgconfig/v8-%{v8_major}.%{v8_minor}.pc +# Install automatic ABI requirements generator for dependent packages +install -Dpm0755 %{SOURCE204} %{buildroot}%{_rpmconfigdir}/nodejs%{nodejs_pkg_major}_abi.req +install -Dpm0644 %{SOURCE204} %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs%{nodejs_pkg_major}_abi.attr + %check # Fail the build if the versions don't match @@ -856,6 +862,8 @@ end %{nodejs_datadir}/common.gypi %{_pkgdocdir}/gdbinit %{_libdir}/pkgconfig/nodejs-%{nodejs_pkg_major}.pc +%{_rpmconfigdir}/fileattrs/nodejs%{nodejs_pkg_major}*.attr +%{_rpmconfigdir}/nodejs%{nodejs_pkg_major}* %files -n %{pkgname}-full-i18n diff --git a/nodejs22_abi.attr b/nodejs22_abi.attr new file mode 100644 index 0000000..d4ef03b --- /dev/null +++ b/nodejs22_abi.attr @@ -0,0 +1,2 @@ +%__nodejs22_native_requires %{_rpmconfigdir}/nodejs22_abi.req +%__nodejs22_native_path ^/usr/lib.*/node_modules_22/.*\\.node$ diff --git a/nodejs22_abi.req b/nodejs22_abi.req new file mode 100644 index 0000000..d3309b0 --- /dev/null +++ b/nodejs22_abi.req @@ -0,0 +1,4 @@ +#!/bin/sh + +# Require ABI version of the current interpreter +printf 'nodejs(abi) = %s\n' "$(/usr/bin/node-22 -p 'process.versions.modules')"