diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e3574779..e6a9cbde8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -470,6 +470,7 @@ if(APPLE) ${CMAKE_CURRENT_SOURCE_DIR}/external/FFmpeg ${CMAKE_CURRENT_SOURCE_DIR}/external/freeimage/FreeImage/Source ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/include + ${CMAKE_CURRENT_SOURCE_DIR}/external/gettext/gettext-runtime/intl ${CMAKE_CURRENT_SOURCE_DIR}/external/libgit2/include ${CMAKE_CURRENT_SOURCE_DIR}/external/pugixml/src ${CMAKE_CURRENT_SOURCE_DIR}/external/SDL) @@ -541,6 +542,7 @@ if(APPLE) ${PROJECT_SOURCE_DIR}/libfreeimage.a ${PROJECT_SOURCE_DIR}/libfreetype.6.dylib ${PROJECT_SOURCE_DIR}/libgit2.1.7.dylib + ${PROJECT_SOURCE_DIR}/libintl.8.dylib ${PROJECT_SOURCE_DIR}/libpugixml.a ${PROJECT_SOURCE_DIR}/libSDL2-2.0.0.dylib) elseif(WIN32) diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index befea500f..2a333e781 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -236,6 +236,8 @@ elseif(APPLE) PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libgit2.1.7.dylib PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + install(FILES ${CMAKE_SOURCE_DIR}/libintl.8.dylib + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libjpeg.62.dylib PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libopenjp2.7.dylib diff --git a/locale/CMakeLists.txt b/locale/CMakeLists.txt index 24d333e6a..0c0985449 100644 --- a/locale/CMakeLists.txt +++ b/locale/CMakeLists.txt @@ -8,7 +8,11 @@ add_custom_target(locale ALL COMMENT "Compiling localization message catalogs") -find_program(MSGFMT_BINARY msgfmt) +if(APPLE) + set(MSGFMT_BINARY ${PROJECT_SOURCE_DIR}/external/local_install/bin/msgfmt) +else() + find_program(MSGFMT_BINARY msgfmt) +endif() if(NOT MSGFMT_BINARY) message (FATAL_ERROR "Couldn't find msgfmt binary") diff --git a/tools/macOS_dependencies_build.sh b/tools/macOS_dependencies_build.sh index 60a9e52da..b6a985172 100755 --- a/tools/macOS_dependencies_build.sh +++ b/tools/macOS_dependencies_build.sh @@ -33,6 +33,26 @@ echo "Building all dependencies in the ./external directory...\n" export PKG_CONFIG_PATH=$(pwd)/../local_install/lib/pkgconfig +echo "Building gettext" + +if [ ! -d gettext ]; then + echo "gettext directory is missing, aborting." + exit +fi + +cd gettext + +./configure --prefix=$(pwd)/../local_install +make clean +make -j${JOBS} + +cd gettext-runtime/intl/.libs +install_name_tool -id "@rpath/libintl.8.dylib" libintl.8.dylib +cp libintl.8.dylib ../../../../../ +cd ../../../ +make install +cd .. + echo "Building libpng" if [ ! -d libpng ]; then diff --git a/tools/macOS_dependencies_setup.sh b/tools/macOS_dependencies_setup.sh index cb04aef79..864e1499b 100755 --- a/tools/macOS_dependencies_setup.sh +++ b/tools/macOS_dependencies_setup.sh @@ -21,6 +21,19 @@ cd external rm -rf local_install mkdir local_install +echo "Setting up gettext" +rm -rf gettext* +curl -LO https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz +tar xvzf gettext-0.22.5.tar.gz + +if [ ! -d gettext-0.22.5 ]; then + echo "gettext directory is missing, aborting." + exit +fi + +mv gettext-0.22.5 gettext +rm gettext-0.22.5.tar.gz + echo "Setting up libpng" rm -rf libpng code git clone https://git.code.sf.net/p/libpng/code.git