Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Add build instructions for MacOS #538

Open
Pedro-Beirao opened this issue Oct 17, 2022 · 12 comments
Open

Add build instructions for MacOS #538

Pedro-Beirao opened this issue Oct 17, 2022 · 12 comments

Comments

@Pedro-Beirao
Copy link
Contributor

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
Copy link

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

@UnBeatWaterGH
Copy link

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

@fabiangreffrath
Copy link
Collaborator

What was that necessary edit to dumbplayer.c?

@UnBeatWaterGH
Copy link

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

@fabiangreffrath
Copy link
Collaborator

I see, current GIT has int64_t. Thanks!

@UnBeatWaterGH
Copy link

UnBeatWaterGH commented Jan 24, 2023

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
Copy link
Contributor

fraansg commented Jan 31, 2023

@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
Copy link
Contributor

fraansg commented Jan 31, 2023

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
Copy link
Contributor Author

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
Copy link

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
Copy link

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
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants