From f637058d0f531300ec76c142f86e2c8615c0e279 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Fri, 3 Jan 2025 21:01:08 -0500 Subject: [PATCH] ftgl: Fix builds with freetype 2.13.3 Based on research into this issue, freetype 2.13.3 changed some return types that caused current (modern?) builds to fail as seen in the linked ticket. A patch was applied with frankheckenbach/ftgl#20 that appears to fix this, but the repo owner has not indicated a plan to cut a new release with this and other fixes since v2.4.0. In addition to the patch files that were previously present, I have applied all other patches from v2.4.0 to current HEAD. This involved removing the existing patch files, but those changes have been fully incorporated. Builds with +doc and +universal variants worked fine and I have tested a downstream port (gource) with this on an affected system. macOS 15.2 24C101 arm64 Xcode 16.2 16C5032a Closes: https://trac.macports.org/ticket/71434 --- graphics/ftgl/Portfile | 28 +++- graphics/ftgl/files/AC_ARG_WITH.patch | 35 ----- .../ftgl/files/CMakeLists-pkgconfig.patch | 32 ++++ .../ftgl/files/FTFont-GL_TEXTURE_BIT.patch | 34 +++++ graphics/ftgl/files/autoconf.patch | 56 +++++++ graphics/ftgl/files/debian.patch | 49 ++++++ graphics/ftgl/files/docs-meta.patch | 141 ++++++++++++++++++ graphics/ftgl/files/dylib_file.patch | 22 --- graphics/ftgl/files/float-functions.patch | 78 ++++++++++ graphics/ftgl/files/fontdemo.patch | 0 .../files/freetype2-13-3-type-error.patch | 51 +++++++ .../src_CMakeLists-remove-FTLibrary.patch | 16 ++ 12 files changed, 481 insertions(+), 61 deletions(-) delete mode 100644 graphics/ftgl/files/AC_ARG_WITH.patch create mode 100644 graphics/ftgl/files/CMakeLists-pkgconfig.patch create mode 100644 graphics/ftgl/files/FTFont-GL_TEXTURE_BIT.patch create mode 100644 graphics/ftgl/files/autoconf.patch create mode 100644 graphics/ftgl/files/debian.patch create mode 100644 graphics/ftgl/files/docs-meta.patch delete mode 100644 graphics/ftgl/files/dylib_file.patch create mode 100644 graphics/ftgl/files/float-functions.patch create mode 100644 graphics/ftgl/files/fontdemo.patch create mode 100644 graphics/ftgl/files/freetype2-13-3-type-error.patch create mode 100644 graphics/ftgl/files/src_CMakeLists-remove-FTLibrary.patch diff --git a/graphics/ftgl/Portfile b/graphics/ftgl/Portfile index dfa5c26dc7b26..4dd6e7c968c2c 100644 --- a/graphics/ftgl/Portfile +++ b/graphics/ftgl/Portfile @@ -4,7 +4,7 @@ PortSystem 1.0 PortGroup github 1.0 github.setup frankheckenbach ftgl 2.4.0 v -revision 1 +revision 2 platforms darwin categories graphics license MIT @@ -18,13 +18,25 @@ checksums rmd160 c904e2aa2e5dc5329867ce120f4b1ebe1910ff65 \ sha256 933a371dbb2f44c9fa3121484d46081b5f1ed08c18908ba49bff92811629aede \ size 630956 +# There is a bug *somehwere* which is causing `$all_dist_files` to have an extra blank +# value (`[{ } ftgl-2.4.0.tar.gz]`). This fixes this to remove the blank value, allowing +# the checksum to proceed with the correct `$all_dist_files` ([ftgl-2.4.0.tar.gz]). +# +# This is a complete hack. +pre-checksum { + if {[lsearch -exact $all_dist_files { }] != -1} { + set blank_index [lsearch -exact $all_dist_files { }] + set all_dist_files [lreplace $all_dist_files $blank_index $blank_index] + } +} + use_autoreconf yes autoreconf.env LIBTOOLIZE=${prefix}/bin/glibtoolize autoreconf.cmd ./autogen.sh autoreconf.args depends_lib-append \ - port:freetype + port:freetype depends_build-append \ port:autoconf \ @@ -33,8 +45,16 @@ depends_build-append \ port:libtool \ port:pkgconfig -patchfiles AC_ARG_WITH.patch \ - dylib_file.patch +patch.pre_args-replace -p0 -p1 +patchfiles autoconf.patch \ + CMakeLists-pkgconfig.patch \ + debian.patch \ + docs-meta.patch \ + float-functions.patch \ + fontdemo.patch \ + freetype2-13-3-type-error.patch \ + FTFont-GL_TEXTURE_BIT.patch \ + src_CMakeLists-remove-FTLibrary.patch # Don't use MacPorts X11 since there doesn't seem to be a need to do so. # Don't use MacPorts OpenGL (mesa) since that would bring in X11 deps. diff --git a/graphics/ftgl/files/AC_ARG_WITH.patch b/graphics/ftgl/files/AC_ARG_WITH.patch deleted file mode 100644 index a37606e5a71b4..0000000000000 --- a/graphics/ftgl/files/AC_ARG_WITH.patch +++ /dev/null @@ -1,35 +0,0 @@ -Use AC_ARG_WITH correctly so that the advertised configure options -actually exist under their expected names. - -https://github.com/frankheckenbach/ftgl/pull/13 ---- m4/gl.m4.orig 2019-02-07 15:39:58.000000000 -0600 -+++ m4/gl.m4 2021-02-10 21:21:30.000000000 -0600 -@@ -7,11 +7,11 @@ - AC_REQUIRE([AC_PATH_X]) - AC_REQUIRE([AC_PATH_XTRA]) - --AC_ARG_WITH([--with-gl-inc], -+AC_ARG_WITH([gl-inc], - AC_HELP_STRING([--with-gl-inc=DIR],[Directory where GL/gl.h is installed])) --AC_ARG_WITH([--with-gl-lib], -+AC_ARG_WITH([gl-lib], - AC_HELP_STRING([--with-gl-lib=DIR],[Directory where OpenGL libraries are installed])) --AC_ARG_WITH([--with-glu-lib], -+AC_ARG_WITH([glu-lib], - AC_HELP_STRING([--with-glu-lib=DIR],[Directory where OpenGL GLU library is installed])) - - AC_LANG_SAVE ---- m4/glut.m4.orig 2019-02-07 15:39:58.000000000 -0600 -+++ m4/glut.m4 2021-02-10 21:21:21.000000000 -0600 -@@ -8,9 +8,9 @@ - AC_REQUIRE([AC_PATH_XTRA])dnl - AC_REQUIRE([FTGL_CHECK_GL])dnl - --AC_ARG_WITH([--with-glut-inc], -+AC_ARG_WITH([glut-inc], - AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)])) --AC_ARG_WITH([--with-glut-lib], -+AC_ARG_WITH([glut-lib], - AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)])) - - AC_LANG_SAVE diff --git a/graphics/ftgl/files/CMakeLists-pkgconfig.patch b/graphics/ftgl/files/CMakeLists-pkgconfig.patch new file mode 100644 index 0000000000000..51c28437b9f92 --- /dev/null +++ b/graphics/ftgl/files/CMakeLists-pkgconfig.patch @@ -0,0 +1,32 @@ +diff --git c/CMakeLists.txt i/CMakeLists.txt +index 303fcaede209..cdcf2c96012d 100644 +--- c/CMakeLists.txt ++++ i/CMakeLists.txt +@@ -72,5 +72,14 @@ endif () + + install(EXPORT FTGL-targets DESTINATION "${cmakedir}") + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FTGLConfig.cmake" + DESTINATION "${cmakedir}") ++ ++SET(PKGCONFIG_INSTALL_PREFIX "lib${LIB_SUFFIX}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files") ++CONFIGURE_FILE( ++ ${CMAKE_CURRENT_SOURCE_DIR}/ftgl.pc.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/ftgl.pc ++ @ONLY) ++INSTALL( ++ FILES ${CMAKE_CURRENT_BINARY_DIR}/ftgl.pc ++ DESTINATION ${PKGCONFIG_INSTALL_PREFIX}) +diff --git c/ftgl.pc.cmake i/ftgl.pc.cmake +new file mode 100644 +index 000000000000..1f1a0af7b3f4 +--- /dev/null ++++ i/ftgl.pc.cmake +@@ -0,0 +1,6 @@ ++Name: ftgl ++Description: OpenGL frontend to Freetype 2 ++Requires.private: freetype2 ++Version: @VERSION_SERIES@.@VERSION_MAJOR@.@VERSION_MINOR@ ++Libs: -L@CMAKE_INSTALL_PREFIX@/lib -lftgl ++Cflags: -I@CMAKE_INSTALL_PREFIX@/include +\ No newline at end of file diff --git a/graphics/ftgl/files/FTFont-GL_TEXTURE_BIT.patch b/graphics/ftgl/files/FTFont-GL_TEXTURE_BIT.patch new file mode 100644 index 0000000000000..04cb55f219aea --- /dev/null +++ b/graphics/ftgl/files/FTFont-GL_TEXTURE_BIT.patch @@ -0,0 +1,34 @@ +diff --git c/src/FTFont/FTBufferFont.cpp i/src/FTFont/FTBufferFont.cpp +index ce04cf56ae0f..b330a3b119f7 100644 +--- c/src/FTFont/FTBufferFont.cpp ++++ i/src/FTFont/FTBufferFont.cpp +@@ -230,11 +230,11 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len, + int width, height, texWidth, texHeight; + int cacheIndex = -1; + bool inCache = false; + + // Protect blending functions, GL_TEXTURE_2D and optionally GL_BLEND +- glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_ENV_MODE); ++ glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT); + + // Protect glPixelStorei() calls + glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + + if(FTLibrary::Instance().GetLegacyOpenGLStateSet()) +diff --git c/src/FTFont/FTTextureFont.cpp i/src/FTFont/FTTextureFont.cpp +index 97e876876e12..a5145cf05f53 100644 +--- c/src/FTFont/FTTextureFont.cpp ++++ i/src/FTFont/FTTextureFont.cpp +@@ -239,11 +239,11 @@ template + inline FTPoint FTTextureFontImpl::RenderI(const T* string, const int len, + FTPoint position, FTPoint spacing, + int renderMode) + { + // Protect GL_TEXTURE_2D and optionally GL_BLEND +- glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TEXTURE_ENV_MODE); ++ glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TEXTURE_BIT); + + if(FTLibrary::Instance().GetLegacyOpenGLStateSet()) + { + glEnable(GL_BLEND); + /* diff --git a/graphics/ftgl/files/autoconf.patch b/graphics/ftgl/files/autoconf.patch new file mode 100644 index 0000000000000..a7d57e11466f8 --- /dev/null +++ b/graphics/ftgl/files/autoconf.patch @@ -0,0 +1,56 @@ +diff --git c/m4/gl.m4 i/m4/gl.m4 +index 4a1bc4886c35..a4c789f873b6 100644 +--- c/m4/gl.m4 ++++ i/m4/gl.m4 +@@ -5,15 +5,15 @@ AC_DEFUN([FTGL_CHECK_GL], + [dnl + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PATH_X]) + AC_REQUIRE([AC_PATH_XTRA]) + +-AC_ARG_WITH([--with-gl-inc], ++AC_ARG_WITH([gl-inc], + AC_HELP_STRING([--with-gl-inc=DIR],[Directory where GL/gl.h is installed])) +-AC_ARG_WITH([--with-gl-lib], ++AC_ARG_WITH([gl-lib], + AC_HELP_STRING([--with-gl-lib=DIR],[Directory where OpenGL libraries are installed])) +-AC_ARG_WITH([--with-glu-lib], ++AC_ARG_WITH([glu-lib], + AC_HELP_STRING([--with-glu-lib=DIR],[Directory where OpenGL GLU library is installed])) + + AC_LANG_SAVE + AC_LANG_C + +@@ -48,11 +48,11 @@ FRAMEWORK_OPENGL="" + PRELIBS="$LIBS" + LIBS="$LIBS -Xlinker -framework -Xlinker OpenGL" + # -Xlinker is used because libtool is busted prior to 1.6 wrt frameworks + AC_TRY_LINK([#include ], [glBegin(GL_POINTS)], + [GL_DYLIB="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" +- FRAMEWORK_OPENGL="-Xlinker -framework -Xlinker OpenGL -dylib_file $GL_DYLIB: $GL_DYLIB" ++ FRAMEWORK_OPENGL="-Xlinker -framework -Xlinker OpenGL -dylib_file $GL_DYLIB:$GL_DYLIB" + ac_cv_search_glBegin="$FRAMEWORK_OPENGL" + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + if test x"$FRAMEWORK_OPENGL" != "x"; then + with_gl_lib="$FRAMEWORK_OPENGL" +diff --git c/m4/glut.m4 i/m4/glut.m4 +index 4a2b0b87b020..450824962ce8 100644 +--- c/m4/glut.m4 ++++ i/m4/glut.m4 +@@ -6,13 +6,13 @@ AC_DEFUN([FTGL_CHECK_GLUT], + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PATH_X])dnl + AC_REQUIRE([AC_PATH_XTRA])dnl + AC_REQUIRE([FTGL_CHECK_GL])dnl + +-AC_ARG_WITH([--with-glut-inc], ++AC_ARG_WITH([glut-inc], + AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)])) +-AC_ARG_WITH([--with-glut-lib], ++AC_ARG_WITH([glut-lib], + AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)])) + + AC_LANG_SAVE + AC_LANG_C + diff --git a/graphics/ftgl/files/debian.patch b/graphics/ftgl/files/debian.patch new file mode 100644 index 0000000000000..8d79dd4f7030f --- /dev/null +++ b/graphics/ftgl/files/debian.patch @@ -0,0 +1,49 @@ +diff --git c/debian/changelog i/debian/changelog +index 6741f8e22ab2..bd533a7eecd1 100644 +--- c/debian/changelog ++++ i/debian/changelog +@@ -1,5 +1,36 @@ ++ftgl (2.4.0-2) unstable; urgency=medium ++ ++ * Install ftgl.pdf file again, the external problem generating PDF file ++ was fixed (#921779) ++ * d/patches: ++ - drop disable-pdf.patch ++ * Bump SHLIBVER to 2.4.0, there are new methods/functions in the ++ interface compared to older releases ++ ++ -- Manuel A. Fernandez Montecelo Tue, 26 Feb 2019 16:52:23 +0100 ++ ++ftgl (2.4.0-1) unstable; urgency=medium ++ ++ * New upstream release. ++ - Fixes problem with some applications's rendering of fonts by ++ reverting to old behaviour by default, but it will be revisited in ++ next upstream major releases (Closes: #914153) ++ * d/watch: Update pattern, some versions don't start with 'v' in the ++ tags of this repo ++ * d/patches: ++ - drop substitute-freetype-config.patch, applied upstream ++ - drop enable-docs.patch, applied upstream ++ - drop fix-pdf-generation, applied upstream ++ - drop patch-relibtoolize-prep.diff, applied upstream ++ - add disable-pdf.patch, problem generating PDF file ++ - add fix-doc-projects-eman2.patch, fix duplicated entry in doc ++ * Do not install ftgl.pdf file, it cannot be generated at the moment and ++ probably it's not very useful (HTML doc is still shipped) ++ ++ -- Manuel A. Fernandez Montecelo Fri, 08 Feb 2019 02:25:02 +0100 ++ + ftgl (2.3.0-3) unstable; urgency=medium + + [ IOhannes m zmölnig ] + * Copyright improvements: + - d/copyright: convert to standard format 1.0 +diff --git c/debian/watch i/debian/watch +index 34c3c9bd58f5..8fefb4596347 100644 +--- c/debian/watch ++++ i/debian/watch +@@ -1,2 +1,2 @@ + version=4 +-https://github.com/frankheckenbach/ftgl/tags .*/v(\d[\d\.]+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))|zip) ++https://github.com/frankheckenbach/ftgl/tags .*/v?(\d[\d\.]+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))|zip) diff --git a/graphics/ftgl/files/docs-meta.patch b/graphics/ftgl/files/docs-meta.patch new file mode 100644 index 0000000000000..ccb3f3019b8af --- /dev/null +++ b/graphics/ftgl/files/docs-meta.patch @@ -0,0 +1,141 @@ +diff --git c/ChangeLog i/ChangeLog +index 42fef90bc716..0bb44b8d53cd 100644 +--- c/ChangeLog ++++ i/ChangeLog +@@ -1,5 +1,20 @@ ++2019-05-24 23:57 Frank Heckenbach ++ ++ * src/FTFont/FTBufferFont.cpp, src/FTFont/FTTextureFont.cpp: ++ GL_TEXTURE_ENV_MODE is not valid mask for glPushAttrib. ++ Use GL_TEXTURE_BIT instead to avoid leaking texture env mode. ++ (reported by Eddie-cz, https://github.com/frankheckenbach/ftgl/issues/3) ++ ++2019-02-23 16:41 Frank Heckenbach ++ ++ * ftgl-release: new script ++ ++2019-02-08 00:44 Manuel A. Fernandez Montecelo ++ ++ * docs/projects_using_ftgl.txt: fix duplicated entry in doc ++ + 2019-02-07 22:35 Frank Heckenbach + + * NEWS, configure.ac, ppa_upload.sh, msvc/config.h, CMakeLists.txt: + * Mark package as being version 2.4.0. + +diff --git c/docs/projects_using_ftgl.txt i/docs/projects_using_ftgl.txt +index 0b756a898316..2066350de323 100644 +--- c/docs/projects_using_ftgl.txt ++++ i/docs/projects_using_ftgl.txt +@@ -152,11 +152,11 @@ Projects are listed in alphabetical order. + \subsection duel Duel + + Duel (http://www.personal.rdg.ac.uk/~sir03me/play/code.html) is a small + overhead perspective spaceship game. + +-\subsection emptyclip EMAN2 ++\subsection eman2 EMAN2 + + EMAN2 (http://blake.bcm.tmc.edu/eman/eman2/) is a suite of + scientific image processing tools aimed primarily at the + transmission electron microscopy community. + +diff --git c/ftgl-release i/ftgl-release +new file mode 100644 +index 000000000000..0ca4d09abd44 +--- /dev/null ++++ i/ftgl-release +@@ -0,0 +1,93 @@ ++#!/bin/bash ++ ++# Set release number ++# ++# Copyright 2019 Frank Heckenbach ++# ++# This program is free software: you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation, either version 3 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set -e ++ ++die () ++{ ++ echo "$*" >&2 ++ exit 1 ++} ++ ++[ "$#" = 2 ] || die "Usage: $(basename "$0") version description" ++egrep -q "^[0-9]+.[0-9]+.[0-9]+$" <<< "$1" || die "invalid version format (x.y.z)" ++ ++[ "$CHANGELOG_NAME" ] || die "Please set CHANGELOG_NAME" ++ ++[ -e src/FTLibrary.cpp ] || die "This script must be invoked in the main FTGL source directory." ++ ++description="$2" ++new="$1" ++major="${new%%.*}" ++minor="${new#*.}" ++micro="${minor#*.}" ++minor="${minor%%.*}" ++ ++prev="$(sed -En '/.* Release ([0-9]+.[0-9]+.[0-9]+)[ -]*$/{s//\1/p;q;}' NEWS)" ++pmajor="${prev%%.*}" ++pminor="${prev#*.}" ++pmicro="${pminor#*.}" ++pminor="${pminor%%.*}" ++ ++[[ "$((major != pmajor ? major > pmajor : ++ minor != pminor ? minor > pminor : ++ micro > pmicro))" -eq 1 ]] || die "new version must be greater than old version ($prev)" ++ ++! fgrep "version $new." ChangeLog || die "new version already mentioned in ChangeLog" ++ ++[ -z "$(git status --porcelain)" ] || die "Please commit previous changes first." ++ ++sed -Ei "s/(AC_INIT\(FTGL, )[0-9]+.[0-9]+.[0-9]+(, )/\1$new\2/; ++ s/(LT_MAJOR=\")[0-9]+(\")/\1$major\2/; ++ s/(LT_MINOR=\")[0-9]+(\")/\1$minor\2/; ++ s/(LT_MICRO=\")[0-9]+(\")/\1$micro\2/" configure.ac ++ ++sed -Ei "s/(SET\(VERSION_SERIES )[0-9]+(\))/\1$major\2/; ++ s/(SET\(VERSION_MAJOR )[0-9]+(\))/\1$minor\2/; ++ s/(SET\(VERSION_MINOR )[0-9]+(\))/\1$micro\2/" CMakeLists.txt ++ ++sed -Ei "s/(VERSIONNBR=)[0-9]+.[0-9]+.[0-9]+/\1$new/" ppa_upload.sh ++ ++sed -Ei "s/(#define PACKAGE_VERSION \")[0-9]+.[0-9]+.[0-9]+(\")/\1$new\2/" msvc/config.h ++ ++sed -Ei "s/(SHLIBVER := ).*$/\1$new/" debian/rules ++ ++sed -i "1i\\ ++$(date +"%F %H:%M") $CHANGELOG_NAME\\ ++\\ ++ * NEWS, configure.ac, CMakeLists.txt, ppa_upload.sh, msvc/config.h, debian/rules:\\ ++ * Mark package as being version $new.\\ ++ ++" ChangeLog ++ ++sed -i "0,/--- .* Release /{/--- .* Release /i\\ ++--- $(date +"%F") Release $new ---\\ ++----------------------------------------------------------------------\\ ++\\ ++ * ${description//\n/\n * }\\ ++\\ ++---------------------------------------------------------------------- ++;}" NEWS ++ ++PAGER= git diff ++git add -A ++git commit -m "$description" ++ ++echo ++echo "*** New release number set; now push and create release tag." diff --git a/graphics/ftgl/files/dylib_file.patch b/graphics/ftgl/files/dylib_file.patch deleted file mode 100644 index 3485305ec671e..0000000000000 --- a/graphics/ftgl/files/dylib_file.patch +++ /dev/null @@ -1,22 +0,0 @@ -Use correct syntax for the -dylib_file flag (no space after colon). -Fixes configure failure on macOS Big Sur and later: - -configure: error: GL library could not be found, please specify its location with --with-gl-lib. - -config.log contains: - -configure:17551: /usr/bin/clang -o conftest -pipe -Os -DGL_SILENCE_DEPRECATION -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 conftest.c -Xlinker -framework -Xlinker OpenGL -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib >&5 -clang: error: no such file or directory: '/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' - -https://github.com/frankheckenbach/ftgl/pull/14 ---- m4/gl.m4.orig 2019-02-07 15:39:58.000000000 -0600 -+++ m4/gl.m4 2021-02-10 23:23:19.000000000 -0600 -@@ -50,7 +50,7 @@ - # -Xlinker is used because libtool is busted prior to 1.6 wrt frameworks - AC_TRY_LINK([#include ], [glBegin(GL_POINTS)], - [GL_DYLIB="/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib" -- FRAMEWORK_OPENGL="-Xlinker -framework -Xlinker OpenGL -dylib_file $GL_DYLIB: $GL_DYLIB" -+ FRAMEWORK_OPENGL="-Xlinker -framework -Xlinker OpenGL -dylib_file $GL_DYLIB:$GL_DYLIB" - ac_cv_search_glBegin="$FRAMEWORK_OPENGL" - AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) diff --git a/graphics/ftgl/files/float-functions.patch b/graphics/ftgl/files/float-functions.patch new file mode 100644 index 0000000000000..fd3462f687e35 --- /dev/null +++ b/graphics/ftgl/files/float-functions.patch @@ -0,0 +1,78 @@ +diff --git c/src/FTGL/FTLayout.h i/src/FTGL/FTLayout.h +index b2ce0a7ceb0a..b29a2434cd88 100644 +--- c/src/FTGL/FTLayout.h ++++ i/src/FTGL/FTLayout.h +@@ -166,10 +166,37 @@ FTGL_EXPORT void ftglDestroyLayout(FTGLlayout* layout); + * left near and upper right far 3D coordinates will be stored. + */ + FTGL_EXPORT void ftglGetLayoutBBox(FTGLlayout *layout, const char* string, + float bounds[6]); + ++/** ++ * Get the height box for a string. ++ * ++ * @param layout An FTGLlayout* object. ++ * @param string A char buffer ++ * @return The height of the layout ++ */ ++FTGL_EXPORT float ftglGetLayoutHeight(FTGLlayout *layout, const char* string); ++ ++/** ++ * Get the width box for a string. ++ * ++ * @param layout An FTGLlayout* object. ++ * @param string A char buffer ++ * @return The width of the layout ++ */ ++FTGL_EXPORT float ftglGetLayoutWidth(FTGLlayout *layout, const char* string); ++ ++/** ++ * Get the depth box for a string. ++ * ++ * @param laymout An FTGLlayout* object. ++ * @param string A char buffer ++ * @return The depth of the layout ++ */ ++FTGL_EXPORT float ftglGetLayoutDepth(FTGLlayout *layout, const char* string); ++ + /** + * Render a string of characters. + * + * @param layout An FTGLlayout* object. + * @param string Char string to be output. +diff --git c/src/FTLayout/FTLayoutGlue.cpp i/src/FTLayout/FTLayoutGlue.cpp +index 5295347edb06..cb526012a94b 100644 +--- c/src/FTLayout/FTLayoutGlue.cpp ++++ i/src/FTLayout/FTLayoutGlue.cpp +@@ -86,10 +86,31 @@ void ftglGetLayoutBBox(FTGLlayout *l, const char * s, float c[6]) + FTPoint lower = ret.Lower(), upper = ret.Upper(); + c[0] = lower.Xf(); c[1] = lower.Yf(); c[2] = lower.Zf(); + c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf(); + } + ++float ftglGetLayoutHeight(FTGLlayout *l, const char *s) ++{ ++ FTBBox ret = _ftglGetLayoutBBox(l, s); ++ FTPoint lower = ret.Lower(), upper = ret.Upper(); ++ return upper.Yf() - lower.Yf(); ++} ++ ++float ftglGetLayoutWidth(FTGLlayout *l, const char *s) ++{ ++ FTBBox ret = _ftglGetLayoutBBox(l, s); ++ FTPoint lower = ret.Lower(), upper = ret.Upper(); ++ return upper.Xf() - lower.Xf(); ++} ++ ++float ftglGetLayoutDepth(FTGLlayout *l, const char *s) ++{ ++ FTBBox ret = _ftglGetLayoutBBox(l, s); ++ FTPoint lower = ret.Lower(), upper = ret.Upper(); ++ return upper.Zf() - lower.Zf(); ++} ++ + // virtual void FTLayout::Render(const char* string, int renderMode); + C_FUN(void, ftglRenderLayout, (FTGLlayout *l, const char *s, int r), + return, Render, (s, -1, FTPoint(), r)); + + // FT_Error FTLayout::Error() const; diff --git a/graphics/ftgl/files/fontdemo.patch b/graphics/ftgl/files/fontdemo.patch new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/graphics/ftgl/files/freetype2-13-3-type-error.patch b/graphics/ftgl/files/freetype2-13-3-type-error.patch new file mode 100644 index 0000000000000..e673ff5a8b9c7 --- /dev/null +++ b/graphics/ftgl/files/freetype2-13-3-type-error.patch @@ -0,0 +1,51 @@ +diff --git c/src/FTContour.cpp i/src/FTContour.cpp +index c668d32ec3bf..ef13576c2bee 100644 +--- c/src/FTContour.cpp ++++ i/src/FTContour.cpp +@@ -172,11 +172,11 @@ void FTContour::SetParity(int parity) + AddOutsetPoint(vOutset); + } + } + + +-FTContour::FTContour(FT_Vector* contour, char* tags, unsigned int n) ++FTContour::FTContour(FT_Vector* contour, unsigned char* tags, unsigned int n) + { + FTPoint prev, cur(contour[(n - 1) % n]), next(contour[0]); + double olddir, dir = atan2((next - cur).Y(), (next - cur).X()); + double angle = 0.0; + +diff --git c/src/FTContour.h i/src/FTContour.h +index d2d187cf41a4..dc64e3a64495 100644 +--- c/src/FTContour.h ++++ i/src/FTContour.h +@@ -50,11 +50,11 @@ class FTContour + * + * @param contour + * @param pointTags + * @param numberOfPoints + */ +- FTContour(FT_Vector* contour, char* pointTags, unsigned int numberOfPoints); ++ FTContour(FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints); + + /** + * Destructor + */ + ~FTContour() +diff --git c/src/FTVectoriser.cpp i/src/FTVectoriser.cpp +index 26e7da880acd..53d738ef9489 100644 +--- c/src/FTVectoriser.cpp ++++ i/src/FTVectoriser.cpp +@@ -166,11 +166,11 @@ void FTVectoriser::ProcessContours() + contourList = new FTContour*[ftContourCount]; + + for(int i = 0; i < ftContourCount; ++i) + { + FT_Vector* pointList = &outline.points[startIndex]; +- char* tagList = &outline.tags[startIndex]; ++ unsigned char* tagList = &outline.tags[startIndex]; + + endIndex = outline.contours[i]; + contourLength = (endIndex - startIndex) + 1; + + FTContour* contour = new FTContour(pointList, tagList, contourLength); diff --git a/graphics/ftgl/files/src_CMakeLists-remove-FTLibrary.patch b/graphics/ftgl/files/src_CMakeLists-remove-FTLibrary.patch new file mode 100644 index 0000000000000..f6832a780f65e --- /dev/null +++ b/graphics/ftgl/files/src_CMakeLists-remove-FTLibrary.patch @@ -0,0 +1,16 @@ +diff --git c/src/CMakeLists.txt i/src/CMakeLists.txt +index 693e49f1f9b6..b0f26f68aff0 100644 +--- c/src/CMakeLists.txt ++++ i/src/CMakeLists.txt +@@ -24,11 +24,10 @@ SET(libftgl_la_SOURCES + FTGL.cpp + FTGlyphContainer.cpp + FTGlyphContainer.h + FTInternals.h + FTLibrary.cpp +- FTLibrary.h + FTList.h + FTPoint.cpp + FTSize.cpp + FTSize.h + FTVector.h