Building EDuke32 on macOS: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
You can get help here: http://forums.duke4.net/topic/4242-building-eduke-on-mac-os-x/
{{Distribution intro}}


== Getting source files ==
EDuke32 supports macOS.
* Current version (You need to install the ''subversion'' program) :
<pre>svn co https://eduke32.svn.sourceforge.net/svnroot/eduke32/polymer/eduke32</pre>
* [http://dukeworld.duke4.net/eduke32/synthesis Source tarballs] (Lite subversion snapshots, it does not include metadata, Apple compiled libraries, third-party jaudiolib and Photoshop files).
* [http://dukeworld.duke4.net/eduke32/synthesis/old/ Old] and [http://dukeworld.duke4.net/eduke32/old_versions/source_code/ Older versions].


== Build Setup ==
== Prerequisites ==


Before you begin, you're going to need a Developer account with Apple. These are free and can be created by heading over to the [https://developer.apple.com/devcenter/mac/index.action Mac Dev Center], clicking the 'Register' link toward the top right hand corner and answering a few questions. If you already have an Apple ID, then you can link your developer account to that. Just enter it when it asks and continue through the registration process.
Install the Xcode command line utilities and [http://brew.sh/ Homebrew].


=== Compiler ===
Run the following in a terminal window:


#Install Xcode.
brew install make sdl2 flac libvpx
#:Versions of Mac OS X distributed on CD or DVD typically include a version of Xcode, but these are possibly quite old and only the latest versions of Xcode for each supported version of OS X have been tested:
#:'''Leopard (Mac OS X 10.5.x):''' 3.1.4
#:'''Snow Leopard (Mac OS X 10.6.x):''' 3.2.6
#::Note: The last few versions of Xcode 3.2 for Snow Leopard also include the iOS SDKs which blow the DMG size out to 3GB and beyond. If you want to avoid that then you ''might'' be able to substitute version 3.2.2 instead, but bear in mind this hasn't been tested.
#:'''Lion (Mac OS X 10.7.x):''' 4.3.1 (Although 4.2.1 and 4.3.0 are also known to work under Lion)
#::Even though you can download Xcode itself through the App Store without a Developer ID, you still need one later to install the mobile device SDKs when you first run Xcode and to install the command line tools.
#:To find the version of Xcode you need go to the [https://developer.apple.com/downloads/ Downloads] section of the developer center and run a search for that specific version (e.g.: Xcode 3.1.4) using the search box in the top left corner.
#Download and install the Xcode command line tools (Xcode 4.3.x under Lion only):
#:Starting with Xcode 4.3, Apple no longer includes the command line build tools within the standard Xcode distribution. In order to install them you have to open Xcode, go into its preferences dialog (Xcode -> Preferences in the menu bar or Command+,) and, in the 'Downloads' tab, click 'Install' next to 'Command Line Tools'. At this point you'll be prompted for your Developer ID.  Just enter it and your password and it should be on its way.


=== MacPorts ===
== Building ==


First, install [http://www.macports.org/ MacPorts]. Make sure you have the correct version for your OS X version.
Type <code>gmake -j4</code> and hope for the best! For debug builds, run <code>gmake RELEASE=0</code>.


You then need to edit a couple of MacPorts' config files to make sure it builds what's needed correctly. At a terminal prompt, type:
== Game Data ==
 
sudo nano /opt/local/etc/macports/variants.conf
 
When prompted, enter your password and hit enter then add the following to the end of the file:
 
+universal
+no_x11
 
Then hold down Ctrl and press X to exit nano. You'll be asked if you want to save the file. Press 'Y'.
 
Now you have to make sure the architecturally relevant versions of things are being built by typing:
 
sudo nano /opt/local/etc/macports/macports.conf
 
Enter your password again if prompted and then scroll down until you get to the "'''universal_archs'''" line and make sure both i386 and x86_64 are in there if you have an Intel Mac (Core Duo, Core 2 Duo. Core i* or Xeon) and ppc is there if you have a PowerPC (G4, G5) Mac and/or are running a version of OS X earlier than Lion.
 
Now, here's where things start getting a little complicated. The ports you need to install and how you install them depend on what type of Mac you have and what sort of binary you ultimately want to produce. At the very least, you need pkg-config, so start by installing that:
 
sudo port install pkgconfig
 
If you're on a PowerPC Mac or want to create a universal binary that includes PowerPC support (only applicable for Leopard, since Lion has no PowerPC support at all and PowerPC binaries produced under Snow Leopard don't work under Leopard) then you need to make sure you have a set of support frameworks that have PowerPC support built in. That's covered at the end of the [[#Frameworks|Frameworks]] section toward the end of this document.
 
Finally, you need to install the libvpx port. This is currently only necessary for the x86_64 build, so if you're on PowerPC you can skip this step entirely, but if you're on an Intel Mac and trying to create a Universal Binary under Leopard, you have to make sure that ppc is absent from your universal_archs line in macports.conf since libvpx doesn't build on PowerPC then just type:
 
sudo port install libvpx
 
again entering your password if prompted.
 
=== Final Steps ===
 
#The necessary [[#Frameworks|Frameworks]] should be installed globally.
#Run <code>./osxbuild.sh</code> and hope for the best!
 
== osxbuild.sh Documentation ==
 
echo usage: osxbuild [onlyzip] [--buildppc=<0|1>] [--build86=<0|1>] [--build64=<0|1>] [--tools=<0|1>] [--debug=<0|1>]
 
*'''onlyzip''' will skip building the executable and simply package it into a zip file. Mostly for internal use.
*The following options take either '''0''' or '''1''' as a parameter to disable or enable the option in a [[binary switch]] fashion.
**'''--buildppc''', '''--build86''', and '''--build64''' set the PowerPC, x86, and x86_64 builds respectively.
**'''--tools''' builds and installs the Build tools in addition to the main executables.
**'''--debug=''' sets additional building of the debugging builds. Currently, it defaults to off.
 
== Frameworks ==
 
[[File:macosx_frameworks_missing.png|right|This error will be displayed if EDuke32's required frameworks are not installed. You may click "ignore".]]
 
EDuke32 requires the following frameworks to function:


*[http://www.libsdl.org/download-1.2.php SDL.framework]
If you own a digital copy of the game with native support for macOS, EDuke32 will automatically detect its default install location and use any game data it finds! Otherwise, [[Installation and configuration|to play the game]], the files you need are DUKE3D.GRP and DUKE.RTS. They, as well as any other data you have, such as music packs and mods, can be placed in <code>~/Library/Application Support/EDuke32/</code>.
**[http://www.libsdl.org/release/ (old versions)]
*[http://www.libsdl.org/projects/SDL_mixer/ SDL_mixer.framework]
**[http://www.libsdl.org/projects/SDL_mixer/release/ (old versions)]
 
The error message at the right will be displayed if these frameworks are not properly installed. You may install these at any or all of the following locations:
 
*Global: <code>/Library/Frameworks</code>
*Per-User: <code>~/Library/Frameworks</code>
*Per-App (Portable): <code><app bundle>/Contents/Frameworks</code>
 
For more information see [https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html#//apple_ref/doc/uid/20002261-BBCCFBJA the relevant article on the Mac OS X Developer Library].
 
=== PowerPC Support ===
 
If you're on a PowerPC Mac, you can install the libsdl-framework and libsdl_mixer-framework ports (<code>sudo port install libsdl-framework libsdl_mixer-framework</code>) in order to get PowerPC-compatible versions of the frameworks. However, MacPorts installs them in /opt/local/Library/Frameworks. In order to get them into /Library/Frameworks, type the following at a terminal prompt:
 
cd /Library/Frameworks
sudo ln -s /opt/local/Librarary/Frameworks/SDL.framework
sudo ln -s /opt/local/Librarary/Frameworks/SDL_mixer.framework
 
== Game Data ==


[[Installation and configuration|To play the game]], the files you need are DUKE3D.GRP and DUKE.RTS. They, as well as any other data you have, such as the HRP, music packs, and mods, can be placed in the following locations, depending on the circumstances in which you want them to be used:
== Play ==


*<code>/Library/Application Support/EDuke32/</code>
Once everything is in place, you should be able to run the .app bundle. Enjoy!
*<code>~/Library/Application Support/EDuke32/</code>
*in the same directory as the .app bundle
*in the same directory as the binary


== External Links ==
[[Category:Distribution documentation]]
*Deprecated guide: http://www.spam-filter.de/osx/eduke32_on_os_x

Latest revision as of 21:09, 21 December 2023

EDuke32 Distribution

Download · Source Code · APT repository · Packages
Building from source on: Linux · Windows · macOS


EDuke32 supports macOS.

Prerequisites

Install the Xcode command line utilities and Homebrew.

Run the following in a terminal window:

brew install make sdl2 flac libvpx

Building

Type gmake -j4 and hope for the best! For debug builds, run gmake RELEASE=0.

Game Data

If you own a digital copy of the game with native support for macOS, EDuke32 will automatically detect its default install location and use any game data it finds! Otherwise, to play the game, the files you need are DUKE3D.GRP and DUKE.RTS. They, as well as any other data you have, such as music packs and mods, can be placed in ~/Library/Application Support/EDuke32/.

Play

Once everything is in place, you should be able to run the .app bundle. Enjoy!