Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add freetype build for LWJGL bindings #5

Merged
merged 9 commits into from
Jul 14, 2024
35 changes: 35 additions & 0 deletions ci_build_android.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,38 @@ if [ "$SKIP_LIBFFI" != "1" ]; then
cp libffi/$NDK_TARGET-linux-android$NDK_SUFFIX/.libs/libffi.a $LWJGL_NATIVE/
fi

if [ "$SKIP_FREETYPE" != "1" ]; then
#!/bin/bash
export BUILD_FREETYPE_VERSION=2.13.2
wget https://downloads.sourceforge.net/project/freetype/freetype2/$BUILD_FREETYPE_VERSION/freetype-$BUILD_FREETYPE_VERSION.tar.gz
tar xf freetype-$BUILD_FREETYPE_VERSION.tar.gz
rm freetype-$BUILD_FREETYPE_VERSION.tar.gz
cd freetype-$BUILD_FREETYPE_VERSION

export CC=$NDK_TARGET-linux-android${NDK_SUFFIX}21-clang

./configure \
--host=$TARGET \
--prefix=`pwd`/build_android-$LWJGL_BUILD_ARCH \
--without-zlib \
--with-brotli=no \
--with-bzip2=no \
--with-png=no \
--with-harfbuzz=no \
--enable-static=no \
--enable-shared=yes

make -j4
make install
llvm-strip ./build_android-$LWJGL_BUILD_ARCH/lib/libfreetype.so

cd ..
cp freetype-$BUILD_FREETYPE_VERSION/build_android-$LWJGL_BUILD_ARCH/lib/libfreetype.so $LWJGL_NATIVE/
rm -rf freetype-$BUILD_FREETYPE_VERSION
unset BUILD_FREETYPE_VERSION
unset CC
fi

# Download libraries
POJAV_NATIVES="https://github.com/PojavLauncherTeam/PojavLauncher/raw/v3_openjdk/app_pojavlauncher/src/main/jniLibs/$NDK_ABI"
wget -nc $POJAV_NATIVES/libopenal.so -P $LWJGL_NATIVE/openal
Expand Down Expand Up @@ -97,6 +129,9 @@ yes | ant -Dplatform.linux=true \
rm -rf bin/out; mkdir bin/out
find $LWJGL_NATIVE -name 'liblwjgl*.so' -exec cp {} bin/out/ \;
cp $LWJGL_NATIVE/shaderc/libshaderc.so bin/out/
if [ -e "$LWJGL_NATIVE/libfreetype.so" ]; then
cp $LWJGL_NATIVE/libfreetype.so bin/out/
fi

# Cleanup unused output jar files
find bin/RELEASE \( -name '*-natives-*' -o -name '*-sources.jar' \) -delete
6 changes: 6 additions & 0 deletions ci_build_ios.bash
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ yes | ant -Dplatform.macos=true \
rm -rf bin/out; mkdir bin/out
find $LWJGL_NATIVE -name 'liblwjgl*.dylib' -exec cp {} bin/out/ \;
cp $LWJGL_NATIVE/shaderc/libshaderc.dylib bin/out/
vtool -arch arm64 -set-build-version 2 14.0 16.0 -replace -output bin/out/libfreetype.dylib $LWJGL_NATIVE/freetype/libfreetype.dylib
install_name_tool \
-change /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation \
-change /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics \
-change /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText /System/Library/Frameworks/CoreText.framework/CoreText \
bin/out/libfreetype.dylib

# Cleanup unused output jar files
find bin/RELEASE \( -name '*-natives-*' -o -name '*-sources.jar' \) -delete
Loading