commit:     5d09ae33251f4762aae22d3683d47e2cde204efd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 14 00:35:25 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr 14 00:35:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d09ae33

media-libs/t1lib: fix Modern C issues

Closes: https://bugs.gentoo.org/870901
Closes: https://bugs.gentoo.org/899838
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../t1lib/files/t1lib-5.1.2-c99-configure.patch    | 10 ++++++++++
 media-libs/t1lib/files/t1lib-5.1.2-c99.patch       | 15 ++++++++++++++
 ...t1lib-5.1.2-r4.ebuild => t1lib-5.1.2-r5.ebuild} | 23 ++++++++++++++++------
 3 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/media-libs/t1lib/files/t1lib-5.1.2-c99-configure.patch 
b/media-libs/t1lib/files/t1lib-5.1.2-c99-configure.patch
new file mode 100644
index 000000000000..62a4df22a537
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-c99-configure.patch
@@ -0,0 +1,10 @@
+--- a/configure.in
++++ b/configure.in
+@@ -144,6 +144,7 @@ dnl We don'use
+   CFLAGS="$CFLAGS"
+   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
+                   AC_TRY_RUN([
++#include <stdlib.h>
+ int main(void) {
+   static int Array[[3]];
+   unsigned int B = 3;

diff --git a/media-libs/t1lib/files/t1lib-5.1.2-c99.patch 
b/media-libs/t1lib/files/t1lib-5.1.2-c99.patch
new file mode 100644
index 000000000000..d1d3301fcc62
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-c99.patch
@@ -0,0 +1,15 @@
+https://src.fedoraproject.org/rpms/t1lib/blob/rawhide/f/t1lib-c99.patch
+
+Add missing parameter types for improved C99 compatibility: implicit
+ints are not part of C99.
+
+--- a/lib/type1/regions.c
++++ b/lib/type1/regions.c
+@@ -604,6 +604,7 @@
+        register struct region *R;  /* region in which we are changing 
direction */
+        fractpel x,y;         /* current beginning x,y                        
*/
+        fractpel dy;          /* direction and magnitude of change in y       
*/
++       int x2, y2;
+ {
+        register fractpel ymin,ymax;  /* minimum and maximum Y since last call 
*/
+        register fractpel x_at_ymin,x_at_ymax;  /* their respective X's       
*/

diff --git a/media-libs/t1lib/t1lib-5.1.2-r4.ebuild 
b/media-libs/t1lib/t1lib-5.1.2-r5.ebuild
similarity index 83%
rename from media-libs/t1lib/t1lib-5.1.2-r4.ebuild
rename to media-libs/t1lib/t1lib-5.1.2-r5.ebuild
index c9f251b91a39..2ccee89b20ac 100644
--- a/media-libs/t1lib/t1lib-5.1.2-r4.ebuild
+++ b/media-libs/t1lib/t1lib-5.1.2-r5.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit flag-o-matic libtool toolchain-funcs
+inherit autotools flag-o-matic libtool toolchain-funcs
 
 DESCRIPTION="Type 1 Font Rasterizer Library for UNIX/X11"
 HOMEPAGE="https://www.t1lib.org/";
@@ -14,14 +14,18 @@ SLOT="5"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x64-solaris"
 IUSE="X doc static-libs"
 
-RDEPEND="X? (
+RDEPEND="
+       X? (
                x11-libs/libXaw
                x11-libs/libX11
                x11-libs/libXt
-       )"
-DEPEND="${RDEPEND}
+       )
+"
+DEPEND="
+       ${RDEPEND}
        doc? ( virtual/latex-base )
-       X? ( x11-base/xorg-proto )"
+       X? ( x11-base/xorg-proto )
+"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-5.1.1-parallel.patch
@@ -30,6 +34,8 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch
        "${FILESDIR}"/${PN}-5.1.2-CVE-2011-0764.patch
        "${FILESDIR}"/${PN}-5.1.2-CVE-2011-1552_1553_1554.patch
+       "${FILESDIR}"/${PN}-5.1.2-c99.patch
+       "${FILESDIR}"/${PN}-5.1.2-c99-configure.patch
 )
 
 src_prepare() {
@@ -37,11 +43,16 @@ src_prepare() {
 
        sed -i -e "s:dvips:#dvips:" "${S}"/doc/Makefile.in || die
        sed -i -e "s:\./\(t1lib\.config\):/etc/t1lib/\1:" 
"${S}"/xglyph/xglyph.c || die
-       # Needed for sane .so versionning on fbsd. Please don't drop.
+
+       eautoconf
+       # Needed for sane .so versioning on fbsd. Please don't drop.
        elibtoolize
 }
 
 src_configure() {
+       # lto-type-mismatch
+       filter-lto
+
        econf \
                --datadir="${EPREFIX}/etc" \
                $(use_enable static-libs static) \

Reply via email to