summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-09-23 12:21:26 +0100
committerSam James <sam@gentoo.org>2024-09-23 12:21:26 +0100
commit59d4d2a90596d3dc8b23b4b07e274c0d8517c8b7 (patch)
tree1b26c54fa343d667bad55c632fbe6f3d24ef3453 /media-libs/ftgl
parentapp-antivirus/clamav: drop vulnerable (diff)
downloadgentoo-59d4d2a90596d3dc8b23b4b07e274c0d8517c8b7.tar.gz
gentoo-59d4d2a90596d3dc8b23b4b07e274c0d8517c8b7.tar.bz2
gentoo-59d4d2a90596d3dc8b23b4b07e274c0d8517c8b7.zip
media-libs/ftgl: fix build w/ freetype-2.13.3
Closes: https://bugs.gentoo.org/937849 Thanks-to: konsolebox <konsolebox@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/ftgl')
-rw-r--r--media-libs/ftgl/files/ftgl-2.1.3_rc5-freetype-2.13.3.patch49
-rw-r--r--media-libs/ftgl/ftgl-2.1.3_rc5-r2.ebuild59
2 files changed, 108 insertions, 0 deletions
diff --git a/media-libs/ftgl/files/ftgl-2.1.3_rc5-freetype-2.13.3.patch b/media-libs/ftgl/files/ftgl-2.1.3_rc5-freetype-2.13.3.patch
new file mode 100644
index 000000000000..d22b25757fa6
--- /dev/null
+++ b/media-libs/ftgl/files/ftgl-2.1.3_rc5-freetype-2.13.3.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/937849
+
+--- a/src/FTContour.cpp
++++ b/src/FTContour.cpp
+@@ -163,7 +163,7 @@ void FTContour::SetParity(int parity)
+ }
+
+
+-FTContour::FTContour(FT_Vector* contour, char* tags, unsigned int n)
++FTContour::FTContour(FT_Vector* contour, FTContour::PointTagsType tags, unsigned int n)
+ {
+ FTPoint prev, cur(contour[(n - 1) % n]), next(contour[0]);
+ FTPoint a, b = next - cur;
+--- a/src/FTContour.h
++++ b/src/FTContour.h
+@@ -44,6 +44,12 @@
+ */
+ class FTContour
+ {
++#if (FREETYPE_MAJOR * 1000 + FREETYPE_MINOR) * 1000 + FREETYPE_PATCH < 2013003
++ typedef char* PointTagsType;
++#else
++ typedef unsigned char* PointTagsType;
++#endif
++
+ public:
+ /**
+ * Constructor
+@@ -52,7 +58,7 @@ class FTContour
+ * @param pointTags
+ * @param numberOfPoints
+ */
+- FTContour(FT_Vector* contour, char* pointTags, unsigned int numberOfPoints);
++ FTContour(FT_Vector* contour, PointTagsType pointTags, unsigned int numberOfPoints);
+
+ /**
+ * Destructor
+--- a/src/FTVectoriser.cpp
++++ b/src/FTVectoriser.cpp
+@@ -166,7 +166,7 @@ void FTVectoriser::ProcessContours()
+ for(int i = 0; i < ftContourCount; ++i)
+ {
+ FT_Vector* pointList = &outline.points[startIndex];
+- char* tagList = &outline.tags[startIndex];
++ auto tagList = &outline.tags[startIndex];
+
+ endIndex = outline.contours[i];
+ contourLength = (endIndex - startIndex) + 1;
+
diff --git a/media-libs/ftgl/ftgl-2.1.3_rc5-r2.ebuild b/media-libs/ftgl/ftgl-2.1.3_rc5-r2.ebuild
new file mode 100644
index 000000000000..0fb8b7874d6b
--- /dev/null
+++ b/media-libs/ftgl/ftgl-2.1.3_rc5-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+MY_PV="${PV/_/-}"
+MY_PV2="${PV/_/\~}"
+MY_P="${PN}-${MY_PV}"
+MY_P2="${PN}-${MY_PV2}"
+
+DESCRIPTION="library to use arbitrary fonts in OpenGL applications"
+HOMEPAGE="https://sourceforge.net/projects/ftgl/"
+SRC_URI="https://downloads.sourceforge.net/${PN}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P2}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+DEPEND="
+ media-libs/freeglut
+ >=media-libs/freetype-2.0.9
+ virtual/opengl
+ virtual/glu
+"
+RDEPEND="${DEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gentoo.patch
+ "${FILESDIR}"/${P}-underlink.patch
+ "${FILESDIR}"/${P}-freetype_pkgconfig.patch
+ "${FILESDIR}"/${P}-clang.patch
+ "${FILESDIR}"/${P}-freetype-2.13.3.patch
+)
+
+src_prepare() {
+ default
+
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ strip-flags # ftgl is sensitive - bug #112820
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ local DOCS=( AUTHORS BUGS ChangeLog NEWS README TODO docs/projects_using_ftgl.txt)
+
+ default
+
+ rm -r "${ED}"/usr/share/doc/ftgl || die
+ find "${ED}" -name '*.la' -delete || die
+}