mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 11:19:48 +02:00
since latest release macos is not 'X' anymore
This commit is contained in:
15
mk/macos/.gitignore
vendored
Normal file
15
mk/macos/.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/megaglest
|
||||
/megaglest.6
|
||||
/megaglest_*
|
||||
/[Mm]ega[Gg]lest*.dmg
|
||||
|
||||
core
|
||||
core.bak
|
||||
|
||||
/p7zip/
|
||||
/build/
|
||||
/lib/
|
||||
/[Rr]elease/
|
||||
/[Dd]ebug/
|
||||
/mydata/
|
||||
/*.dSYM/
|
43
mk/macos/CMakeLists.txt
Normal file
43
mk/macos/CMakeLists.txt
Normal file
@@ -0,0 +1,43 @@
|
||||
# Anything <= 10.3 isn't supported. We want 32-bit Intel/PPC on 10.4, 10.5.
|
||||
# On 10.6 32/64-bit Intel. On >= 10.7 unset architecture mean default 64-bit Intel.
|
||||
# Using oldest available sdk with current Xcode is recommended.
|
||||
# User needs to be able to change these options.
|
||||
# So we must only set the values the first time CMake is run, or we
|
||||
# will overwrite any changes the user sets.
|
||||
# FORCE is used because the options are not reflected in the UI otherwise.
|
||||
# Seems like a good place to add version specific compiler flags too.
|
||||
|
||||
IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
|
||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
|
||||
ENDIF()
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ENDIF()
|
||||
|
||||
# Include extra paths to search for includes; this is the default system wide macports and X11 path.
|
||||
INCLUDE_DIRECTORIES(/usr/X11/include /opt/local/include)
|
||||
#LINK_DIRECTORIES(/opt/local/lib)
|
||||
|
||||
##install part
|
||||
|
||||
# This file is in git CRLF but that causes the cpack run to fail
|
||||
#CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt"
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/docs/COPYRIGHT.source_code.txt" NEWLINE_STYLE UNIX)
|
||||
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/docs/COPYRIGHT.source_code.txt")
|
||||
|
||||
# This changes Info.plist from something with variables and CMakeisms to
|
||||
# something that can be installed on disk.
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macos/bundle_resources/Info.plist.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mk/macos/bundle_resources/Info.plist")
|
||||
SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/mk/macos/bundle_resources/Info.plist")
|
||||
|
||||
include (InstallRequiredSystemLibraries)
|
||||
|
||||
# Use bundle generator (OSX has 3 other options if you feel adventurous)
|
||||
SET(CPACK_GENERATOR "Bundle")
|
||||
SET(CPACK_BUNDLE_NAME "MegaGlest")
|
||||
SET(CPACK_PACKAGE_FILE_NAME "MegaGlest-game-macos-${MEGAGLEST_VERSION}")
|
||||
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macos/bundle_resources/MegaGlest.icns")
|
||||
SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macos/bundle_resources/MegaGlest.icns")
|
||||
SET(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/mk/macos/bundle_resources/MegaGlest.sh")
|
261
mk/macos/build-mg.sh
Executable file
261
mk/macos/build-mg.sh
Executable file
@@ -0,0 +1,261 @@
|
||||
#!/bin/sh
|
||||
# Use this script to build MegaGlest using cmake
|
||||
# ----------------------------------------------------------------------------
|
||||
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||
# 2015 Rewritten by filux <heross(@@)o2.pl>
|
||||
# Copyright (c) 2011-2015 under GNU GPL v3.0+
|
||||
# ----------------------------------------------------------------------------
|
||||
# Default to English language output so we can understand your bug reports
|
||||
export LANG=C
|
||||
|
||||
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||
BUILD_BUNDLE=0
|
||||
CPU_COUNT=-1
|
||||
CMAKE_ONLY=0
|
||||
MAKE_ONLY=0
|
||||
USE_XCODE=0
|
||||
GCC_FORCED=0
|
||||
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
|
||||
FORCE_EMBEDDED_LIBS=0
|
||||
LUA_FORCED_VERSION=0
|
||||
COMPILATION_WITHOUT=0
|
||||
|
||||
while getopts "c:defhl:mnwxb" option; do
|
||||
case "${option}" in
|
||||
c) CPU_COUNT=${OPTARG};;
|
||||
d) WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=OFF";;
|
||||
e) FORCE_EMBEDDED_LIBS=1;;
|
||||
f) GCC_FORCED=1;;
|
||||
h) echo "Usage: $0 <option>"
|
||||
echo " where <option> can be: -b, -c x, -d, -e, -f, -m, -n, -h, -l x, -w, -x"
|
||||
echo " option descriptions:"
|
||||
echo " -b : Force default configuration designed for bundle/release."
|
||||
echo " -c x : Force the cpu / cores count to x - example: -c 4"
|
||||
echo " -d : Force DYNAMIC compile (do not want static libs)"
|
||||
echo " -e : Force compile with EMBEDDED libraries"
|
||||
echo " -f : Force using Gcc compiler"
|
||||
echo " -l x : Force using LUA version x - example: -l 5.3"
|
||||
echo " -m : Force running CMAKE only to create Make files (do not compile)"
|
||||
echo " -n : Force running MAKE only to compile (assume CMAKE already built make files)"
|
||||
echo " -w : Force compilation 'Without using wxWidgets'"
|
||||
echo " -x : Force usage of Xcode and xcodebuild"
|
||||
echo " -h : Display this help usage"
|
||||
exit 0;;
|
||||
l) LUA_FORCED_VERSION=${OPTARG};;
|
||||
m) CMAKE_ONLY=1;;
|
||||
n) MAKE_ONLY=1;;
|
||||
w) COMPILATION_WITHOUT=1;;
|
||||
x) USE_XCODE=1;;
|
||||
b) BUILD_BUNDLE=1
|
||||
#CPU_COUNT=-1
|
||||
CMAKE_ONLY=0
|
||||
MAKE_ONLY=0
|
||||
USE_XCODE=0
|
||||
GCC_FORCED=0
|
||||
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
|
||||
LUA_FORCED_VERSION=0
|
||||
COMPILATION_WITHOUT=1;;
|
||||
\?)
|
||||
echo "Script Invalid option: -$OPTARG" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
CLANG_BIN_PATH="$(which clang 2>/dev/null)"
|
||||
CLANGPP_BIN_PATH="$(which clang++ 2>/dev/null)"
|
||||
GCC_BIN_PATH="/opt/local/bin/gcc"
|
||||
GCCPP_BIN_PATH="/opt/local/bin/g++"
|
||||
CMAKE_BIN_PATH="$(which cmake 2>/dev/null)"
|
||||
if [ "$CMAKE_BIN_PATH" = "" ]; then CMAKE_BIN_PATH="/opt/local/bin/cmake"; fi
|
||||
# ^ install latest (not beta) gcc from "mac ports" and then choose it as default gcc version by "port select ..."
|
||||
# ( ^ same situation is with wxwidgets )
|
||||
cd ${SCRIPTDIR}
|
||||
|
||||
if [ "$BUILD_BUNDLE" -eq "1" ] && [ -d "p7zip" ]; then rm -rf "p7zip"; fi
|
||||
if [ -e ".p7zip.zip" ] && [ "$(find ./ -name ".p7zip.zip" -mtime +90)" ]; then rm ".p7zip.zip"; rm -rf "p7zip"; fi
|
||||
if [ ! -e ".p7zip.zip" ]; then
|
||||
curl -L -o .p7zip.zip https://github.com/MegaGlest/megaglest-source/releases/download/3.2.3/p7zip.zip 2>/dev/null
|
||||
if [ -e ".p7zip.zip" ]; then touch -m ".p7zip.zip"; fi
|
||||
fi
|
||||
if [ ! -d "p7zip" ]; then unzip .p7zip.zip >/dev/null; fi
|
||||
|
||||
if [ "$BUILD_BUNDLE" -eq "1" ]; then
|
||||
if [ -e "megaglest" ] && [ "$(./megaglest --version >/dev/null; echo "$?")" -eq "0" ]; then
|
||||
if [ -d "lib" ]; then rm -rf "lib"; fi
|
||||
mkdir -p "lib"
|
||||
list_of_libs="$(otool -L megaglest | grep -v '/System/Library/Frameworks/' | grep -v '/usr/lib/' | awk '{print $1}' | sed '/:$/d')"
|
||||
for (( i=1; i<=50; i++ )); do
|
||||
for dyn_lib in $list_of_libs; do
|
||||
if [ "$(echo "$list_of_checked_libs" | grep "$dyn_lib")" = "" ]; then
|
||||
list_of_libs2="$(otool -L "$dyn_lib" | grep -v '/System/Library/Frameworks/' | grep -v '/usr/lib/' | awk '{print $1}')"
|
||||
list_of_libs="$(echo "$list_of_libs
|
||||
$list_of_libs2" | sed '/:$/d' | sed '/^$/d' | sort -u )"
|
||||
list_of_checked_libs="$list_of_checked_libs $dyn_lib"
|
||||
fi
|
||||
done
|
||||
done
|
||||
for dyn_lib in $list_of_libs; do
|
||||
cp "$dyn_lib" "lib/"
|
||||
done
|
||||
|
||||
if [ "$(find lib -type f -name "libvlc.*")" != "" ]; then
|
||||
LIBVLC_DIR_CHECK="$( echo "$list_of_checked_libs" | tr ' ' '\n' | grep "libvlc\." | sort -u | head -1 )"
|
||||
if [ "$LIBVLC_DIR_CHECK" != "" ]; then
|
||||
LIBVLC_DIR="$(cd "$(dirname "$LIBVLC_DIR_CHECK")"; pwd)"
|
||||
if [ -d "$LIBVLC_DIR/vlc/plugins" ]; then
|
||||
mkdir -p "lib/vlc"
|
||||
cp -f -r "$LIBVLC_DIR/vlc/plugins" "lib/vlc/"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo 'Error: Please run first at least once build-mg.sh script to be ready for prepare directory with dynamic libraries.'
|
||||
# strange method but required for cpack/.dmg
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Google breakpad integration (cross platform memory dumps) - OPTIONAL
|
||||
# Set this to the root path of your Google breakpad subversion working copy.
|
||||
# By default, this script looks for a "google-breakpad" sub-directory within
|
||||
# the directory this script resides in. If this directory is not found, Cmake
|
||||
# will warn about it later.
|
||||
# Instead of editing this variable, consider creating a symbolic link:
|
||||
# ln -s ../../google-breakpad google-breakpad
|
||||
BREAKPAD_ROOT="$SCRIPTDIR/../../google-breakpad/"
|
||||
|
||||
# Build threads
|
||||
# By default we use all physical CPU cores to build.
|
||||
NUMCORES="$(sysctl -n hw.ncpu)"
|
||||
echo "CPU cores detected: $NUMCORES"
|
||||
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
||||
if [ "$CPU_COUNT" != -1 ]; then NUMCORES=$CPU_COUNT; fi
|
||||
echo "CPU cores to be used: $NUMCORES"
|
||||
|
||||
if [ "$BUILD_BUNDLE" -eq "1" ] && [ -d "build" ]; then rm -rf build; fi
|
||||
if [ $MAKE_ONLY = 0 ]; then mkdir -p build; fi
|
||||
cd build
|
||||
|
||||
if [ $MAKE_ONLY = 0 ] && [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
|
||||
|
||||
distribution="$(sw_vers -productName)"
|
||||
release="$(sw_vers -productVersion)"
|
||||
xcode_ver="$(xcodebuild -version | awk '/Xcode/ {print $2}')"
|
||||
architecture="$(uname -m)"
|
||||
echo 'We have detected the following system:'
|
||||
echo " [ $distribution ] [ $release ] [ $architecture ] [ $xcode_ver ]"
|
||||
case $release in
|
||||
*) if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
|
||||
echo 'Turning ON dynamic PNG ...'
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_PNG=OFF -DWANT_USE_VLC=OFF -DWANT_USE_OpenSSL=OFF"
|
||||
fi;;
|
||||
esac
|
||||
case $xcode_ver in
|
||||
# en.wikipedia.org/wiki/Xcode, Version, OS X SDK(s) <- lowest, but not less than 10.4
|
||||
2.*|3.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.4";;
|
||||
4.0*|4.1*|4.2*|4.3*) CMAKE_OSX_DEPLOYMENT_TARGET="10.6";;
|
||||
4.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.7";;
|
||||
5.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.8";;
|
||||
6.0*|6.1*|6.2*) CMAKE_OSX_DEPLOYMENT_TARGET="10.9";;
|
||||
esac
|
||||
case $CMAKE_OSX_DEPLOYMENT_TARGET in
|
||||
10.4*|10.5*) CMAKE_OSX_ARCHITECTURES="ppc;i386";;
|
||||
10.6*) CMAKE_OSX_ARCHITECTURES="i386;x86_64";;
|
||||
esac
|
||||
if [ "$CMAKE_OSX_DEPLOYMENT_TARGET" != "" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
||||
fi
|
||||
if [ "$CMAKE_OSX_ARCHITECTURES" != "" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}"
|
||||
fi
|
||||
|
||||
if [ "$USE_XCODE" -ne "1" ]; then
|
||||
if [ "$GCC_FORCED" -ne "1" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${CLANG_BIN_PATH} -DCMAKE_CXX_COMPILER=${CLANGPP_BIN_PATH}"
|
||||
else
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${GCC_BIN_PATH} -DCMAKE_CXX_COMPILER=${GCCPP_BIN_PATH}"
|
||||
echo "USER WANTS to use Gcc compiler!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$LUA_FORCED_VERSION" != "0" ] && [ "$LUA_FORCED_VERSION" != "" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFORCE_LUA_VERSION=$LUA_FORCED_VERSION"
|
||||
#echo "USER WANTS TO FORCE USE of LUA $LUA_FORCED_VERSION"
|
||||
fi
|
||||
|
||||
if [ "$FORCE_EMBEDDED_LIBS" != "0" ] && [ "$FORCE_EMBEDDED_LIBS" != "" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFORCE_EMBEDDED_LIBS=ON"
|
||||
fi
|
||||
|
||||
if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_MEGAGLEST_MAP_EDITOR=OFF -DBUILD_MEGAGLEST_MODEL_VIEWER=OFF"
|
||||
fi
|
||||
|
||||
if [ "$MAKE_ONLY" -eq "0" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DWANT_DEV_OUTPATH=ON $WANT_STATIC_LIBS -DBREAKPAD_ROOT=$BREAKPAD_ROOT"
|
||||
if [ "$BUILD_BUNDLE" -ne "1" ]; then
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=''"
|
||||
if [ "$GCC_FORCED" -ne "1" ] || [ "$USE_XCODE" -eq "1" ]; then
|
||||
#^ Remove this condition when it V will start working on gcc
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_MEGAGLEST_TESTS=ON"
|
||||
else
|
||||
rm -f ../megaglest_tests
|
||||
fi
|
||||
rm -f ../MegaGlest*.dmg
|
||||
else
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCPACK_GENERATOR=Bundle -DWANT_SINGLE_INSTALL_DIRECTORY=ON"
|
||||
rm -f ../megaglest_editor ../megaglest_g3dviewer ../megaglest_tests
|
||||
fi
|
||||
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||
if [ "$USE_XCODE" -eq "1" ]; then
|
||||
$CMAKE_BIN_PATH -GXcode $EXTRA_CMAKE_OPTIONS ../../..
|
||||
if [ "$?" -ne "0" ]; then echo 'ERROR: CMAKE failed.' >&2; exit 1; fi
|
||||
else
|
||||
$CMAKE_BIN_PATH —G"Unix Makefiles" $EXTRA_CMAKE_OPTIONS ../../..
|
||||
if [ "$?" -ne "0" ]; then echo 'ERROR: CMAKE failed.' >&2; exit 1; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CMAKE_ONLY" -eq "1" ]; then
|
||||
echo "==================> You may now call make with $NUMCORES cores... <=================="
|
||||
else
|
||||
if [ "$USE_XCODE" -eq "1" ]; then
|
||||
echo "==================> About to call xcodebuild... <================================="
|
||||
xcodebuild | egrep "(error|warning):"
|
||||
if [ "$?" -ne "0" ]; then echo 'ERROR: xcodebuild failed.' >&2; exit 2; fi
|
||||
else
|
||||
echo "==================> About to call make with $NUMCORES cores... <=================="
|
||||
make -j$NUMCORES
|
||||
if [ "$?" -ne "0" ]; then echo 'ERROR: MAKE failed.' >&2; exit 2; fi
|
||||
fi
|
||||
|
||||
if [ -d "../Debug" ]; then mv -f ../Debug/megaglest* "$SCRIPTDIR"; rm -rf ../Debug
|
||||
elif [ -d "../Release" ]; then mv -f ../Release/megaglest* "$SCRIPTDIR"; rm -rf ../Release; fi
|
||||
|
||||
cd ..
|
||||
if [ "$BUILD_BUNDLE" -ne "1" ]; then
|
||||
echo ''
|
||||
echo 'BUILD COMPLETE.'
|
||||
echo ''
|
||||
echo '- - - - - - - - - - - - - - - - - - - -'
|
||||
echo 'Mini test:'
|
||||
echo '>>> megaglest --version'
|
||||
./megaglest --version | head -3
|
||||
#echo '>>> megaglest_editor --help'
|
||||
#./megaglest_editor --help | head -3
|
||||
#echo '>>> megaglest_g3dviewer --help'
|
||||
#./megaglest_g3dviewer --help | head -3
|
||||
echo 'Dependencies:'
|
||||
otool -L megaglest
|
||||
echo '- - - - - - - - - - - - - - - - - - - -'
|
||||
echo ''
|
||||
echo 'To launch MegaGlest from the current directory, use:'
|
||||
echo ' ./megaglest'
|
||||
echo ''
|
||||
else
|
||||
ls -lhA megaglest
|
||||
echo ''
|
||||
./megaglest --version
|
||||
echo ''
|
||||
fi
|
||||
fi
|
32
mk/macos/bundle_resources/Info.plist.in
Normal file
32
mk/macos/bundle_resources/Info.plist.in
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>MegaGlest</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>v${MEGAGLEST_VERSION}, © 2001-2016 The MegaGlest Team.</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>MegaGlest</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.megaglest.v${MEGAGLEST_VERSION}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>MegaGlest</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>MGGL</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
BIN
mk/macos/bundle_resources/MegaGlest.icns
Normal file
BIN
mk/macos/bundle_resources/MegaGlest.icns
Normal file
Binary file not shown.
18
mk/macos/bundle_resources/MegaGlest.sh
Executable file
18
mk/macos/bundle_resources/MegaGlest.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Use this script in bundle to run game
|
||||
# ----------------------------------------------------------------------------
|
||||
# Copyright (c) 2015 under GNU GPL v3.0+
|
||||
|
||||
export LANG=C
|
||||
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||
if [ -d "$SCRIPTDIR/lib" ]; then
|
||||
export DYLD_LIBRARY_PATH="$SCRIPTDIR/lib"
|
||||
binary_dir_path="$SCRIPTDIR"
|
||||
else
|
||||
export DYLD_LIBRARY_PATH="$SCRIPTDIR/../Frameworks"
|
||||
binary_dir_path="$SCRIPTDIR/../Resources/megaglest-game"
|
||||
fi
|
||||
export PATH="$binary_dir_path:$PATH"
|
||||
|
||||
exec "$binary_dir_path/megaglest" "$@"
|
||||
exit "$?"
|
3
mk/macos/glest-dev.ini
Normal file
3
mk/macos/glest-dev.ini
Normal file
@@ -0,0 +1,3 @@
|
||||
DataPath=$APPLICATIONPATH/../../data/glest_game/
|
||||
ServerListPath=$APPLICATIONPATH/../shared/
|
||||
GlestKeysIniPath=$APPLICATIONPATH/../shared/
|
95
mk/macos/glest.ini
Normal file
95
mk/macos/glest.ini
Normal file
@@ -0,0 +1,95 @@
|
||||
; === propertyMap File ===
|
||||
; This file defines default properties and values. Do not edit this file,
|
||||
; instead, to modify, copy any properties to glestuser.ini, then change these as
|
||||
; needed. Values contained in glestuser.ini will overwrite values found here.
|
||||
;
|
||||
; For explanation of these properties, please refer to the MegaGlest wiki at
|
||||
; http://wiki.megaglest.org/
|
||||
;
|
||||
AiLog=0
|
||||
AiRedir=false
|
||||
AllowDownloadDataSynch=false
|
||||
AllowGameDataSynchCheck=false
|
||||
AllowRotateUnits=true
|
||||
AnnouncementURL=http://master.megaglest.org/files/announcement.txt
|
||||
AutoMaxFullScreen=false
|
||||
AutoTest=false
|
||||
CheckGlCaps=true
|
||||
ColorBits=32
|
||||
ConsoleMaxLines=8
|
||||
ConsoleMaxLinesStored=25
|
||||
ConsoleTimeout=20
|
||||
DataPath=$APPLICATIONDATAPATH/
|
||||
LogPath=$HOME/.megaglest/
|
||||
DayTime=1000
|
||||
DebugLogFile=debug.log
|
||||
DebugMode=false
|
||||
DebugPerformance=false
|
||||
DebugNetwork=false
|
||||
DebugWorldSynch=false
|
||||
DepthBits=16
|
||||
FactoryGraphics=OpenGL
|
||||
FactorySound=OpenAL
|
||||
FastSpeedLoops=8
|
||||
FileArchiveExtension=.7z
|
||||
FileArchiveExtractCommand=$APPLICATIONDATAPATH/p7zip/7z
|
||||
FileArchiveExtractCommandParameters=x -o"{outputpath}" "{archivename}"
|
||||
FileArchiveCompressCommand=$APPLICATIONDATAPATH/p7zip/7z
|
||||
FileArchiveCompressCommandParameters=a -r -xr!?svn\* "{archivename}" "{archivefiles}"
|
||||
FileArchiveCompressCommandSuccessResult=0
|
||||
Filter=Bilinear
|
||||
FilterMaxAnisotropy=1
|
||||
FirstTime=false
|
||||
FocusArrows=true
|
||||
FogOfWarSmoothing=true
|
||||
FogOfWarSmoothingFrameSkip=3
|
||||
FontConsoleBaseSize=14
|
||||
FontConsolePostfix=-*-*-*-*-*-*-*
|
||||
FontConsolePrefix=-*-arial-*-r-*-*-
|
||||
FontDisplayBaseSize=12
|
||||
FontDisplayPostfix=-*-*-*-*-*-*-*
|
||||
FontDisplayPrefix=-*-arial-*-r-*-*-
|
||||
FontDisplaySmallBaseSize=12
|
||||
FontMenuBigBaseSize=20
|
||||
FontMenuBigPostfix=-*-*-*-*-*-*-*
|
||||
FontMenuBigPrefix=-*-arial-*-r-*-*-
|
||||
FontMenuNormalBaseSize=14
|
||||
FontMenuNormalPostfix=-*-*-*-*-*-*-*
|
||||
FontMenuNormalPrefix=-*-arial-*-r-*-*-
|
||||
FontMenuVeryBigBaseSize=25
|
||||
FontSizeAdjustment=0
|
||||
FONT_HEIGHT_TEXT=yW
|
||||
InternetGamesBlockScenario=lobby_access
|
||||
Lang=english
|
||||
MaxLights=3
|
||||
Masterserver=http://master.megaglest.org/
|
||||
NetPlayerName=newbie
|
||||
NetworkConsistencyChecks=true
|
||||
PhotoMode=false
|
||||
PortList=61357,61367,61377,61387,61397
|
||||
PortServer=61357
|
||||
RefreshFrequency=75
|
||||
ScreenHeight=600
|
||||
ScreenWidth=800
|
||||
ServerIp=192.168.0.107
|
||||
ShadowFrameSkip=2
|
||||
ShadowTextureSize=512
|
||||
Shadows=Projected
|
||||
SoundStaticBuffers=16
|
||||
SoundStreamingBuffers=4
|
||||
SoundVolumeAmbient=80
|
||||
SoundVolumeFx=80
|
||||
SoundVolumeMusic=90
|
||||
StencilBits=0
|
||||
Textures3D=true
|
||||
TranslationGetURL=https://www.transifex.com/api/2/project/megaglest/resource/$file/translation/$language
|
||||
TranslationGetURLDetails=https://www.transifex.com/api/2/project/megaglest/resource/$file/?details
|
||||
TranslationGetURLFileList=main-language-file|megapack-language-file|loading-screen-hints|tutorials-1-very-basic-tutorial|tutorials-2-basic-tutorial|tutorials-3-advanced-tutorial|scenarios-amazones|scenarios-amazones-light|scenarios-capture-enemy-flag|scenarios-storming
|
||||
TranslationGetURLFileListMapping=data/lang/$language.lng|techs/megapack/lang/megapack_$language.lng|data/lang/hint/hint_$language.lng|tutorials/1_very_basic_tutorial/1_very_basic_tutorial_$language.lng|tutorials/2_basic_tutorial/2_basic_tutorial_$language.lng|tutorials/3_advanced_tutorial/3_advanced_tutorial_$language.lng|scenarios/amazones/amazones_$language.lng|scenarios/amazones_light/amazones_light_$language.lng|scenarios/capture_enemy_flag/capture_enemy_flag_$language.lng|scenarios/storming/storming_$language.lng
|
||||
TranslationGetURLLanguage=en
|
||||
TranslationGetURLPassword=
|
||||
TranslationGetURLUser=<enter username>
|
||||
UnitParticles=true
|
||||
UserData_Root=$HOME/.megaglest/
|
||||
VersionURL=http://master.megaglest.org/files/versions/
|
||||
Windowed=true
|
107
mk/macos/make-binary-archive.sh
Executable file
107
mk/macos/make-binary-archive.sh
Executable file
@@ -0,0 +1,107 @@
|
||||
#!/bin/sh
|
||||
# Use this script to build MegaGlest Binary Archive for a Version Release
|
||||
# ----------------------------------------------------------------------------
|
||||
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||
# 2015 Rewritten by filux <heross(@@)o2.pl>
|
||||
# Copyright (c) 2011-2015 under GNU GPL v3.0+
|
||||
# ----------------------------------------------------------------------------
|
||||
LANG=C
|
||||
|
||||
# set this to non 0 to skip building the binary
|
||||
skipbinarybuild=0
|
||||
if [ "$1" = "-CI" ]; then skipbinarybuild=1; fi
|
||||
|
||||
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||
cd "$CURRENTDIR"
|
||||
|
||||
# Consider setting this for small packages if there's plenty of RAM and CPU available:
|
||||
#export XZ_OPT="$XZ_OPT -9e"
|
||||
|
||||
if [ "$1" = "-CI" ] || [ "$1" = "-" ] || [ "$(echo "$1" | grep '\--show-result-path')" != "" ]; then
|
||||
if [ "$2" != "" ]; then
|
||||
SOURCE_BRANCH="$2"
|
||||
if [ "$3" != "" ]; then NUMCORES="$3"; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION="$(../linux/mg-version.sh --version)"
|
||||
kernel="macos"
|
||||
REPODIR="$CURRENTDIR/../../"
|
||||
if [ -d "$REPODIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
|
||||
cd "$REPODIR"
|
||||
if [ "$SOURCE_BRANCH" = "" ]; then SOURCE_BRANCH="$(git branch | grep '^* ' | awk '{print $2}')"; fi
|
||||
# on macos are problems with more advanced using awk ^
|
||||
SOURCE_COMMIT="$(echo "[$(git rev-list HEAD --count).$(git log -1 --format=%h)]")"
|
||||
fi
|
||||
|
||||
ARCHIVE_TYPE="tar.bz2"
|
||||
SNAPSHOTNAME="mg-binary-$kernel"
|
||||
SN_PACKAGE="$SNAPSHOTNAME-$VERSION-$SOURCE_BRANCH.$ARCHIVE_TYPE"
|
||||
RELEASENAME="megaglest-binary-$kernel"
|
||||
PACKAGE="$RELEASENAME-$VERSION.$ARCHIVE_TYPE"
|
||||
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
|
||||
|
||||
if [ "$SOURCE_BRANCH" != "" ] && [ "$SOURCE_BRANCH" != "master" ] && [ "$(echo "$VERSION" | grep '\-dev$')" != "" ]; then
|
||||
RELEASENAME="$SNAPSHOTNAME"; PACKAGE="$SN_PACKAGE"
|
||||
fi
|
||||
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
|
||||
if [ "$1" = "--show-result-path" ]; then echo "${RELEASEDIR_ROOT}/$PACKAGE"; exit 0
|
||||
elif [ "$1" = "--show-result-path2" ]; then echo "${RELEASEDIR_ROOT}/$RELEASENAME"; exit 0; fi
|
||||
|
||||
echo "Creating binary package in $RELEASEDIR"
|
||||
if [ "$SOURCE_BRANCH" != "" ]; then echo "Detected parameters for source repository: branch=[$SOURCE_BRANCH], commit=$SOURCE_COMMIT"; fi
|
||||
|
||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
||||
mkdir -p "$RELEASEDIR"
|
||||
|
||||
if [ "$skipbinarybuild" -eq "0" ]; then
|
||||
echo "building binaries ..."
|
||||
cd "$CURRENTDIR"
|
||||
if [ -d "build" ]; then rm -rf "build"; fi
|
||||
build_command="./build-mg.sh -b"
|
||||
if [ "$NUMCORES" != "" ]; then build_command="$build_command -c $NUMCORES"; fi
|
||||
$build_command
|
||||
if [ "$?" -ne "0" ]; then echo 'ERROR: "./build-mg.sh" failed.' >&2; exit 1; fi
|
||||
else
|
||||
echo "SKIPPING build of binaries ..."
|
||||
fi
|
||||
|
||||
cd "$CURRENTDIR"
|
||||
echo "copying binaries ..."
|
||||
cp ../shared/*.ico "$RELEASEDIR"
|
||||
if [ -e "$RELEASEDIR/glest.ico" ]; then rm "$RELEASEDIR/glest.ico"; fi
|
||||
#cp bundle_resources/*.icns "$RELEASEDIR"
|
||||
cp {../shared/,}*.ini "$RELEASEDIR"
|
||||
if [ -e "$RELEASEDIR/glest-dev.ini" ]; then rm "$RELEASEDIR/glest-dev.ini"; fi
|
||||
cp megaglest ../linux/start_megaglest_gameserver bundle_resources/MegaGlest.sh "$RELEASEDIR"
|
||||
|
||||
if [ -e "megaglest_editor" ]; then
|
||||
cp megaglest_editor "$RELEASEDIR"
|
||||
else
|
||||
if [ -e "$RELEASEDIR/editor.ico" ]; then rm "$RELEASEDIR/editor.ico"; fi
|
||||
fi
|
||||
if [ -e "megaglest_g3dviewer" ]; then
|
||||
cp megaglest_g3dviewer "$RELEASEDIR"
|
||||
else
|
||||
if [ -e "$RELEASEDIR/g3dviewer.ico" ]; then rm "$RELEASEDIR/g3dviewer.ico"; fi
|
||||
fi
|
||||
if [ -d "p7zip" ]; then cp -r p7zip "$RELEASEDIR"; fi
|
||||
if [ -d "lib" ]; then cp -r lib "$RELEASEDIR"; fi
|
||||
if [ "$(echo "$VERSION" | grep -v '\-dev$')" != "" ]; then
|
||||
echo "$(date -u)" > "$RELEASEDIR/build-time.log"
|
||||
fi
|
||||
|
||||
if [ "$1" != "--installer" ]; then
|
||||
echo "creating $PACKAGE"
|
||||
cd "$RELEASEDIR_ROOT"
|
||||
if [ -f "$PACKAGE" ]; then rm "$PACKAGE"; fi
|
||||
cd "$RELEASENAME"
|
||||
tar -cf - * | bzip2 -9 > "../$PACKAGE"
|
||||
cd "$CURRENTDIR"
|
||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"
|
||||
fi
|
||||
|
||||
cd "$CURRENTDIR"
|
||||
if [ "$1" = "-CI" ] || [ "$1" = "-" ]; then
|
||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
||||
fi
|
59
mk/macos/make-release-archives.sh
Executable file
59
mk/macos/make-release-archives.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
# Use this script to build MegaGlest release archives for a Version Release
|
||||
# ----------------------------------------------------------------------------
|
||||
# 2015 Written by filux <heross(@@)o2.pl>
|
||||
# Copyright (c) 2015 under GNU GPL v3.0+
|
||||
# ----------------------------------------------------------------------------
|
||||
LANG=C
|
||||
|
||||
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||
cd "$CURRENTDIR"
|
||||
VERSION="$(../linux/mg-version.sh --version)"
|
||||
kernel="macos"
|
||||
|
||||
RELEASENAME="MegaGlest-game-$kernel"
|
||||
PACKAGE="$RELEASENAME-$VERSION.zip"
|
||||
PACKAGE2="$RELEASENAME-$VERSION.dmg"
|
||||
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
|
||||
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
|
||||
BINARY_DIR="$(./make-binary-archive.sh --show-result-path2)"
|
||||
DATA_DIR="$(../linux/make-data-archive.sh --show-result-path2)"
|
||||
APP_RES_DIR="$RELEASEDIR/MegaGlest.app/Contents/Resources"
|
||||
APP_BIN_DIR="$RELEASEDIR/MegaGlest.app/Contents/MacOS"
|
||||
APP_PLIST_DIR="$RELEASEDIR/MegaGlest.app/Contents"
|
||||
APP_GAME_DIR="$APP_RES_DIR/megaglest-game"
|
||||
|
||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
||||
mkdir -p "$APP_GAME_DIR"
|
||||
mkdir -p "$APP_BIN_DIR"
|
||||
|
||||
./make-binary-archive.sh --installer
|
||||
cp -r "$BINARY_DIR/"* "$APP_GAME_DIR"
|
||||
../linux/make-data-archive.sh --installer
|
||||
cp -r "$DATA_DIR/"* "$APP_GAME_DIR"; sleep 0.5s
|
||||
if [ -f "$APP_GAME_DIR/MegaGlest.sh" ]; then rm -f "$APP_GAME_DIR/MegaGlest.sh"; fi
|
||||
|
||||
cp "$CURRENTDIR/build/mk/macos/bundle_resources/Info.plist" "$APP_PLIST_DIR"
|
||||
cp "$CURRENTDIR/bundle_resources/MegaGlest.icns" "$APP_RES_DIR"
|
||||
cp "$CURRENTDIR/bundle_resources/MegaGlest.sh" "$APP_BIN_DIR"
|
||||
mv "$APP_BIN_DIR/MegaGlest.sh" "$APP_BIN_DIR/MegaGlest"
|
||||
mv "$APP_GAME_DIR/lib" "$APP_GAME_DIR/Frameworks"; sleep 0.5s
|
||||
mv "$APP_GAME_DIR/Frameworks" "$APP_PLIST_DIR/"
|
||||
|
||||
echo "creating $PACKAGE"
|
||||
cd "$RELEASEDIR_ROOT"
|
||||
if [ -f "$PACKAGE" ]; then rm -f "$PACKAGE"; fi
|
||||
cd "$RELEASENAME"
|
||||
zip -9r "../$PACKAGE" "MegaGlest.app" >/dev/null
|
||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"
|
||||
|
||||
echo "creating $PACKAGE2"
|
||||
cd "$CURRENTDIR/build"
|
||||
if [ -f "$RELEASEDIR_ROOT/$PACKAGE2" ]; then rm -f "$RELEASEDIR_ROOT/$PACKAGE2"; fi
|
||||
cpack
|
||||
mv -f MegaGlest*.dmg "$RELEASEDIR_ROOT"
|
||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE2"
|
||||
|
||||
cd "$RELEASEDIR_ROOT"
|
||||
find "${RELEASEDIR_ROOT}" -name "MegaGlest*" -type d | xargs rm -rf 2>/dev/null
|
||||
find "${RELEASEDIR_ROOT}" -name "megaglest*" -type d | xargs rm -rf 2>/dev/null
|
Reference in New Issue
Block a user