* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/
@ 2021-01-04 0:07 Lars Wendler
0 siblings, 0 replies; 3+ messages in thread
From: Lars Wendler @ 2021-01-04 0:07 UTC (permalink / raw
To: gentoo-commits
commit: 45f9fe12cea15385fd80353c45990ed66fd5ce6d
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 4 00:06:40 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jan 4 00:07:07 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45f9fe12
sys-libs/libsmbios: Avoid bashisms
Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Bug: https://bugs.gentoo.org/715202
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
.../files/libsmbios-2.4.3-avoid_bashisms.patch | 84 ++++++++++++++++++++++
sys-libs/libsmbios/libsmbios-2.4.3.ebuild | 4 +-
2 files changed, 86 insertions(+), 2 deletions(-)
diff --git a/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch b/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch
new file mode 100644
index 00000000000..eb26ba8dca4
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.4.3-avoid_bashisms.patch
@@ -0,0 +1,84 @@
+From 97b4bdc042c48001132200828fe32c08cf9265e7 Mon Sep 17 00:00:00 2001
+From: Joe Dight <17280110+joedight@users.noreply.github.com>
+Date: Fri, 27 Nov 2020 20:14:24 +0000
+Subject: [PATCH 1/2] Fix configure.ac bashism
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e14ec4a..6db254f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -116,7 +116,7 @@ AC_PROG_INSTALL
+
+ dnl Check for python support
+ AM_CONDITIONAL([HAVE_PYTHON], [false])
+-if test x$wantpython == xyes ; then
++if test x$wantpython = xyes ; then
+ AM_PATH_PYTHON([3.0],,[:])
+ AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
+ fi
+--
+2.30.0
+
+
+From fb7585222503c48f35270ee148ad3fef762a7502 Mon Sep 17 00:00:00 2001
+From: Kerin Millar <kfm@plushkava.net>
+Date: Mon, 4 Jan 2021 00:57:29 +0100
+Subject: [PATCH 2/2] Don't rely on support for indirect expansion in the shell
+
+POSIX does not define the indirect expansion syntax. Moreover, if going
+to the trouble of executing Perl, one may as well take full advantage of
+it. Address the issue by first having the shell export the variable.
+Next, have Perl perform the replacement without utilising any form of
+code injection. Instead, export 'var' into Perl's environment. That
+way, Perl can reference the variable name as $ENV{var} and its value as
+$ENV{$ENV{var}}.
+
+Signed-off-by: Kerin Millar <kfm@plushkava.net>
+Closes: https://bugs.gentoo.org/715202
+Closes: https://github.com/dell/libsmbios/issues/89
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Makefile-std | 4 ++--
+ src/python/Makefile.am | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile-std b/Makefile-std
+index 7ac6fa2..dd30d68 100644
+--- a/Makefile-std
++++ b/Makefile-std
+@@ -38,7 +38,7 @@ install-data-hook:
+ file=$(DESTDIR)/$$i ;\
+ for var in $(REPLACE_VARS) ;\
+ do \
+- perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|" $$file;\
++ var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|' $$file;\
+ done ;\
+ done
+
+@@ -48,7 +48,7 @@ install-exec-hook:
+ file=$(DESTDIR)/$$i ;\
+ for var in $(REPLACE_VARS) ;\
+ do \
+- perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|" $$file;\
++ var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|' $$file;\
+ done ;\
+ done
+
+diff --git a/src/python/Makefile.am b/src/python/Makefile.am
+index 693b6d9..6aca968 100644
+--- a/src/python/Makefile.am
++++ b/src/python/Makefile.am
+@@ -29,5 +29,5 @@ src/python/_vars.py: src/python/libsmbios_c/_vars.py configure Makefile config.
+ cp $< $@
+ for var in $(REPLACE_VARS) ;\
+ do \
+- perl -p -i -e "s|^$$var\s*=.*|$$var=\"$${!var}\"|" $@;\
++ var="$$var" perl -p -i -e 's|^\Q$$ENV{var}\E\s*=.*|$$ENV{var}="$$ENV{$$ENV{var}}"|' $@;\
+ done
+--
+2.30.0
+
diff --git a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
index 867d00becf2..201ab1d33e8 100644
--- a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
+++ b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -31,6 +31,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+ "${FILESDIR}/${PN}-2.4.3-avoid_bashisms.patch" #715202
)
pkg_setup() {
@@ -57,7 +58,6 @@ src_configure() {
$(use_enable python)
$(use_enable static-libs static)
)
- CONFIG_SHELL="/bin/bash" \
econf "${myeconfargs[@]}"
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/
@ 2022-09-07 14:30 Marek Szuba
0 siblings, 0 replies; 3+ messages in thread
From: Marek Szuba @ 2022-09-07 14:30 UTC (permalink / raw
To: gentoo-commits
commit: eb995ace8e1a1e3dc198a45fb8e01f3c12905f27
Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 7 14:28:58 2022 +0000
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Sep 7 14:30:13 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb995ace
sys-libs/libsmbios: prune insecure RPATH from smbios-sys-info-lite
Closes: https://bugs.gentoo.org/380105
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
.../libsmbios/files/libsmbios-2.4.3-insecure_rpaths.patch | 13 +++++++++++++
sys-libs/libsmbios/libsmbios-2.4.3.ebuild | 1 +
2 files changed, 14 insertions(+)
diff --git a/sys-libs/libsmbios/files/libsmbios-2.4.3-insecure_rpaths.patch b/sys-libs/libsmbios/files/libsmbios-2.4.3-insecure_rpaths.patch
new file mode 100644
index 000000000000..e1390cb64770
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.4.3-insecure_rpaths.patch
@@ -0,0 +1,13 @@
+Instead of producing a static binary, this causes libtool to inject one
+of the build directories into RPATH.
+
+--- a/src/bin/Makefile.am
++++ b/src/bin/Makefile.am
+@@ -65,7 +65,6 @@
+ sbin_PROGRAMS += out/smbios-sys-info-lite
+ out_smbios_sys_info_lite_SOURCES = src/bin/smbios-sys-info-lite.c
+ out_smbios_sys_info_lite_LDADD = out/libsmbios_c.la out/libgetopt.la $(AM_LDADD)
+-out_smbios_sys_info_lite_LDFLAGS = $(AM_LDFLAGS) -static
+
+ sbin_PROGRAMS += out/smbios-get-ut-data
+ out_smbios_get_ut_data_SOURCES = src/bin/smbios-get-ut-data.c
diff --git a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
index 1bec5f76a965..1a480d6268b6 100644
--- a/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
+++ b/sys-libs/libsmbios/libsmbios-2.4.3.ebuild
@@ -32,6 +32,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
"${FILESDIR}/${PN}-2.4.3-avoid_bashisms.patch" #715202
+ "${FILESDIR}/${PN}-2.4.3-insecure_rpaths.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/
@ 2023-09-07 10:20 Marek Szuba
0 siblings, 0 replies; 3+ messages in thread
From: Marek Szuba @ 2023-09-07 10:20 UTC (permalink / raw
To: gentoo-commits
commit: 034e6374ee320914d8df1d27215e943a60c9dc78
Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 7 09:51:21 2023 +0000
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Sep 7 10:20:47 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=034e6374
sys-libs/libsmbios: squash long-present Python deprecation warning
Closes: https://bugs.gentoo.org/913238
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
.../libsmbios-2.4.3-python-deprecations.patch | 33 ++++++++
sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild | 92 ++++++++++++++++++++++
2 files changed, 125 insertions(+)
diff --git a/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch b/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch
new file mode 100644
index 000000000000..c67df620e85f
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch
@@ -0,0 +1,33 @@
+From 99e0ac359d55d7a66d944e038ad63a7f6ef6698d Mon Sep 17 00:00:00 2001
+From: troy <70726977+troygraben@users.noreply.github.com>
+Date: Mon, 26 Jul 2021 17:05:35 -0400
+Subject: [PATCH] Fix the TokenTable generator implementation
+
+This change supports PEP 479 by changing the generator to use return
+instead of raising StopIteration.
+
+This fixes the RuntimeError exception being raised with Python 3.7 and
+newer when the iterator reaches the end of the collection. This could be
+encountered when calling smbios-token-ctl --dump-tokens
+--- a/src/bin/smbios-token-ctl
++++ b/src/bin/smbios-token-ctl
+@@ -427,8 +427,6 @@ def main():
+ verboseLog.info( _("The token library returned this error:") )
+ verboseLog.info( str(e) )
+ moduleLog.info( cli.standardFailMessage )
+- except StopIteration:
+- pass
+
+ return exit_code
+
+--- a/src/python/libsmbios_c/smbios_token.py
++++ b/src/python/libsmbios_c/smbios_token.py
+@@ -131,7 +131,7 @@ def __iter__(self):
+ if bool(cur):
+ yield cur.contents
+ else:
+- raise StopIteration
++ return
+
+ @traceLog()
+ def __getitem__(self, id):
diff --git a/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild
new file mode 100644
index 000000000000..e1bb901b8e36
--- /dev/null
+++ b/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit autotools flag-o-matic python-single-r1
+
+DESCRIPTION="Provide access to (SM)BIOS information"
+HOMEPAGE="https://github.com/dell/libsmbios"
+SRC_URI="https://github.com/dell/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( GPL-2+ OSL-2.1 ) BSD Boost-1.0"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~ia64 ~x86"
+IUSE="doc graphviz nls +python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+ test? ( ${PYTHON_REQUIRED_USE} )"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ nls? ( virtual/libintl )
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ graphviz? ( media-gfx/graphviz )
+ nls? ( sys-devel/gettext )"
+BDEPEND="test? (
+ ${PYTHON_DEPS}
+ >=dev-util/cppunit-1.9.6
+)"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+ "${FILESDIR}/${PN}-2.4.3-avoid_bashisms.patch" #715202
+ "${FILESDIR}/${PN}-2.4.3-insecure_rpaths.patch"
+ "${FILESDIR}"/${PN}-2.4.3-python-deprecations.patch
+)
+
+pkg_setup() {
+ if use python || use test; then
+ python-single-r1_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+
+ # Don't build yum-plugin - we don't need it
+ sed '/yum-plugin/d' -i Makefile.am || die
+
+ if use test; then
+ python_fix_shebang src/pyunit/test*.py
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ #Remove -O3 for bug #290097
+ replace-flags -O3 -O2
+
+ local myeconfargs=(
+ $(use_enable doc doxygen)
+ $(use_enable graphviz)
+ $(use_enable nls)
+ $(use_enable python)
+ $(use_enable static-libs static)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ if use python; then
+ python_scriptinto /usr/sbin
+ python_doscript "${ED}"/usr/sbin/smbios-{{battery,keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,sys-info}
+ fi
+
+ insinto /usr/include/
+ doins -r src/include/smbios_c
+
+ einstalldocs
+
+ if ! use static-libs ; then
+ find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+ fi
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-07 10:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 14:30 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/ Marek Szuba
-- strict thread matches above, loose matches on Subject: below --
2023-09-07 10:20 Marek Szuba
2021-01-04 0:07 Lars Wendler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox