(macOS) Added the ICU library as a dependency

This commit is contained in:
Leon Styhre 2024-08-08 21:53:13 +02:00
parent 6ad96ba252
commit 2bbcdd375c
4 changed files with 73 additions and 24 deletions

View file

@ -476,6 +476,7 @@ if(APPLE)
${CMAKE_CURRENT_SOURCE_DIR}/external/gettext/gettext-runtime/intl ${CMAKE_CURRENT_SOURCE_DIR}/external/gettext/gettext-runtime/intl
${CMAKE_CURRENT_SOURCE_DIR}/external/libgit2/include ${CMAKE_CURRENT_SOURCE_DIR}/external/libgit2/include
${CMAKE_CURRENT_SOURCE_DIR}/external/harfbuzz/src ${CMAKE_CURRENT_SOURCE_DIR}/external/harfbuzz/src
${CMAKE_CURRENT_SOURCE_DIR}/external/icu/icu4c/source/common
${CMAKE_CURRENT_SOURCE_DIR}/external/pugixml/src ${CMAKE_CURRENT_SOURCE_DIR}/external/pugixml/src
${CMAKE_CURRENT_SOURCE_DIR}/external/SDL) ${CMAKE_CURRENT_SOURCE_DIR}/external/SDL)
elseif(WIN32) elseif(WIN32)
@ -554,6 +555,9 @@ if(APPLE)
${PROJECT_SOURCE_DIR}/libfreetype.6.dylib ${PROJECT_SOURCE_DIR}/libfreetype.6.dylib
${PROJECT_SOURCE_DIR}/libgit2.1.7.dylib ${PROJECT_SOURCE_DIR}/libgit2.1.7.dylib
${PROJECT_SOURCE_DIR}/libharfbuzz.dylib ${PROJECT_SOURCE_DIR}/libharfbuzz.dylib
${PROJECT_SOURCE_DIR}/libicudata.75.dylib
${PROJECT_SOURCE_DIR}/libicui18n.75.dylib
${PROJECT_SOURCE_DIR}/libicuuc.75.dylib
${PROJECT_SOURCE_DIR}/libintl.8.dylib ${PROJECT_SOURCE_DIR}/libintl.8.dylib
${PROJECT_SOURCE_DIR}/libpugixml.a ${PROJECT_SOURCE_DIR}/libpugixml.a
${PROJECT_SOURCE_DIR}/libSDL2-2.0.0.dylib) ${PROJECT_SOURCE_DIR}/libSDL2-2.0.0.dylib)

View file

