Commits

richard42  committed d3f2bf6

add OSX build script and instructions

  • Participants
  • Parent commits 3ab967e

Comments (0)

Files changed (2)

File tools/osx_build_bundle.sh

+#!/bin/sh
+
+./m64p_build.sh
+
+mkdir -p mupen64plus.app/Contents/MacOS/
+
+mv test/mupen64plus test/*.dylib mupen64plus.app/Contents/MacOS/
+
+APP_CONTENTS="./mupen64plus.app/Contents"
+
+FIX_LIST="-x $APP_CONTENTS/MacOS/mupen64plus \
+ -x $APP_CONTENTS/MacOS/libmupen64plus.dylib \
+ -x $APP_CONTENTS/MacOS/mupen64plus-audio-sdl.dylib \
+ -x $APP_CONTENTS/MacOS/mupen64plus-input-sdl.dylib \
+ -x $APP_CONTENTS/MacOS/mupen64plus-rsp-hle.dylib \
+ -x $APP_CONTENTS/MacOS/mupen64plus-video-rice.dylib \
+ -x $APP_CONTENTS/MacOS/mupen64plus-video-glide64mk2.dylib"
+ 
+dylibbundler -od -b $FIX_LIST -d $APP_CONTENTS/libs/
+ 
+rm -rf $APP_CONTENTS/Resources
+rm -rf $APP_CONTENTS/SharedSupport
+mkdir -p $APP_CONTENTS/Resources
+mkdir -p $APP_CONTENTS/Frameworks
+mv test/*.ini test/*.ttf $APP_CONTENTS/Resources
+mv test/mupen* $APP_CONTENTS/Resources
+mv test $APP_CONTENTS/SharedSupport
+cp -r /Library/Frameworks/SDL.framework $APP_CONTENTS/Frameworks
+
+mv $APP_CONTENTS/SharedSupport/m64p_test_rom.v64 ./example.v64
+echo './mupen64plus.app/Contents/MacOS/mupen64plus --corelib ./mupen64plus.app/Contents/MacOS/libmupen64plus.dylib --plugindir ./mupen64plus.app/Contents/MacOS --gfx mupen64plus-video-rice "$1"' > run_rice.sh
+echo './mupen64plus.app/Contents/MacOS/mupen64plus --corelib ./mupen64plus.app/Contents/MacOS/libmupen64plus.dylib --plugindir ./mupen64plus.app/Contents/MacOS --gfx mupen64plus-video-glide64mk2 "$1"' > run_glide.sh
+echo -e "Note that Mupen64Plus requires an Intel mac and will not run on PPC macs.\nIt is known to run on OS X 10.8; and most likely also runs on 10.7.\n\nThis application can NOT be opened in the Finder by double-clicking.\n To use, launch the terminal, then cd into the directory that contains mupen64plus.app and use a command like :\n\n    $ ./run_rice.sh  example.v64        # for the Rice video plugin\n    $ ./run_glide.sh  example.v64        # for the Glide64mk2 video plugin\n\n    Note that at this point, the only way to configure Mupen64Plus is to edit the config files in ~/.config/mupen64plus\n\n    If you cannot follow the instructions above then this package is not meant for you =)\n" > Readme.txt
+chmod +x run_rice.sh run_glide.sh
+zip -r mupen64plus-bundle-osx-2.0rc4.zip mupen64plus.app Readme.txt run_rice.sh run_glide.sh example.v64
+

File tools/osx_build_instructions.txt

+OSX build instructions (using OSX 10.8.3 and Xcode 4.6.2):
+
+1. Install SDL framework
+   - go to http://www.libsdl.org/download-1.2.php
+     - download SDL-1.2.15.dmg
+   - Open the DMG and copy SDL.framework to /Library/Frameworks
+     - also, copy devel-lite to your desktop
+   - Build SDLMain.m_o:
+     - open terminal, cd ~/Desktop/devel-lite
+     - run: gcc -c -O3 -I./ -I/Library/Frameworks/SDL.framework/Headers -o SDLMain.m_o SDLMain.m
+2. Install macports
+3. Install the following ports (sudo port install <name>):
+   - bzip2
+   - freetype
+   - libpng
+   - libsamplerate
+   - speex
+   - zlib
+4. Boost requires some special stuff. We must compile with clang and libc++.
+   - edit your /opt/local/etc/macports/macports.conf
+     - add to end: default_compiler	clang
+   - sudo port edit boost
+     - change this line:
+       write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags}\" ${compileflags} <linkflags>\"${configure.ldflags}\" : ;" 
+     - to this:
+       write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags} -std=c++11 -stdlib=libc++\" ${compileflags} <linkflags>\"${configure.ldflags} -stdlib=libc++\" : ;" 
+   - if you have boost already installed in macports, remove it:
+     - sudo port uninstall boost
+   - reinstall boost from source:
+     - sudo port -s install boost
+5. Download the Mupen64Plus source code:
+   - Open terminal window, create build directory for Mupen64Plus
+   - Download and unpack the latest m64p_helper_scripts.tar.gz from: https://code.google.com/p/mupen64plus/wiki/CompilingFromHg
+   - run ./m64p_get.sh
+6. Hack your ui-console makefile to build against SDLMain.m_o:
+   - edit source/mupen64plus-ui-console/projects/unix/Makefile
+     - change line:
+       CFLAGS += $(SDL_CFLAGS)
+     - to:
+       CFLAGS += $(SDL_CFLAGS) ~/devel-lite/SDLMain.m_o -framework Cocoa
+7. Hack your m64p_build.sh script to build under OSX:
+   - change line:
+     "$MAKE" -C source/mupen64plus-${component}/projects/unix all $@
+   - to:
+      if [ "${component}" = "ui-console" ]; then
+          "$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3" LDFLAGS="-Wl,-rpath -Wl,@executable_path/../Frameworks"
+      else
+          "$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3"
+      fi
+8. Build it
+   - copy osx_build_bundle.sh from source/mupen64plus-core/tools to current directory
+   - run ./osx_build_bundle.sh