Compiling Zandronum on Mac: Difference between revisions

From Zandronum Wiki
(updated source link)
(updated zan links to https for consistency)
Tag: Source edit
Line 1: Line 1:
==Install dependencies==
==Install dependencies==
[http://zandronum.com/ Zandronum] needs certain tools and development files in order to compile:
[https://zandronum.com/ Zandronum] needs certain tools and development files in order to compile:
*'''Required'''
*'''Required'''
**[https://developer.apple.com/xcode/ Xcode]  
**[https://developer.apple.com/xcode/ Xcode]  
Line 7: Line 7:
**[https://github.com/libsdl-org/SDL/releases/latest SDL2] with [https://github.com/libsdl-org/sdl12-compat/releases SDL 1.2 Compatibility]  
**[https://github.com/libsdl-org/SDL/releases/latest SDL2] with [https://github.com/libsdl-org/sdl12-compat/releases SDL 1.2 Compatibility]  
**[https://github.com/nigels-com/glew/releases GLEW]
**[https://github.com/nigels-com/glew/releases GLEW]
**[http://zandronum.com/essentials/fmod/ FMOD Ex] 4.44.64
**[https://zandronum.com/essentials/fmod/ FMOD Ex] 4.44.64
**[https://www.python.org/downloads/ Python3] (It's Already on the Mac)
**[https://www.python.org/downloads/ Python3] (It's Already on the Mac)
**[https://www.openssl.org/source/ Openssl] ''(for Zandronum 1.3 or later)''
**[https://www.openssl.org/source/ Openssl] ''(for Zandronum 1.3 or later)''

Revision as of 05:37, 30 August 2022

Install dependencies

Zandronum needs certain tools and development files in order to compile:

  • Required
  • Optional
    • Fluidsynth (For Midi Device)
    • zlib (Zandronum has a copy of it and will be statically compiled in if not found)
    • libbzip2 (possibly static)
    • libjpeg (possibly static)
    • HomeBrew or Macports (Not recommended for building using M1 or M2 (ARM64) CPU)
    • Rosetta 2 (for building X86_64 binaries using M1 or M2 (ARM64) CPU)

Installing Xcode

There are 3 ways to install Xcode:

Command line Tools

Open Terminal.app and paste this Command:

xcode-select --install

it will pop up this:

Install it (Beware its big so makes sure you got enough space and it takes awhile depending on your internet and drive speed)

App Store (if you have an newer system)

Xcode (Click the link. It will go straight to the App Store)

Apple developer (if you have an older system)

https://developer.apple.com/download/all/ (Sign In is required. it includes Command line Tools as well)

Installing from HomeBrew or Macports

HomeBrew (MacOS 10.15 - Latest)

brew install jpeg-turbo fluid-synth openssl sdl2 sdl12-compat

MacPorts (Legacy MacOS)

sudo port install jpeg-turbo fluid-synth openssl sdl2 sdl12-compat

Installing CMake GUI and TortoiseHG

Download CMake and TortoiseHG

Open up the DMG and copy them into Applications (or drag them).

Create zandronum_build directory

Into Terminal.app and paste this Command::

mkdir -pv ~/zandronum_build

Compiling SDL12-Compat

If you already have this installed using HomeBrew or Macports. Please skip this section.

Create a Directory like this:

cd  ~/zandronum_build && mkdir -pv sdl_pack

Download SDL2 and SDL 1.2 Compatibility, extract it and add it in to folder we just added above

Or

Clone it:

git clone https://github.com/libsdl-org/sdl12-compat.git && git clone  https://github.com/libsdl-org/SDL.git

Click on the CMake app that you added into the applications, It will give you a warning that you downloaded third party app on mac, Just hit OK.

Click Browse Source, Choose where you put sdl12-compat in then open.

Better if you build it inside the source, So do the same in Browse Build. Add new folder into sdl12-compat called build

When you click Configure it will popup a window choose "Unix Makefile" (Its faster than using Xcode type) and click done

Config how the image looks below it should be like this:

Make Sure you disable SDL12TEST as we don't need it also make it x86_64 as the default arch because we are not using ARM64 till further releases.

When you checkmark advanced mode it should give you SDL2 Section.

Still config only SDL_INCLUDE_DIR Don't worry about the Library.

Generate, then Compile it will give you 2 files.

cd  ~/zandronum_build/sdl_pack/sdl12-compat/build/ && make

TortoiseHG

Open TortoiseHG.app

Go to File -> Clone Repository

Add this line it to the source line:

https://hg.osdn.net/view/zandronum/zandronum-stable

Browse where you put zandronum_build in:

it should be like this:

Click clone

Stable

if you are looking for Stable version go to Repository -> Update

it should pop up like this:

Go to the dropdown and find ZA_3.1 then Update.

You might need to add this patch for bundling an app: (if its does give you the text file download it by Right click and Save as )

https://osdn.net/downloads/users/39/39032/Appbundle.patch/

To add the patch:

Go to Repository -> Import Patches

Browse to find the Appbundle.patch then open and import. (it won't include the icon for Mac OS for some reason)

https://osdn.net/downloads/users/39/39033/zandronum.icns/

Put this icon where you put the source into:

/src/sdl/

Compiling Zandronum

Open the CMake app again

This is a lot because you got to compile most of the dependencies before you could do this next part so read the readme on each source codes. Homebrew and MacPorts are fine

So firstly browse source and build like you did with sdl12-compat.

Click Browse Source, Choose where you put zandronum-stable in then open.

Better if you build it inside the source, So do the same in Browse Build. Add new folder into zandronum-stable called build

When you click Configure it will popup a window choose "Unix Makefile" (Its faster than using Xcode type) and click done

It does show an error that means they couldn't find the rest. So you need to go through each dependence to find the directories and files Then hit Generate.

This is how it looks:

If you see only SDL_INCLUDE_DIR. Add entry and type in SDL_LIBRARY then browse for the Dylib.

Once you done everything, compile

cd  ~/zandronum_build/zandronum-stable/build/ && make -j(nproc)