diff --git a/switch/ftgl/PKGBUILD b/switch/ftgl/PKGBUILD new file mode 100644 index 00000000..185509a1 --- /dev/null +++ b/switch/ftgl/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: Rhys Koedijk + +pkgbasename=ftgl +pkgname=switch-$pkgbasename +pkgver=2.4.0 +pkgrel=1 +pkgdesc='FTGL is a free cross-platform Open Source C++ library that uses Freetype2 to simplify rendering fonts in OpenGL applications' +arch=('any') +url='https://github.com/frankheckenbach/ftgl/' +license=('MIT') +options=(!strip libtool staticlibs) +source=("${url}/archive/v${pkgver}.tar.gz") +sha256sums=('aa97da1c3442a8fd3941037655df18016d70b5266381c81d81e8b5335f196ea8') +depends=('switch-freetype' 'switch-glu' 'switch-mesa') +makedepends=('switch-pkg-config' 'devkitpro-pkgbuild-helpers') +groups=('switch-portlibs') + +prepare() { + cd ${pkgbasename}-${pkgver} + patch -Np1 -i "${startdir}/${pkgbasename}-2.4.0-install_pkgconfig.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-2.4.0-fix_libftgl_la_sources.patch" +} + +build() { + cd ${pkgbasename}-${pkgver} + + source /opt/devkitpro/switchvars.sh + + cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/switch.cmake \ + -DCMAKE_INSTALL_PREFIX=$PORTLIBS_PREFIX \ + -DCMAKE_C_FLAGS="$CFLAGS $CPPFLAGS" \ + -DCMAKE_CXX_FLAGS="$CFLAGS" \ + -DCMAKE_AR="/opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc-ar" \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DOPENGL_USE_EGL:BOOL=ON \ + -DOPENGL_opengl_LIBRARY="${PORTLIBS_PREFIX}/lib" \ + . + + make +} + +package() { + cd ${pkgbasename}-${pkgver} + + make DESTDIR="$pkgdir" install + + install -Dm644 COPYING "$pkgdir"/opt/devkitpro/portlibs/switch/licenses/$pkgname/COPYING +} diff --git a/switch/ftgl/ftgl-2.4.0-fix_libftgl_la_sources.patch b/switch/ftgl/ftgl-2.4.0-fix_libftgl_la_sources.patch new file mode 100644 index 00000000..1c97b040 --- /dev/null +++ b/switch/ftgl/ftgl-2.4.0-fix_libftgl_la_sources.patch @@ -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 \ No newline at end of file diff --git a/switch/ftgl/ftgl-2.4.0-install_pkgconfig.patch b/switch/ftgl/ftgl-2.4.0-install_pkgconfig.patch new file mode 100644 index 00000000..b1bbfcff --- /dev/null +++ b/switch/ftgl/ftgl-2.4.0-install_pkgconfig.patch @@ -0,0 +1,29 @@ +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