aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ftgl
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ftgl
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/ftgl')
-rw-r--r--vcpkg/ports/ftgl/02_enable-cpp11-std.patch15
-rw-r--r--vcpkg/ports/ftgl/fix-cmake.diff12
-rw-r--r--vcpkg/ports/ftgl/fix-gl-flags.diff26
-rw-r--r--vcpkg/ports/ftgl/freetype-usage.diff56
-rw-r--r--vcpkg/ports/ftgl/install-pkgconfig.diff30
-rw-r--r--vcpkg/ports/ftgl/portfile.cmake41
-rw-r--r--vcpkg/ports/ftgl/vcpkg.json27
7 files changed, 207 insertions, 0 deletions
diff --git a/vcpkg/ports/ftgl/02_enable-cpp11-std.patch b/vcpkg/ports/ftgl/02_enable-cpp11-std.patch
new file mode 100644
index 0000000..5d91461
--- /dev/null
+++ b/vcpkg/ports/ftgl/02_enable-cpp11-std.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 718ae88..e53e0da 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,9 @@
+-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
++CMAKE_MINIMUM_REQUIRED(VERSION 3.21)
+
+ PROJECT(FTGL)
++set(CMAKE_CXX_STANDARD 11)
++set(CMAKE_CXX_STANDARD_REQUIRED ON)
++
+ SET(CMAKE_MODULE_PATH ${FTGL_SOURCE_DIR})
+
+ SET(VERSION_SERIES 2)
diff --git a/vcpkg/ports/ftgl/fix-cmake.diff b/vcpkg/ports/ftgl/fix-cmake.diff
new file mode 100644
index 0000000..93093e9
--- /dev/null
+++ b/vcpkg/ports/ftgl/fix-cmake.diff
@@ -0,0 +1,12 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 693e49f..b0f26f6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -26,7 +26,6 @@ SET(libftgl_la_SOURCES
+ FTGlyphContainer.h
+ FTInternals.h
+ FTLibrary.cpp
+- FTLibrary.h
+ FTList.h
+ FTPoint.cpp
+ FTSize.cpp
diff --git a/vcpkg/ports/ftgl/fix-gl-flags.diff b/vcpkg/ports/ftgl/fix-gl-flags.diff
new file mode 100644
index 0000000..9cbcda0
--- /dev/null
+++ b/vcpkg/ports/ftgl/fix-gl-flags.diff
@@ -0,0 +1,26 @@
+diff --git a/src/FTFont/FTBufferFont.cpp b/src/FTFont/FTBufferFont.cpp
+index ce04cf5..b330a3b 100644
+--- a/src/FTFont/FTBufferFont.cpp
++++ b/src/FTFont/FTBufferFont.cpp
+@@ -232,7 +232,7 @@ inline FTPoint FTBufferFontImpl::RenderI(const T* string, const int len,
+ 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);
+diff --git a/src/FTFont/FTTextureFont.cpp b/src/FTFont/FTTextureFont.cpp
+index 97e8768..a5145cf 100644
+--- a/src/FTFont/FTTextureFont.cpp
++++ b/src/FTFont/FTTextureFont.cpp
+@@ -241,7 +241,7 @@ inline FTPoint FTTextureFontImpl::RenderI(const T* string, const int len,
+ 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())
+ {
diff --git a/vcpkg/ports/ftgl/freetype-usage.diff b/vcpkg/ports/ftgl/freetype-usage.diff
new file mode 100644
index 0000000..4e3658d
--- /dev/null
+++ b/vcpkg/ports/ftgl/freetype-usage.diff
@@ -0,0 +1,56 @@
+--- a/src/FTVectoriser.h
++++ b/src/FTVectoriser.h
+@@ -296,7 +296,7 @@
+ /**
+ * The number of contours reported by Freetype
+ */
+- short ftContourCount;
++ unsigned short ftContourCount;
+
+ /**
+ * A flag indicating the tesselation rule for the glyph
+--- a/src/FTVectoriser.cpp
++++ b/src/FTVectoriser.cpp
+@@ -159,16 +159,16 @@
+
+ void FTVectoriser::ProcessContours()
+ {
+- short contourLength = 0;
+- short startIndex = 0;
+- short endIndex = 0;
++ unsigned short contourLength = 0;
++ unsigned short startIndex = 0;
++ unsigned short endIndex = 0;
+
+ 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;
+--- a/src/FTContour.h
++++ b/src/FTContour.h
+@@ -52,7 +52,7 @@
+ * @param pointTags
+ * @param numberOfPoints
+ */
+- FTContour(FT_Vector* contour, char* pointTags, unsigned int numberOfPoints);
++ FTContour(FT_Vector* contour, unsigned char* pointTags, unsigned int numberOfPoints);
+
+ /**
+ * Destructor
+--- a/src/FTContour.cpp
++++ b/src/FTContour.cpp
+@@ -174,7 +174,7 @@
+ }
+
+
+-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());
diff --git a/vcpkg/ports/ftgl/install-pkgconfig.diff b/vcpkg/ports/ftgl/install-pkgconfig.diff
new file mode 100644
index 0000000..7044099
--- /dev/null
+++ b/vcpkg/ports/ftgl/install-pkgconfig.diff
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 303fcae..cdcf2c9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -74,3 +74,12 @@ 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 a/ftgl.pc.cmake b/ftgl.pc.cmake
+new file mode 100644
+index 0000000..d242667
+--- /dev/null
++++ b/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/vcpkg/ports/ftgl/portfile.cmake b/vcpkg/ports/ftgl/portfile.cmake
new file mode 100644
index 0000000..cd6a2c1
--- /dev/null
+++ b/vcpkg/ports/ftgl/portfile.cmake
@@ -0,0 +1,41 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO frankheckenbach/ftgl
+ REF v${VERSION}
+ SHA512 5a0d05dbb32952e5aa81d2537d604192ca19710cd57289ae056acc5e3ae6d403d7f0ffc8cf6c1aada6c3c23a8df4a8d0eabb81433036ade810bca1894fdfde54
+ HEAD_REF master
+ PATCHES
+ fix-cmake.diff # https://github.com/frankheckenbach/ftgl/commit/835f2ba7911a6c15a1a314d5e3267fa089b5a319
+ fix-gl-flags.diff # https://github.com/frankheckenbach/ftgl/commit/778b8f21ba0b71289aef37e3422d008456445971
+ install-pkgconfig.diff # https://github.com/frankheckenbach/ftgl/commit/8763fa4e413e015e46376697fb8ab59ed31c2ff5
+ 02_enable-cpp11-std.patch
+ freetype-usage.diff
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCMAKE_DISABLE_FIND_PACKAGE_CxxTest=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
+)
+
+vcpkg_cmake_install()
+if (VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
+else ()
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake)
+endif()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string(
+ "${CURRENT_PACKAGES_DIR}/include/FTGL/ftgl.h"
+ "ifdef FTGL_LIBRARY_STATIC"
+ "if 1//ifdef FTGL_LIBRARY_STATIC"
+ )
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/ftgl/vcpkg.json b/vcpkg/ports/ftgl/vcpkg.json
new file mode 100644
index 0000000..371d00e
--- /dev/null
+++ b/vcpkg/ports/ftgl/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "ftgl",
+ "version": "2.4.0",
+ "port-version": 6,
+ "description": [
+ "FTGL is a free open source library to enable developers to use arbitrary fonts in their OpenGL (www.opengl.org) applications.",
+ "Unlike other OpenGL font libraries FTGL uses standard font file formats so doesn't need a preprocessing step to convert the high quality font data into a lesser quality, proprietary format.",
+ "FTGL uses the Freetype (www.freetype.org) font library to open and 'decode' the fonts. It then takes that output and stores it in a format most efficient for OpenGL rendering."
+ ],
+ "homepage": "https://github.com/frankheckenbach/ftgl",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "freetype",
+ "default-features": false
+ },
+ "opengl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}