From d70fbedec266bfd0bb5b8e7f09796e546e5c7897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 15 Nov 2023 15:14:49 -0300 Subject: [PATCH] Fix macOS packaging issue. --- premake4.lua | 2 ++ premake5.lua | 3 +++ projects/macos/ecode/build.app.sh | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/premake4.lua b/premake4.lua index 1d6933ec2..9ef6d6a1f 100644 --- a/premake4.lua +++ b/premake4.lua @@ -894,6 +894,8 @@ end function set_macos_and_ios_config() if os.is_real("macosx") and ( is_xcode() or _OPTIONS["use-frameworks"] ) then libdirs { "/System/Library/Frameworks", "/Library/Frameworks" } + elseif os.is_real("macosx") then + libdirs { "/opt/homebrew/lib" } end if _OPTIONS["use-frameworks"] then diff --git a/premake5.lua b/premake5.lua index 8eb0d7014..5079f4d4d 100644 --- a/premake5.lua +++ b/premake5.lua @@ -693,6 +693,9 @@ function build_eepp( build_name ) filter { "system:macosx", "action:xcode* or options:use-frameworks" } libdirs { "/System/Library/Frameworks", "/Library/Frameworks" } + filter { "system:macosx", "not action:xcode*", "not options:use-frameworks" } + libdirs { "/opt/homebrew/lib" } + filter "system:windows" files { "src/eepp/system/platform/win/*.cpp" } files { "src/eepp/network/platform/win/*.cpp" } diff --git a/projects/macos/ecode/build.app.sh b/projects/macos/ecode/build.app.sh index df67260d6..6b473193d 100755 --- a/projects/macos/ecode/build.app.sh +++ b/projects/macos/ecode/build.app.sh @@ -1,5 +1,6 @@ #!/bin/sh SDL2_CONFIG=$(which sdl2-config) +rm -rf ../../../libs/macosx if [ -z $SDL2_CONFIG ]; then echo "Building using frameworks" ../make.sh config=release ecode || exit @@ -34,7 +35,8 @@ install_name_tool -change @rpath/libeepp.dylib @executable_path/libeepp.dylib ec else SDL2_LIB_PATH=$(sdl2-config --libs | awk '{ print $1 }' | cut -b 3-) cp $SDL2_LIB_PATH/libSDL2-2.0.0.dylib ecode.app/Contents/MacOS -install_name_tool -change $SDL2_LIB_PATH/libSDL2-2.0.0.dylib @executable_path/libSDL2-2.0.0.dylib ecode.app/Contents/MacOS/libeepp.dylib +SDL2_LIB_REAL_PATH=$(otool -L ecode.app/Contents/MacOS/libeepp.dylib | grep libSDL2 | awk '{ print $1 }') +install_name_tool -change $SDL2_LIB_REAL_PATH @executable_path/libSDL2-2.0.0.dylib ecode.app/Contents/MacOS/libeepp.dylib install_name_tool -change libeepp.dylib @executable_path/libeepp.dylib ecode.app/Contents/MacOS/ecode fi