diff options
author | Pacho Ramos <pacho@gentoo.org> | 2024-09-09 10:19:55 +0200 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2024-09-09 10:22:41 +0200 |
commit | 530901e555a778c235f8031a65abb5c4eff9cf05 (patch) | |
tree | 653e9ea7c7793ead1a1e603a79486bc4305eb7c4 /media-libs/plotutils | |
parent | dev-ruby/simplecov-html: fix pkgcheck issue (diff) | |
download | gentoo-530901e555a778c235f8031a65abb5c4eff9cf05.tar.gz gentoo-530901e555a778c235f8031a65abb5c4eff9cf05.tar.bz2 gentoo-530901e555a778c235f8031a65abb5c4eff9cf05.zip |
media-libs/plotutils: Drop .la files, fix impl declarations
Fix implicit declarations in configure files, c++17 compat (also
fixing tests), drop .la files, port to greadme.eclass.
Closes: https://bugs.gentoo.org/899836
Closes: https://bugs.gentoo.org/847508
Closes: https://bugs.gentoo.org/618708
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'media-libs/plotutils')
-rw-r--r-- | media-libs/plotutils/files/plotutils-2.6-configure-c99.patch | 54 | ||||
-rw-r--r-- | media-libs/plotutils/files/plotutils-2.6-cxx17-fix.patch | 46 | ||||
-rw-r--r-- | media-libs/plotutils/plotutils-2.6-r3.ebuild | 82 |
3 files changed, 182 insertions, 0 deletions
diff --git a/media-libs/plotutils/files/plotutils-2.6-configure-c99.patch b/media-libs/plotutils/files/plotutils-2.6-configure-c99.patch new file mode 100644 index 000000000000..282596049953 --- /dev/null +++ b/media-libs/plotutils/files/plotutils-2.6-configure-c99.patch @@ -0,0 +1,54 @@ +Do not call the undeclared exit function. This avoids build problems +with future compilers which do not support implicit function +declarations. + +diff --git a/configure b/configure +index 229ccd453ae4487f..fdf3785ad4c5175f 100755 +--- a/configure ++++ b/configure +@@ -19537,9 +19537,9 @@ int main() + || fflush ((FILE *)0) < 0 + || (fpr = fopen ("conftest0", "r")) == (FILE *)0 + || fread (test_array, 1, 7, fpr) != 7) +- exit (1); ++ return 1; + else +- exit(0); } ++ return 0; } + _ACEOF + rm -f conftest$ac_exeext + if { (ac_try="$ac_link" +@@ -24022,7 +24022,7 @@ int main() + int i; + for (i=0; i < B; i++) + Array[i] = i - 3; +- exit (Array[1] != -2); ++ return Array[1] != -2; + } + _ACEOF + rm -f conftest$ac_exeext +diff --git a/configure.ac b/configure.ac +index 8fb7b640864eb4a8..d1f6d7e08c6946d4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -88,9 +88,9 @@ int main() + || fflush ((FILE *)0) < 0 + || (fpr = fopen ("conftest0", "r")) == (FILE *)0 + || fread (test_array, 1, 7, fpr) != 7) +- exit (1); ++ return 1; + else +- exit(0); }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) ++ return 0; }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) + + # Checks for header files: ANSI C, POSIX, and nonstandard Unix headers. + AC_HEADER_STDC +@@ -383,7 +383,7 @@ int main() + int i; + for (i=0; i < B; i++) + Array[[i]] = i - 3; +- exit (Array[[1]] != -2); ++ return Array[[1]] != -2; + }]])], + [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"]) ) + if test "$ac_cv_c_gcc_strength_bug" = "yes" diff --git a/media-libs/plotutils/files/plotutils-2.6-cxx17-fix.patch b/media-libs/plotutils/files/plotutils-2.6-cxx17-fix.patch new file mode 100644 index 000000000000..a14336a580d7 --- /dev/null +++ b/media-libs/plotutils/files/plotutils-2.6-cxx17-fix.patch @@ -0,0 +1,46 @@ +https://github.com/NixOS/nixpkgs/commit/92d99c521b2c02fa645b3b993ac4bbaf49e43ddd + +diff -ur a/pic2plot/gram.cc b/pic2plot/gram.cc +--- a/pic2plot/gram.cc 2000-06-28 00:23:21.000000000 -0400 ++++ b/pic2plot/gram.cc 2023-09-07 22:59:47.004460065 -0400 +@@ -1229,9 +1229,9 @@ + char *from; + unsigned int count; + { +- register char *f = from; +- register char *t = to; +- register int i = count; ++ char *f = from; ++ char *t = to; ++ int i = count; + + while (i-- > 0) + *t++ = *f++; +@@ -1244,9 +1244,9 @@ + static void + __yy_memcpy (char *to, char *from, unsigned int count) + { +- register char *t = to; +- register char *f = from; +- register int i = count; ++ char *t = to; ++ char *f = from; ++ int i = count; + + while (i-- > 0) + *t++ = *f++; +@@ -1289,10 +1289,10 @@ + yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL + { +- register int yystate; +- register int yyn; +- register short *yyssp; +- register YYSTYPE *yyvsp; ++ int yystate; ++ int yyn; ++ short *yyssp; ++ YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + diff --git a/media-libs/plotutils/plotutils-2.6-r3.ebuild b/media-libs/plotutils/plotutils-2.6-r3.ebuild new file mode 100644 index 000000000000..9b4fdd74264e --- /dev/null +++ b/media-libs/plotutils/plotutils-2.6-r3.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit libtool autotools greadme + +DESCRIPTION="Powerful C/C++ function library for exporting 2-D vector graphics" +HOMEPAGE="https://www.gnu.org/software/plotutils/" +SRC_URI="mirror://gnu/plotutils/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="+png X" + +DEPEND=" + media-libs/libxmi + png? ( + media-libs/libpng:0= + sys-libs/zlib + ) + X? ( x11-libs/libXaw ) +" +RDEPEND="${DEPEND} + !<media-libs/plotutils-${PV} +" + +DOCS=( AUTHORS COMPAT ChangeLog INSTALL.{fonts,pkg} KNOWN_BUGS NEWS ONEWS PROBLEMS README THANKS TODO ) + +PATCHES=( + "${FILESDIR}"/${PN}-2.5.1-rangecheck.patch + "${FILESDIR}"/${P}-makefile.patch + "${FILESDIR}"/${P}-libpng-1.5.patch + "${FILESDIR}"/${P}-libxmi.patch + "${FILESDIR}"/${P}-format-security.patch + "${FILESDIR}"/${P}-configure-c99.patch + "${FILESDIR}"/${P}-cxx17-fix.patch +) + +src_prepare() { + default + + rm -r libxmi/* || die + sed -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' -i configure.ac || die + + eautoreconf + elibtoolize +} + +src_configure() { + local myeconfargs=( + --enable-shared + --enable-libplotter + --disable-libxmi + --disable-static + $(use_with png libpng) + $(usex X "--with-x --enable-libxmi" "--without-x") + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + find "${ED}" -type f -name '*.la' -delete || die + + if use X ; then + greadme_stdin <<-EOF + There are extra fonts available in the plotutils package. + The current ebuild does not install them for you since most + of them can be installed via the media-fonts/urw-fonts + package. See /usr/share/doc/${PF}/INSTALL.fonts for + information on installing the remaining Tektronix fonts. + + If you manually install the extra fonts and use the + program xfig, you might want to recompile to take + advantage of the additional ps fonts. + Also, it is possible to enable ghostscript and your + printer to use the HP fonts. + EOF + fi +} |