@ -241,6 +241,12 @@ elseif(APPLE)
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libharfbuzz.dylib install(FILES ${CMAKE_SOURCE_DIR}/libharfbuzz.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libicudata.75.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libicui18n.75.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libicuuc.75.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libintl.8.dylib install(FILES ${CMAKE_SOURCE_DIR}/libintl.8.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libjpeg.62.dylib install(FILES ${CMAKE_SOURCE_DIR}/libjpeg.62.dylib

View file

@ -29,10 +29,11 @@ if [ ! -d FFmpeg ]; then
exit exit
fi fi
echo "Building all dependencies in the ./external directory...\n" echo "Building all dependencies in the ./external directory..."
export PKG_CONFIG_PATH=$(pwd)/../local_install/lib/pkgconfig export PKG_CONFIG_PATH=$(pwd)/../local_install/lib/pkgconfig
echo
echo "Building libiconv" echo "Building libiconv"
if [ ! -d libiconv ]; then if [ ! -d libiconv ]; then
@ -48,6 +49,7 @@ make -j${JOBS}
make install make install
cd .. cd ..
echo
echo "Building gettext" echo "Building gettext"
if [ ! -d gettext ]; then if [ ! -d gettext ]; then
@ -68,6 +70,31 @@ cd ../../../
make install make install
cd .. cd ..
echo
echo "Building ICU"
if [ ! -d icu/icu4c ]; then
echo "icu/icu4c directory is missing, aborting."
exit
fi
cd icu/icu4c/source
./configure --disable-extras --disable-icuio --disable-samples --disable-tests
make clean
make -j${JOBS}
cd lib
install_name_tool -id "@rpath/libicudata.75.dylib" libicudata.75.1.dylib
install_name_tool -id "@rpath/libicui18n.75.dylib" libicui18n.75.1.dylib
install_name_tool -change $(otool -L libicui18n.75.1.dylib | grep libicuuc | cut -f1 -d' ' | sed 's/[[:blank:]]//g') @rpath/libicuuc.75.dylib libicui18n.75.1.dylib
install_name_tool -change $(otool -L libicui18n.75.1.dylib | grep libicudata | cut -f1 -d' ' | sed 's/[[:blank:]]//g') @rpath/libicudata.75.dylib libicui18n.75.1.dylib
install_name_tool -id "@rpath/libicuuc.75.dylib" libicuuc.75.1.dylib
install_name_tool -change $(otool -L libicuuc.75.1.dylib | grep libicudata | cut -f1 -d' ' | sed 's/[[:blank:]]//g') @rpath/libicudata.75.dylib libicuuc.75.1.dylib
cp libicudata.75.1.dylib ../../../../../libicudata.75.dylib
cp libicui18n.75.1.dylib ../../../../../libicui18n.75.dylib
cp libicuuc.75.1.dylib ../../../../../libicuuc.75.dylib
cd ../../../../
echo
echo "Building libpng" echo "Building libpng"
if [ ! -d libpng ]; then if [ ! -d libpng ]; then
@ -88,7 +115,7 @@ make install
cd .. cd ..
echo echo
echo "\nBuilding HarfBuzz" echo "Building HarfBuzz"
if [ ! -d harfbuzz/build ]; then if [ ! -d harfbuzz/build ]; then
echo "harfbuzz directory is missing, aborting." echo "harfbuzz directory is missing, aborting."
@ -104,7 +131,7 @@ cp libharfbuzz.dylib ../../../
cd ../.. cd ../..
echo echo
echo "\nBuilding FreeType" echo "Building FreeType"
if [ ! -d freetype/build ]; then if [ ! -d freetype/build ]; then
echo "FreeType directory is missing, aborting." echo "FreeType directory is missing, aborting."
@ -217,7 +244,7 @@ cp cpp/libpoppler-cpp.0.11.0.dylib ../../../libpoppler-cpp.0.dylib
cd ../.. cd ../..
echo echo
echo "\nBuilding FreeImage" echo "Building FreeImage"
if [ ! -d freeimage/FreeImage ]; then if [ ! -d freeimage/FreeImage ]; then
echo "FreeImage directory is missing, aborting." echo "FreeImage directory is missing, aborting."
@ -231,7 +258,7 @@ cp libfreeimage.a ../../..
cd ../.. cd ../..
echo echo
echo "\nBuilding libgit2" echo "Building libgit2"
if [ ! -d libgit2/build ]; then if [ ! -d libgit2/build ]; then
echo "libgit2 directory is missing, aborting." echo "libgit2 directory is missing, aborting."
@ -247,7 +274,7 @@ cp libgit2.1.7.1.dylib ../../../libgit2.1.7.dylib
cd ../.. cd ../..
echo echo
echo "\nBuilding pugixml" echo "Building pugixml"
if [ ! -d pugixml ]; then if [ ! -d pugixml ]; then
echo "pugixml directory is missing, aborting." echo "pugixml directory is missing, aborting."
@ -263,7 +290,7 @@ cp libpugixml.a ../..
cd .. cd ..
echo echo
echo "\nBuilding SDL" echo "Building SDL"
if [ ! -d SDL/build ]; then if [ ! -d SDL/build ]; then
echo "SDL directory is missing, aborting." echo "SDL directory is missing, aborting."
@ -279,7 +306,7 @@ cp libSDL2-2.0.0.dylib ../../..
cd ../.. cd ../..
echo echo
echo "\nBuilding libvpx" echo "Building libvpx"
if [ ! -d libvpx ]; then if [ ! -d libvpx ]; then
echo "libvpx directory is missing, aborting." echo "libvpx directory is missing, aborting."
@ -294,7 +321,7 @@ make install
cd .. cd ..
echo echo
echo "\nBuilding Ogg" echo "Building Ogg"
if [ ! -d ogg ]; then if [ ! -d ogg ]; then
echo "Ogg directory is missing, aborting." echo "Ogg directory is missing, aborting."
@ -310,7 +337,7 @@ make install
cd .. cd ..
echo echo
echo "\nBuilding Vorbis" echo "Building Vorbis"
if [ ! -d vorbis ]; then if [ ! -d vorbis ]; then
echo "Vorbis directory is missing, aborting." echo "Vorbis directory is missing, aborting."
@ -328,7 +355,7 @@ cp lib/libvorbis.0.4.9.dylib ../..
cd .. cd ..
echo echo
echo "\nBuilding Opus" echo "Building Opus"
if [ ! -d opus ]; then if [ ! -d opus ]; then
echo "Opus directory is missing, aborting." echo "Opus directory is missing, aborting."
@ -344,7 +371,7 @@ make install
cd .. cd ..
echo echo
echo "\nBuilding FFmpeg" echo "Building FFmpeg"
if [ ! -d FFmpeg ]; then if [ ! -d FFmpeg ]; then
echo "FFmpeg directory is missing, aborting." echo "FFmpeg directory is missing, aborting."

View file

@ -15,12 +15,13 @@ if [ ! -f .clang-format ]; then
exit exit
fi fi
echo "Setting up dependencies in the ./external directory...\n" echo "Setting up dependencies in the ./external directory..."
cd external cd external
rm -rf local_install rm -rf local_install
mkdir local_install mkdir local_install
echo
echo "Setting up libiconv" echo "Setting up libiconv"
rm -rf libiconv* rm -rf libiconv*
curl -LO https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz curl -LO https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz
@ -34,6 +35,7 @@ fi
mv libiconv-1.17 libiconv mv libiconv-1.17 libiconv
rm libiconv-1.17.tar.gz rm libiconv-1.17.tar.gz
echo
echo "Setting up gettext" echo "Setting up gettext"
rm -rf gettext* rm -rf gettext*
curl -LO https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz curl -LO https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz
@ -47,6 +49,16 @@ fi
mv gettext-0.22.5 gettext mv gettext-0.22.5 gettext
rm gettext-0.22.5.tar.gz rm gettext-0.22.5.tar.gz
echo
echo "Setting up ICU"
rm -rf icu
git clone -n --filter=tree:0 https://github.com/unicode-org/icu.git
cd icu
git sparse-checkout set --no-cone icu4c
git checkout release-75-1
cd ..
echo
echo "Setting up libpng" echo "Setting up libpng"
rm -rf libpng code rm -rf libpng code
git clone https://git.code.sf.net/p/libpng/code.git git clone https://git.code.sf.net/p/libpng/code.git
@ -62,7 +74,7 @@ git checkout v1.6.40
cd .. cd ..
echo echo
echo "\nSetting up HarfBuzz" echo "Setting up HarfBuzz"
rm -rf harfbuzz rm -rf harfbuzz
git clone https://github.com/harfbuzz/harfbuzz.git git clone https://github.com/harfbuzz/harfbuzz.git
@ -77,7 +89,7 @@ mkdir build
cd .. cd ..
echo echo
echo "\nSetting up FreeType" echo "Setting up FreeType"
rm -rf freetype rm -rf freetype
git clone https://github.com/freetype/freetype.git git clone https://github.com/freetype/freetype.git
@ -166,7 +178,7 @@ mkdir build
cd .. cd ..
echo echo
echo "\nSetting up FreeImage" echo "Setting up FreeImage"
rm -rf freeimage rm -rf freeimage
mkdir freeimage mkdir freeimage
cd freeimage cd freeimage
@ -282,7 +294,7 @@ fi
cd ../.. cd ../..
echo echo
echo "\nSetting up libgit2" echo "Setting up libgit2"
rm -rf libgit2 rm -rf libgit2
git clone https://github.com/libgit2/libgit2.git git clone https://github.com/libgit2/libgit2.git
@ -297,7 +309,7 @@ mkdir build
cd .. cd ..
echo echo
echo "\nSetting up pugixml" echo "Setting up pugixml"
rm -rf pugixml rm -rf pugixml
git clone https://github.com/zeux/pugixml.git git clone https://github.com/zeux/pugixml.git
@ -311,7 +323,7 @@ git checkout v1.13
cd .. cd ..
echo echo
echo "\nSetting up SDL" echo "Setting up SDL"
rm -rf SDL rm -rf SDL
git clone https://github.com/libsdl-org/SDL.git git clone https://github.com/libsdl-org/SDL.git
@ -327,7 +339,7 @@ mkdir build
cd .. cd ..
echo echo
echo "\nSetting up libvpx" echo "Setting up libvpx"
rm -rf libvpx rm -rf libvpx
git clone https://github.com/webmproject/libvpx.git git clone https://github.com/webmproject/libvpx.git
@ -341,7 +353,7 @@ git checkout v1.13.0
cd .. cd ..
echo echo
echo "\nSetting up Ogg" echo "Setting up Ogg"
rm -rf ogg rm -rf ogg
git clone https://github.com/xiph/ogg.git git clone https://github.com/xiph/ogg.git
@ -355,7 +367,7 @@ git checkout v1.3.5
cd .. cd ..
echo echo
echo "\nSetting up Vorbis" echo "Setting up Vorbis"
rm -rf vorbis rm -rf vorbis
git clone https://gitlab.xiph.org/xiph/vorbis.git git clone https://gitlab.xiph.org/xiph/vorbis.git
@ -369,7 +381,7 @@ git checkout v1.3.7
cd .. cd ..
echo echo
echo "\nSetting up Opus" echo "Setting up Opus"
rm -rf opus rm -rf opus
git clone https://gitlab.xiph.org/xiph/opus.git git clone https://gitlab.xiph.org/xiph/opus.git
@ -383,7 +395,7 @@ git checkout v1.3.1
cd .. cd ..
echo echo
echo "\nSetting up FFmpeg" echo "Setting up FFmpeg"
rm -rf FFmpeg rm -rf FFmpeg
git clone https://github.com/FFmpeg/FFmpeg.git git clone https://github.com/FFmpeg/FFmpeg.git