Building EDuke32 on macOS: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Distribution intro}}
{{Distribution intro}}


You can get help here: http://forums.duke4.net/topic/4242-building-eduke-on-mac-os-x/
EDuke32 supports macOS.


== Getting source files ==
== Prerequisites ==
* 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 ==
Install the Xcode command line utilities and [http://brew.sh/ Homebrew].


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.
Run the following in a terminal window:


=== Compiler ===
brew install make sdl2 flac libvpx


#Install Xcode.
== Building ==
#: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 ===
Type <code>gmake -j4</code> and hope for the best! For debug builds, run <code>gmake RELEASE=0</code>.
 
==== Special notes for 10.5/Leopard users ====
 
Users on 10.5 should follow the [[#PowerPC Macs|PowerPC]] directions (including on how to set up MacPorts), even if they have an Intel Mac since the script assumes PowerPC support when run under Leopard. If you'd rather not build the PowerPC version then follow the [[#Intel Macs|Intel]] directions, remembering to call the osxbuild.sh script with the noppc parameter to prevent the PowerPC version from being built. If your Mac has a 64-bit capable CPU (Core 2 Duo or later), you may also want to enable the 64-bit build as well using the directions that follow.
 
The 64-bit build is also disabled on Leopard by default. If you wish to enable it and don't care about the PowerPC build then you have to call osxbuild.sh with the <code>--build64=1 --buildppc=0</code> command line parameters and follow the [[#Intel Macs|Intel]] directions below. (64-bit here refers to x86_64, there's no equivalent 64-bit build for PowerPC so even if you have a 64-bit capable PowerPC processor, don't enable this unless you're trying to create a three-way universal binary as defined below)
 
If, on the other hand, you want to compile a three-way universal binary containing the PowerPC, x86 and x86_64 versions, things get a little more complicated. You not only have to manually enable the 64-bit build as outlined above, but you also have to make sure all but one of the dependency ports are compiled three-way universal as well. The procedure here is much the same as the [[#PowerPC Macs|PowerPC]] directions below, but with a few exceptions: To start with, you need ppc, i386 and x86_64 all in your macports.conf universal_archs line. Use that to install the pkgconfig, libsdl_framework and libsdl_mixer-framework ports, but after you've finished installing those go back into macports.conf and remove ppc from the universal_archs before installing the libvpx port. You can put ppc back afterward if you want, but it's essential to remove it in order to build libvpx.
 
==== Common Setup ====
 
First, install [http://www.macports.org/ MacPorts]. Make sure you have the correct version for your OS X version.
 
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:
 
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 that i386 and ppc are there if you have a PowerPC (G4, G5) Mac.
 
All builds have the pkg-config port in common, so start by installing that:
 
sudo port install pkgconfig
 
Again, entering your password if prompted.
 
==== PowerPC Macs ====
 
Since there are no PowerPC compatible versions of the latest SDL [[#Frameworks|frameworks]] you need to use MacPorts to compile and install appropriate versions. To do that, type:
 
sudo port install libsdl-framework libsdl_mixer-framework
 
at your terminal and hit enter. A slight hiccup here is that MacPorts installs them into /opt/local/Library/Frameworks and eDuke32 expects to find them in /Library/Frameworks. Fixing that is a simple matter of typing the following at your terminal:
 
sudo ln -s /opt/local/Library/Frameworks/SDL.framework /Library/Frameworks/
sudo ln -s /opt/local/Library/Frameworks/SDL_mixer.framework /Library/Frameworks/
 
Once that's done you can skip to [[#Final Steps|Final Steps]] below.
 
==== Intel Macs ====
 
Intel users can download the SDL frameworks from the links [[#Frameworks|below]] and drag them from the DMG files into /Library/Frameworks (you may be prompted for your password as part of this process).
 
Intel builds also need the libvpx port. To install that, type:
 
sudo port install libvpx
 
followed by enter.
 
Finally, continue to running osxbuild.sh as outlined in the next [[#Final Steps|section]]
 
=== Final Steps ===
 
#The necessary [[#Frameworks|Frameworks]] should be installed globally.
#Run <code>./osxbuild.sh</code> and hope for the best!
 
== osxbuild.sh Documentation ==
 
usage: ./osxbuild.sh [options]
options:
    [--buildppc=<0|1>] [--build86=<0|1>] [--build64=<0|1>]
    [--debug=<0|1>]
    [--main=<0|1>] [--tools=<0|1>]
    [--pack=<0|1>]
presets:
    [onlyzip] [dist] [disttools] [full]
 
*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.
**'''--debug''' sets additional building of the debugging builds. Currently, it defaults to off.
**'''--main''' controls building of the main executables.
**'''--tools''' controls building and installation of the [[Build tools]].
**'''--pack''' controls creation of a zip file with the results at the conclusion of the process.
*The following options are mutually exclusive and control preset values for the above switches.
**'''onlyzip''' will skip building any executables and simply package the zip file. Mostly for internal use.
**'''dist''' will build all architectures and both release and debug builds of just the main executables, then pack them.
**'''disttools''' will build all architectures and both release and debug builds of just the [[Build tools]].
**'''full''' builds ''everything''.
 
== 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]
**[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].


== Game Data ==
== 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:
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>.


*<code>/Library/Application Support/EDuke32/</code>
== Play ==
*<code>~/Library/Application Support/EDuke32/</code>
*in the same directory as the .app bundle
*in the same directory as the binary


== External Links ==
Once everything is in place, you should be able to run the .app bundle. Enjoy!
*Deprecated guide: http://www.spam-filter.de/osx/eduke32_on_os_x


[[Category:Distribution documentation]]
[[Category:Distribution documentation]]

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!