Install routine for MacOS X.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1776 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.4:
|
||||
- Installation routine for MacOS X, from Nic.
|
||||
- Lots and lots of dialog fixes, from Nic.
|
||||
- Some speech is dependant on whether spoken voices are on, from Nic.
|
||||
- OpenAL header cleanup. Updating OpenAL may be necessary.
|
||||
|
||||
@@ -56,7 +56,18 @@ uqm_requirements()
|
||||
uqm_prepare_config()
|
||||
{
|
||||
# Describe the menu:
|
||||
MENU_main_ITEMS="debug graphics sound ioformat install_path"
|
||||
MENU_main_ITEMS="debug graphics sound ioformat"
|
||||
case "$HOST_TYPE" in
|
||||
Darwin)
|
||||
# Installation directory not modifiable
|
||||
;;
|
||||
MINGW32*)
|
||||
# No install procedure available for MinGW
|
||||
;;
|
||||
*)
|
||||
MENU_main_ITEMS="$MENU_main_ITEMS install_path"
|
||||
;;
|
||||
esac
|
||||
MENU_main_TITLE="Main menu"
|
||||
MENU_main_ITEM_debug_TYPE=CHOICE
|
||||
MENU_main_ITEM_graphics_TYPE=CHOICE
|
||||
@@ -213,12 +224,11 @@ uqm_process_config() {
|
||||
|
||||
# Set INSTALL_LIBDIR, INSTALL_BINDIR, and INSTALL_SHAREDIR to the specified
|
||||
# values, replacing '$prefix' to the prefix set.
|
||||
prefix="$INPUT_install_prefix_VALUE" \
|
||||
eval INSTALL_BINDIR="${INPUT_install_bindir_VALUE%/}/"
|
||||
prefix="$INPUT_install_prefix_VALUE" \
|
||||
eval INSTALL_LIBDIR="${INPUT_install_libdir_VALUE%/}/"
|
||||
prefix="$INPUT_install_prefix_VALUE" \
|
||||
eval INSTALL_SHAREDIR="${INPUT_install_sharedir_VALUE%/}/"
|
||||
local prefix
|
||||
prefix="$INPUT_install_prefix_VALUE"
|
||||
eval INSTALL_BINDIR="${INPUT_install_bindir_VALUE%/}/"
|
||||
eval INSTALL_LIBDIR="${INPUT_install_libdir_VALUE%/}/"
|
||||
eval INSTALL_SHAREDIR="${INPUT_install_sharedir_VALUE%/}/"
|
||||
|
||||
# Set the content dir
|
||||
CONTENTDIR="${INSTALL_SHAREDIR}uqm/content"
|
||||
@@ -284,8 +294,81 @@ uqm_pre_install() {
|
||||
: # Nothing to do
|
||||
}
|
||||
|
||||
uqm_install() {
|
||||
case "$HOST_TYPE" in
|
||||
Darwin)
|
||||
uqm_install_osx
|
||||
;;
|
||||
MINGW32*)
|
||||
echo "No installation procedure available for MinGW."
|
||||
echo "Read the manual for more information."
|
||||
;;
|
||||
*)
|
||||
generic_install
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
uqm_post_install() {
|
||||
: # Nothing to do
|
||||
}
|
||||
|
||||
uqm_install_osx() {
|
||||
local VERSION HEADERS HEADER FRAMEWORK
|
||||
|
||||
VERSION=`head -1 content/version`
|
||||
|
||||
INSTROOT="$BUILD_WORK/The Ur-Quan Masters.app/Contents"
|
||||
|
||||
# Make directory structure
|
||||
mkdirhier "$INSTROOT/MacOS" 0755
|
||||
mkdirhier "$INSTROOT/Frameworks" 0755
|
||||
mkdirhier "$INSTROOT/Resources/Launcher.nib" 0755
|
||||
mkdirhier "$INSTROOT/Resources/content/packages/addons" 0755
|
||||
|
||||
# Install misc. resources, icons, etc.
|
||||
$SED "s/@@VERSION@@/$VERSION/g" src/res/darwin/Info.plist > \
|
||||
"$INSTROOT/Info.plist"
|
||||
cp src/res/darwin/PkgInfo "$INSTROOT"
|
||||
cp "src/res/darwin/The Ur-Quan Masters.icns" "$INSTROOT/Resources"
|
||||
cp src/res/darwin/Launcher.nib/objects.nib \
|
||||
"$INSTROOT/Resources/Launcher.nib"
|
||||
|
||||
# Find Frameworks and copy them into the application.
|
||||
HEADERS="Ogg/Ogg.h SDL/SDL.h SDL_image/SDL_image.h Vorbis/vorbisfile.h"
|
||||
if [ "$uqm_SOUNDMODULE" = openal ]; then
|
||||
HEADERS="$HEADERS OpenAL/al.h"
|
||||
fi
|
||||
for HEADER in $HEADERS; do
|
||||
HEADER=`basename $HEADER`
|
||||
eval FRAMEWORK=`echo '' | \
|
||||
$COMPILE -E -D__MACOSX__ -include $HEADER - | \
|
||||
awk '(/'$HEADER'/ && $2 == 1) { print $3; exit }' | \
|
||||
$SED 's/.Headers.*$/"/'`
|
||||
cp -r "$FRAMEWORK" "$INSTROOT/Frameworks"
|
||||
done
|
||||
|
||||
# Install game content (it should probably make a zipfile)
|
||||
cp content/starcon.key content/version "$INSTROOT/Resources/content"
|
||||
(cd content && \
|
||||
find .\( -name CVS -o -name packages \) -prune -o \
|
||||
\! \( -type d -o -name packages -o -name CVS -o \
|
||||
-name starcon.key -o -name version -o -name \*.ogg \) \
|
||||
-print | $SED 's/^..//' | zip -@ uqm-${VERSION}-prv-content.uqm)
|
||||
mv content/uqm-$VERSION-prv-content.uqm "$INSTROOT/Resources/content/packages"
|
||||
|
||||
(cd content && \
|
||||
find . -name \*\[0-9\]\[0-9\]\[0-9\].ogg -print \
|
||||
| $SED 's/^..//' | zip -0 -@ uqm-${VERSION}-prv-voice.uqm)
|
||||
mv content/uqm-$VERSION-prv-voice.uqm "$INSTROOT/Resources/content/packages"
|
||||
|
||||
(cd content && \
|
||||
find . -name \*.ogg -a \! -name \*\[0-9\]\[0-9\]\[0-9\].ogg \
|
||||
-print | $SED 's/^..//' | zip -0 -@ uqm-${VERSION}-prv-3domusic.uqm)
|
||||
mv content/uqm-$VERSION-prv-3domusic.uqm "$INSTROOT/Resources/content/packages"
|
||||
|
||||
# Install game binary (and rename it)
|
||||
cp $uqm_NAME "$INSTROOT/MacOS/The Ur-Quan Masters"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -321,6 +321,11 @@ installsome() {
|
||||
|
||||
# Install the program
|
||||
build_install() {
|
||||
eval "${TARGET}_install"
|
||||
}
|
||||
|
||||
# Generic installation routine
|
||||
generic_install() {
|
||||
local SRC DEST MODE OWNER
|
||||
|
||||
eval "${TARGET}_pre_install"
|
||||
|
||||
Reference in New Issue
Block a user