diff options
author | Eli Schwartz <eschwartz@gentoo.org> | 2024-09-02 20:47:33 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@gentoo.org> | 2024-09-02 20:53:33 -0400 |
commit | c8a42f563932679b1bf3f97b7462a32784dc3c80 (patch) | |
tree | f53a5e44badf690af9be1e37bc93ab3ddd101cc9 /x11-libs/xbae | |
parent | x11-libs/xbae: update HOMEPAGE to use https (diff) | |
download | gentoo-c8a42f563932679b1bf3f97b7462a32784dc3c80.tar.gz gentoo-c8a42f563932679b1bf3f97b7462a32784dc3c80.tar.bz2 gentoo-c8a42f563932679b1bf3f97b7462a32784dc3c80.zip |
x11-libs/xbae: partial Modern C work
Fix implicit configure script stuff via fedora patch. Fix one c99 error
in the codebase (there are two others).
It turns out that it is actually possible to regenerate the configure
script using modern autotools, relatively simply even. You just need to
tell it that the m4 macro directory is... the root of the source code.
Quite enlightening... they installed custom macros there and then
m4_included that into aclocal.m4 but of course that gets overwritten by
aclocal.
Closes: https://bugs.gentoo.org/898846
Bug: https://bugs.gentoo.org/919195
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Diffstat (limited to 'x11-libs/xbae')
-rw-r--r-- | x11-libs/xbae/files/xbae-4.60.4-c99.patch | 24 | ||||
-rw-r--r-- | x11-libs/xbae/files/xbae-4.60.4-configure-c99.patch | 57 | ||||
-rw-r--r-- | x11-libs/xbae/files/xbae-4.60.4-modern-autotools.patch | 28 | ||||
-rw-r--r-- | x11-libs/xbae/xbae-4.60.4-r1.ebuild | 75 |
4 files changed, 184 insertions, 0 deletions
diff --git a/x11-libs/xbae/files/xbae-4.60.4-c99.patch b/x11-libs/xbae/files/xbae-4.60.4-c99.patch new file mode 100644 index 000000000000..8c50dad3030d --- /dev/null +++ b/x11-libs/xbae/files/xbae-4.60.4-c99.patch @@ -0,0 +1,24 @@ +From bbfc674fc85c874560c784bd8076be7c9b3b5f43 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz93@gmail.com> +Date: Sun, 1 Sep 2024 22:33:09 -0400 +Subject: [PATCH] c99 porting: fix UB from not including headers + +--- + examples/matrix/matrix.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/examples/matrix/matrix.c b/examples/matrix/matrix.c +index 1d3e1df..3fbecf6 100644 +--- a/examples/matrix/matrix.c ++++ b/examples/matrix/matrix.c +@@ -28,6 +28,7 @@ + #ifdef HAVE_CONFIG_H + #include <XbaeConfig.h> + #endif ++#include <stdio.h> + #include <stdlib.h> + #ifdef USE_EDITRES + #include <X11/Intrinsic.h> +-- +2.44.2 + diff --git a/x11-libs/xbae/files/xbae-4.60.4-configure-c99.patch b/x11-libs/xbae/files/xbae-4.60.4-configure-c99.patch new file mode 100644 index 000000000000..33f108d8d603 --- /dev/null +++ b/x11-libs/xbae/files/xbae-4.60.4-configure-c99.patch @@ -0,0 +1,57 @@ +https://sourceforge.net/p/xbae/patches/3/ + +diff --git a/acinclude.m4 b/acinclude.m4 +index 36b4569680ea8531..0bda82ef7480beaf 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -334,7 +334,7 @@ Display *display=NULL; + short major_version, minor_version; + Status rc; + rc=XpQueryVersion(display, &major_version, &minor_version); +-exit(0); ++return 0; + } + ], + lt_cv_libxp=yes, +diff --git a/configure b/configure +index f43d920c33b055ff..5e82cda106a450e8 100755 +--- a/configure ++++ b/configure +@@ -2937,7 +2937,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ +- '' \ ++ '#include <stdlib.h>' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -4120,7 +4120,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ +- '' \ ++ '#include <stdlib.h>' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ +@@ -4477,8 +4477,8 @@ main () + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) +- exit(2); +- exit (0); ++ return 2; ++ return 0; + } + _ACEOF + rm -f conftest$ac_exeext +@@ -21418,7 +21418,7 @@ Display *display=NULL; + short major_version, minor_version; + Status rc; + rc=XpQueryVersion(display, &major_version, &minor_version); +-exit(0); ++return 0; + } + + ; diff --git a/x11-libs/xbae/files/xbae-4.60.4-modern-autotools.patch b/x11-libs/xbae/files/xbae-4.60.4-modern-autotools.patch new file mode 100644 index 000000000000..ac5ebaa0f8b6 --- /dev/null +++ b/x11-libs/xbae/files/xbae-4.60.4-modern-autotools.patch @@ -0,0 +1,28 @@ +From 165c0f9ae086373c5d1659eac1ae14baa2975145 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz <eschwartz93@gmail.com> +Date: Sun, 1 Sep 2024 22:09:04 -0400 +Subject: [PATCH] port to modern autotools + +When listing files to be installed, you cannot double-list them. Modern +autotools tries to install all of them in one `install` command, which +is incompatible with installing the same file twice. +--- + doc/images/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/images/Makefile.am b/doc/images/Makefile.am +index e6d91dd..79a8eb0 100644 +--- a/doc/images/Makefile.am ++++ b/doc/images/Makefile.am +@@ -34,7 +34,7 @@ image_DATA= \ + bg.png updated.png coverplus.png add.jpg \ + caption.png choice.png colors.jpg draw.png fifteen.jpg \ + input.png list.jpg matrix.jpg multifixed.jpg select-push.jpg \ +- mailbox.png bg.png pricing.jpg LDO.jpg risk.jpg \ ++ mailbox.png pricing.jpg LDO.jpg risk.jpg \ + organize.jpg xbasket.png xbum1-2.png xbill2-2.png capfloor1.png \ + capfloor3.png taam.png \ + grohtml-XbaeCaption1.png \ +-- +2.44.2 + diff --git a/x11-libs/xbae/xbae-4.60.4-r1.ebuild b/x11-libs/xbae/xbae-4.60.4-r1.ebuild new file mode 100644 index 000000000000..97c4b052809d --- /dev/null +++ b/x11-libs/xbae/xbae-4.60.4-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +AT_M4DIR=${S} + +inherit autotools + +DESCRIPTION="Motif-based widget to display a grid of cells as a spreadsheet" +HOMEPAGE="https://xbae.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="doc examples" +# tests need X display +# and are interactive so virtualx will not help +RESTRICT="test" + +RDEPEND=" + x11-libs/motif:0 + x11-libs/libXau + x11-libs/libXdmcp + x11-libs/libXext + x11-libs/libXmu + x11-libs/libXpm + x11-libs/libXt" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-tmpl.patch + "${FILESDIR}"/${P}-lxmp.patch + "${FILESDIR}"/${P}-Makefile.in.patch + # https://sourceforge.net/p/xbae/patches/3/ + "${FILESDIR}"/${P}-configure-c99.patch + "${FILESDIR}"/${P}-modern-autotools.patch + "${FILESDIR}"/${P}-c99.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf --enable-production +} + +src_test() { + emake -C examples + emake -C examples/testall clean +} + +src_install() { + default + + insinto /usr/share/aclocal + doins ac_find_xbae.m4 + + if use examples; then + find examples -name '*akefile*' -delete || die + rm examples/{testall,extest} || die + dodoc -r examples + fi + if use doc; then + rm doc/{,images/}Makefile* || die + docinto html + dodoc -r doc/. + fi + + # no static archives + find "${D}" -name '*.la' -delete || die +} |