From 27e553b2b1510535107c101e9217b9a32cc0dbe4 Mon Sep 17 00:00:00 2001 From: Dino Date: Mon, 27 Feb 2023 22:21:46 -0500 Subject: [PATCH] Ticket #47392 Set correct version number --- platforms/macos/homebrew-appbundle.sh | 80 +++++++++++++++------------ 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/platforms/macos/homebrew-appbundle.sh b/platforms/macos/homebrew-appbundle.sh index d08ffc3dd8..3454c3a376 100755 --- a/platforms/macos/homebrew-appbundle.sh +++ b/platforms/macos/homebrew-appbundle.sh @@ -11,38 +11,36 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +export CXXFLAGS=-std=c++17 export CPPFLAGS="-I$(brew --prefix readline)/include" export LDFLAGS="-L$(brew --prefix icu4c)/lib -L$(brew --prefix readline)/lib" export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig" CONTENTSDIR="/Applications/Freeciv.app/Contents/" -if ! mkdir -p "${CONTENTSDIR}" ; then - echo "Failed to create \"${CONTENTSDIR}" >&2 - exit 1 -fi +if ! [ -e "${CONTENTSDIR}" ] ; then -if ! mkdir -p "${CONTENTSDIR}Resources" ; then - echo "Failed to create directory \"${CONTENTSDIR}Resources\"" >&2 - exit 1 -fi + if ! mkdir -p "${CONTENTSDIR}" ; then + echo "Failed to create \"${CONTENTSDIR}" >&2 + exit 1 + fi -if ! cp data/freeciv-client.icns "${CONTENTSDIR}Resources" ; then - echo "Failed to copy file \"freeciv-client.icns\"" >&2 - exit 1 -fi + if ! mkdir -p "${CONTENTSDIR}Resources" ; then + echo "Failed to create directory \"${CONTENTSDIR}Resources\"" >&2 + exit 1 + fi -if ! mkdir -p "${CONTENTSDIR}MacOS" ; then - echo "Failed to create directory \"${CONTENTSDIR}MacOS\"" >&2 - exit 1 -fi + if ! cp data/freeciv-client.icns "${CONTENTSDIR}Resources" ; then + echo "Failed to copy file \"freeciv-client.icns\"" >&2 + exit 1 + fi -if ! mkdir -p "${CONTENTSDIR}lib" ; then - echo "Failed to create directory \"${CONTENTSDIR}lib\"" >&2 - exit 1 -fi + if ! mkdir -p "${CONTENTSDIR}MacOS" ; then + echo "Failed to create directory \"${CONTENTSDIR}MacOS\"" >&2 + exit 1 + fi -if ! echo " + if ! echo " @@ -56,11 +54,11 @@ if ! echo " CFBundleIdentifier freeciv CFBundleVersion - 3.1.0-alpha + VER CFBundleShortVersionString - 3.1.0-alpha + VER CFBundleExecutable - ../bin/freeciv-gtk3.22 + ../bin/freeciv-gtk4 CFBundleIconFile freeciv-client.icns CFBundleDevelopmentRegion @@ -73,18 +71,29 @@ if ! echo " 6.0 " > "${CONTENTSDIR}Info.plist" ; then - echo "Failed to create file \"${CONTENTSDIR}Info.plist\"" >&2 - exit 1 -fi + echo "Failed to create file \"${CONTENTSDIR}Info.plist\"" >&2 + exit 1 + fi + + VSTRING=`./fc_version` + + # substitute VSTRING into Info.plist + sed -i '' -e "s/VER/${VSTRING}/g" "${CONTENTSDIR}Info.plist" + + if ! echo -n "APPL????" > "${CONTENTSDIR}PkgInfo" ; then + echo "Failed to create file \"${CONTENTSDIR}PkgInfo\"" >&2 + exit 1 + fi -if ! echo -n "APPL????" > "${CONTENTSDIR}PkgInfo" ; then - echo "Failed to create file \"${CONTENTSDIR}PkgInfo\"" >&2 - exit 1 fi -if ! mkdir build ; then - echo "Failed to create build directory" >&2 - exit 1 +if ! [ -e build ] ; then + + if ! mkdir build ; then + echo "Failed to create build directory" >&2 + exit 1 + fi + fi cd build || exit 1 @@ -93,8 +102,9 @@ if ! meson setup .. \ -Dack_experimental=true \ -Druledit=false \ -Dsyslua=true \ - -Dclients=gtk3.22 \ - -Dfcmp=gtk3 \ + -Ddebug=false \ + -Dclients=gtk4,qt \ + -Dfcmp=qt \ -Dprefix="$CONTENTSDIR" || ! ninja || ! ninja install -- 2.31.0