From ae734603b961aec78eade8bea0dd44e6c0eee487 Mon Sep 17 00:00:00 2001 From: rmultan Date: Wed, 24 Jul 2024 22:10:18 +0200 Subject: [PATCH] Fix MacOS build & update INSTALL.md Fix build for Apple silicon Mac. Update INSTALL.md with relevant instructions. Signed-off-by: rmultan --- INSTALL.md | 8 +++++++- entitlements-mac-dev.plist | 8 ++++++++ scripts/build.sh | 10 +++++++--- scripts/get-dep-lib.sh | 4 ++-- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 entitlements-mac-dev.plist diff --git a/INSTALL.md b/INSTALL.md index 8332252b7..096899ce5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -367,7 +367,8 @@ preferred over Qt6. If you plan to deploy your build to an Apple Silicon Mac, you may have better results with Bluetooth connections if you install Qt5.15.13. If Qt5.15.13 is not available via the installer, you can download from https://download.qt.io/official_releases/qt/5.15/5.15.13 -and build using the usual configure, make, and make install. +and build using the usual configure, make, and make install. Qt is also available as Homebrew package + 3. now build Subsurface @@ -381,6 +382,11 @@ if you are building against Qt6 (still experimental) you can create a universal cd ~/src; bash subsurface/scripts/build.sh -build-with-qt6 -build-deps -fat-build ``` +4. Sign the package +``` +codesign --options runtime --keychain $HOME/Library/Keychains/login.keychain --sign - --deep --force --entitlements subsurface/build/entitlements-mac-dev.plist subsurface/build/Subsurface.app +``` + After the above is done, Subsurface.app will be available in the subsurface/build directory. You can run Subsurface with the command diff --git a/entitlements-mac-dev.plist b/entitlements-mac-dev.plist new file mode 100644 index 000000000..dd9efa952 --- /dev/null +++ b/entitlements-mac-dev.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.cs.disable-library-validation + + + \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index 0884a7b8d..292aa8e57 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -197,9 +197,9 @@ if [ "$PLATFORM" = Darwin ] ; then MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/ -DCMAKE_OSX_ARCHITECTURES='x86_64;arm64'" MAC_OPTS="-mmacosx-version-min=${BASESDK} -isysroot${SDKROOT}/MacOSX${BASESDK}.sdk -arch arm64 -arch x86_64" else - MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/" - MAC_OPTS="-mmacosx-version-min=${BASESDK} -isysroot${SDKROOT}/MacOSX${BASESDK}.sdk" ARCHS=$(uname -m) # crazy, I know, but $(arch) results in the incorrect 'i386' on an x86_64 Mac + MAC_CMAKE="-DCMAKE_OSX_DEPLOYMENT_TARGET=${BASESDK} -DCMAKE_OSX_SYSROOT=${SDKROOT}/MacOSX${BASESDK}.sdk/ -DCMAKE_OSX_ARCHITECTURES=$ARCHS" + MAC_OPTS="-mmacosx-version-min=${BASESDK} -isysroot${SDKROOT}/MacOSX${BASESDK}.sdk" fi # OpenSSL can't deal with multi arch build MAC_OPTS_OPENSSL="-mmacosx-version-min=${BASESDK} -isysroot${SDKROOT}/MacOSX${BASESDK}.sdk" @@ -381,7 +381,7 @@ if [[ $PLATFORM = Darwin && "$BUILD_DEPS" == "1" ]] ; then bash ./buildconf mkdir -p build cd build - CFLAGS="$MAC_OPTS" ../configure --prefix="$INSTALL_ROOT" --with-darwinssl \ + CFLAGS="$MAC_OPTS" ../configure --prefix="$INSTALL_ROOT" --with-openssl \ --disable-tftp --disable-ftp --disable-ldap --disable-ldaps --disable-imap --disable-pop3 --disable-smtp --disable-gopher --disable-smb --disable-rtsp make -j4 make install @@ -648,6 +648,10 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do if [ "$PLATFORM" = Darwin ] ; then rm -rf Subsurface.app rm -rf Subsurface-mobile.app + + if [ "$DEBUGRELEASE" = Debug ] ; then + cp "$SRC"/${SRC_DIR}/entitlements-mac-dev.plist . + fi fi if [ ! "$PREP_ONLY" = "1" ] ; then diff --git a/scripts/get-dep-lib.sh b/scripts/get-dep-lib.sh index f46ee49a3..ec261d46f 100755 --- a/scripts/get-dep-lib.sh +++ b/scripts/get-dep-lib.sh @@ -4,8 +4,8 @@ # set version of 3rd party libraries CURRENT_LIBZ="v1.2.11" CURRENT_LIBZIP="rel-1-5-1" -CURRENT_LIBGIT2="v1.0.1" -CURRENT_LIBCURL="curl-7_54_1" +CURRENT_LIBGIT2="v1.8.1" +CURRENT_LIBCURL="curl-7_88_1" CURRENT_LIBUSB="v1.0.25" CURRENT_OPENSSL="OpenSSL_1_1_1m" CURRENT_LIBSSH2="libssh2-1.8.0"