summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-01-08 16:53:34 +0000
committerSam James <sam@gentoo.org>2024-01-08 16:53:34 +0000
commitc798862e4a607518927bf3353524a24f2dbb480f (patch)
tree66b4efcb3c150daa50a3b0b41b40d8c9fe37357d /sys-libs/openipmi
parentdev-qt/qtwebengine: do the install sanity-check from qt5 in qt6 too (diff)
downloadgentoo-c798862e4a607518927bf3353524a24f2dbb480f.tar.gz
gentoo-c798862e4a607518927bf3353524a24f2dbb480f.tar.bz2
gentoo-c798862e4a607518927bf3353524a24f2dbb480f.zip
sys-libs/openipmi: fix modern C issue w/ USE=perl
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-libs/openipmi')
-rw-r--r--sys-libs/openipmi/files/openipmi-2.0.33-c99.patch56
-rw-r--r--sys-libs/openipmi/openipmi-2.0.33-r1.ebuild98
2 files changed, 154 insertions, 0 deletions
diff --git a/sys-libs/openipmi/files/openipmi-2.0.33-c99.patch b/sys-libs/openipmi/files/openipmi-2.0.33-c99.patch
new file mode 100644
index 000000000000..b7786c3ceab1
--- /dev/null
+++ b/sys-libs/openipmi/files/openipmi-2.0.33-c99.patch
@@ -0,0 +1,56 @@
+https://sourceforge.net/p/openipmi/patches/38/
+
+C type errors in the SWIG-generated Perl bindings
+
+The first change fixes an error with newer compilers:
+
+OpenIPMI_wrap.c: In function ‘_wrap_strconstarray_val_set’:
+OpenIPMI_wrap.c:10491:27: error: assignment to ‘const char **’ from incompatible pointer type ‘char **’
+10491 | if (arg1) (arg1)->val = arg2;
+ | ^
+
+The second change is also about a compiler error:
+
+In file included from /usr/lib64/perl5/CORE/perl.h:4530,
+ from OpenIPMI_wrap.c:751:
+OpenIPMI_wrap.c: In function ‘_wrap_ipmi_sol_conn_t_write’:
+/usr/lib64/perl5/CORE/sv.h:1952:31: error: passing argument 3 of ‘Perl_SvPV_helper’ from incompatible pointer type
+ 1952 | Perl_SvPV_helper(aTHX_ sv, &len, flags, SvPVnormal_type_, \
+/usr/lib64/perl5/CORE/sv.h:1972:37: note: in expansion of macro ‘SvPV_flags’
+ 1972 | #define SvPV(sv, len) SvPV_flags(sv, len, SV_GMAGIC)
+ | ^~~~~~~~~~
+OpenIPMI_wrap.c:27664:24: note: in expansion of macro ‘SvPV’
+27664 | (&arg2)->val = SvPV(tempsv, (&arg2)->len);
+ | ^~~~
+In file included from /usr/lib64/perl5/CORE/perl.h:7812:
+/usr/lib64/perl5/CORE/sv_inline.h:908:33: note: expected ‘STRLEN * const’ {aka ‘long unsigned int * const’} but argument is of type ‘int *’
+ 908 | STRLEN * const lp,
+ | ~~~~~~~~~~~~~~~^~
+
+But the existing code looks broken on big-endian 64-bit architectures,
+too.
+
+--- a/swig/OpenIPMI.i
++++ b/swig/OpenIPMI.i
+@@ -359,7 +359,7 @@ typedef struct iargarray
+ %}
+ typedef struct strconstarray
+ {
+- char **val;
++ const char **val;
+ int len;
+ } strconstarray;
+ typedef struct argarray
+--- a/swig/perl/OpenIPMI_lang.i
++++ b/swig/perl/OpenIPMI_lang.i
+@@ -292,7 +292,9 @@
+ $1.val = NULL;
+ $1.len = 0;
+ } else {
+- $1.val = SvPV(tempsv, $1.len);
++ STRLEN len;
++ $1.val = SvPV(tempsv, len);
++ $1.len = len;
+ }
+ }
+
diff --git a/sys-libs/openipmi/openipmi-2.0.33-r1.ebuild b/sys-libs/openipmi/openipmi-2.0.33-r1.ebuild
new file mode 100644
index 000000000000..26db37796649
--- /dev/null
+++ b/sys-libs/openipmi/openipmi-2.0.33-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit autotools python-single-r1
+
+MY_PN="OpenIPMI"
+MY_P="${MY_PN}-${PV/_/-}"
+DESCRIPTION="Library interface to IPMI"
+HOMEPAGE="https://sourceforge.net/projects/openipmi/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="crypt snmp perl python static-libs tcl"
+
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/popt
+ sys-libs/gdbm:=
+ sys-libs/ncurses:=
+ sys-libs/readline:=
+ crypt? ( dev-libs/openssl:= )
+ snmp? ( net-analyzer/net-snmp )
+ perl? ( dev-lang/perl:= )
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( dev-lang/tcl:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ >=dev-lang/swig-1.3.21
+ virtual/pkgconfig
+"
+
+# Gui is broken!
+# python? ( tcl? ( tk? ( dev-lang/tk dev-tcltk/tix ) ) )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.26-tinfo.patch" # bug #501510
+ "${FILESDIR}/${PN}-2.0.33-c99.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # For tinfo patch
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ # These binaries are for root!
+ --bindir="${EPREFIX}"/usr/sbin
+ --with-glib
+ --with-glibver=2.0
+ --with-swig
+ --without-tkinter
+ $(use_with snmp ucdsnmp yes)
+ $(use_with crypt openssl yes)
+ $(use_with perl perl yes)
+ $(use_with tcl tcl yes)
+ $(use_with python python yes)
+ )
+
+ # GUI is broken
+ #use tk && use python && use !tcl && \
+ # ewarn "Not building Tk GUI because it needs both Python AND Tcl"
+ #if use python && use tcl; then
+ # myconf+=( $(use_with tk tkinter) )
+ #else
+ # myconf+=( --without-tkinter )
+ #fi
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* FAQ ChangeLog TODO doc/IPMI.pdf lanserv/README.vm
+ newdoc cmdlang/README README.cmdlang
+
+ use python && python_optimize
+
+ find "${ED}" -name "*.la" -delete || die
+
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}