Closed soulweaver91 closed 7 years ago
Fix for the compile failure found and more progress done. New script:
# Install required packages
brew install qt5 sfml
brew link qt5 --force
cd ~
# Download BASS and BASS FX
curl -o bass24.zip http://us.un4seen.com/files/bass24-osx.zip
curl -o bassfx24.zip http://us.un4seen.com/files/z/0/bass_fx24-osx.zip
unzip bass24.zip -d bass
unzip bassfx24.zip -d bassfx
rm bass24.zip bassfx24.zip
# Set up the necessary environment
export BASS_DIR=~/bass
export BASS_FX_DIR=~/bassfx
export SFML_DIR=/usr/local/Cellar/sfml/2.4.1
# Clone this repository and compile the code
git clone https://github.com/soulweaver91/project-carrot.git
cd project-carrot
qmake -spec macx-clang
make release
# Copy Qt and SFML dependencies into the bundle (only necessary for distribution)
macdeployqt Release/CarrotQt5.app
# Copy the BASS and BASS FX library files into the bundle
mkdir -p Release/CarrotQt5.app/Contents/Plugins/
cp -r $BASS_DIR/libbass.dylib Release/CarrotQt5.app/Contents/Plugins/
cp -r $BASS_FX_DIR/libbass_fx.dylib Release/CarrotQt5.app/Contents/Plugins/
install_name_tool -change @loader_path/libbass.dylib @executable_path/../Plugins/libbass.dylib Release/CarrotQt5.app/Contents/MacOS/CarrotQt5
install_name_tool -change @loader_path/libbass_fx.dylib @executable_path/../Plugins/libbass_fx.dylib Release/CarrotQt5.app/Contents/MacOS/CarrotQt5
After this, it starts up. The path it tries to find the files from is wrong, though, and as a result it bails out after failing to load the fonts.
With the debug config that uses the current directory always, we're getting past that, but:
http://pastebin.com/BRq8aigD :boom:
Apparently sf::RenderWindow::create((sf::WindowHandle)winId());
is what crashes it. There's some special code for X11 right above it, so maybe there needs to be a bit more of something for it to work properly.
:tada:
The question is, what was the relevant change when built via Xcode? The only new code difference was fixing the directory the resources are searched from.
Now that I have a device for this, the support for macOS should be considered. So far, this script derived naïvely from the Linux one seems to be close to what is needed:
This works well, until the part where it doesn't compile 😛
Things to add to repo or fix:
std::sort()
ingTilemapLayer
s. Of course, that might not be the only part that needs fixing.$(BASS_FX_DIR)
needs to be added to theINCLUDEPATH
(and possibly elsewhere) inCarrotQt5.pro
.SFML_DIR
should be version agnostic. If a link is added for it somewhere, using that would be advised. (Does the apt package for Linux set this environment var automatically? It's missing from the Linux script.)