coelckers / prboom-plus

This is a cleaned up copy of the PrBoom+ SVN repository as a courtesy for those interested in forking that port
295 stars 118 forks source link

Add build instructions for MacOS #538

Open Pedro-Beirao opened 2 years ago

Pedro-Beirao commented 2 years ago

Github doesnt support PRs for the wiki, so I guess this is the best way to do it.

Link to the wiki page I created: https://github.com/Pedro-Beirao/prboom-plus/wiki/Building-PrBoom-Plus-on-MacOS

UnBeatWaterGH commented 1 year ago

Already got it building without your instructions! And it's the UMAPINFO branch!

UnBeatWaterGH commented 1 year ago

Which I wasn't able to compile before, fixed my build setup a bit. Functional build with tiny edit to DUMBPlayer.c

fabiangreffrath commented 1 year ago

What was that necessary edit to dumbplayer.c?

UnBeatWaterGH commented 1 year ago

#define DUMB_OFF_T_CUSTOM off64_t had to be changed to #define DUMB_OFF_T_CUSTOM off_t

fabiangreffrath commented 1 year ago

I see, current GIT has int64_t. Thanks!

UnBeatWaterGH commented 1 year ago

And then a working build came out! Extra lines I added to .zshrc:

export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH:+${CPLUS_INCLUDE_PATH}:}/opt/homebrew/include"
export LIBRARY_PATH="${LIBRARY_PATH:+${LIBRARY_PATH}:}/opt/homebrew/lib"

Added to fix building basically anything.

fraansg commented 1 year ago

@Pedro-Beirao, in my opinion, it's necessary to modify the command that you recommend to use to compress, because: 1) the -j option is incompatible with:

ylibbundler -od -b -x ./prboom-plus -d ./libs/ -p @executable_path/libs

Because junks the directory names, inclusive @executable_path/libs (-j wouldn't affect if the -p flag will not be used by ylibbundler), to conserve the directories names is necesary the -r flag. And, 2) also, if don't use zip -x, the utility compresses the finder (.DS_Store) files.

It's better to use this (and, in my opinion, point working directory as target):

zip -r ./prboom-plus-$(date +"%Y%m%d")-mac.zip . -x .\*

Another aspect to modify is the name of the "libmad" library to "mad" in this line:

brew install cmake pcre sdl2 sdl2_net sdl2_image sdl2_mixer fluid-synth portmidi libmad dumb libvorbis

Homebrew uses the "mad" formula name for the decoder, and the use of alternative formulae names, like "libmad", may cause errors when call brew doctor.

fraansg commented 1 year ago

And then a working build came out! Extra lines I added to .zshrc:

export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH:+${CPLUS_INCLUDE_PATH}:}/opt/homebrew/include"
export LIBRARY_PATH="${LIBRARY_PATH:+${LIBRARY_PATH}:}/opt/homebrew/lib"

Added to fix building basically anything.

Why you need to links the opt/homebrew/* path if brew automatically links the formulae files in /usr/local/include and /usr/local/lib? The only exceptions by default to this automatically linking are the keg only formulae.

Also, in my opinion it is not recommended to modify the .zshrc file to solve eventual compilation problems, when they can be configured in external files that are sourced by zsh when required.

I'm make it present, because I think it is a unoptimal option to be recommended in an eventual instructions file (or wiki article) about how to compile on macOS.

Pedro-Beirao commented 1 year ago

I saw that you made a PR for dsda-doom to fix this there, but since this PR was never merged, I didnt change it here.

I'll do that later today. Thanks!

UnBeatWaterGH commented 1 year ago

And then a working build came out! Extra lines I added to .zshrc:

export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH:+${CPLUS_INCLUDE_PATH}:}/opt/homebrew/include"
export LIBRARY_PATH="${LIBRARY_PATH:+${LIBRARY_PATH}:}/opt/homebrew/lib"

Added to fix building basically anything.

Why you need to links the opt/homebrew/* path if brew automatically links the formulae files in /usr/local/include and /usr/local/lib? The only exceptions by default to this automatically linking are the keg only formulae.

Also, in my opinion it is not recommended to modify the .zshrc file to solve eventual compilation problems, when they can be configured in external files that are sourced by zsh when required.

I'm make it present, because I think it is a unoptimal option to be recommended in an eventual instructions file (or wiki article) about how to compile on macOS.

You gotta understand. I don't recommend doing what I did, it's just what got the project building for me.

UnBeatWaterGH commented 1 year ago

It's just me wanting to document MY process, which doesn't mean THE best process. Since it's MY process. You are allowed to have whatever opinion you want, but just remember. I added those lines because it got the project building, which doesn't mean that it's the best choice to do so.

Pedro-Beirao commented 1 year ago

Edited the wiki on my fork with your suggestions. Thanks again!