VCMI for macOS

I’ve figured it out, sdl1 was provided in the xcode-pack. I’ve replaced the frameworks with sdl2. It builds now. (I had to copy libminizip.dylib to the bin directory and the WoG files from 0.95 OS X build because xcode-pack doesn’t have them.)
The game loads, everything is fine until I start a game, when vcmi crashes.

VCMI_Server_log.txt
server_log.txt
VCMI_Client_log.txt

I have same problem with Kuglee, every thing goes well until I clicked the Begin to start a new game. server log is attached below.

16:09:09.109644 DEBUG global [0x7fff70fb4300] - 	Fog of war
16:09:09.111351 DEBUG global [0x7fff70fb4300] - 	Checking objectives
16:09:09.111411 INFO global [0x7fff70fb4300] - Seed after init is 1120231476 (before was 1414224548)
16:09:09.111538 INFO global [0x7fff70fb4300] - Gamestate initialized!
16:09:09.114354 TRACE global [0x7fff70fb4300] - Entering void CGameHandler::run(bool): resume=0.
16:09:09.223966 INFO global [0x7fff70fb4300] - Connection 1 will handle 5 player: 0 1 5 6 255 
16:09:09.224721 TRACE global [0x7fff70fb4300] - Turn 1
16:09:09.226067 TRACE global [0x7fff70fb4300] - Sending to all clients a package of type 11318SetAvailableHeroes
16:09:09.226167 ERROR network [0x7fff70fb4300] - CPack serialized... this should not happen!
16:09:09.226581 ERROR global [0x7fff70fb4300] - Error: signal 11:
16:09:09.238271 ERROR global [0x7fff70fb4300] - 0   vcmiserver                          0x0000000100235be6 _Z17handleLinuxSignali + 38
16:09:09.238545 ERROR global [0x7fff70fb4300] - 1   libsystem_platform.dylib            0x00007fff811b4f1a _sigtramp + 26
16:09:09.238687 ERROR global [0x7fff70fb4300] - 2   ???                                 0x00007fff5fbfb7a8 0x0 + 140734799787944
16:09:09.238863 ERROR global [0x7fff70fb4300] - 3   vcmiserver                          0x0000000100033848 _ZN12CGameHandler12sendAndApplyEP14CPackForClient + 72
16:09:09.239058 ERROR global [0x7fff70fb4300] - 4   vcmiserver                          0x0000000100019b0f _ZN12CGameHandler7newTurnEv + 7583
16:09:09.239260 ERROR global [0x7fff70fb4300] - 5   vcmiserver                          0x00000001000227d3 _ZN12CGameHandler3runEb + 10947
16:09:09.239428 ERROR global [0x7fff70fb4300] - 6   vcmiserver                          0x0000000100233f8a _ZN11CVCMIServer7newGameEv + 170
16:09:09.239623 ERROR global [0x7fff70fb4300] - 7   vcmiserver                          0x00000001002350a5 _ZN11CVCMIServer5startEv + 2965
16:09:09.239814 ERROR global [0x7fff70fb4300] - 8   vcmiserver                          0x0000000100236130 main + 816
16:09:09.240000 ERROR global [0x7fff70fb4300] - 9   libdyld.dylib                       0x00007fff905b85c9 start + 1
16:09:09.240154 ERROR global [0x7fff70fb4300] - 10  ???                                 0x0000000000000002 0x0 + 2

This is related to 2306. As soon as we sort out what’s going on, vcmi will become playable on MacOSX.

I’ve created the gist with instructions how to build VCMI on latest MaxOSX.

Here is a prebuilt package from ff3896b6fe080aabeca59551434e9bc52289579c:

mega.nz/#!0ABEjToZ!_yJTdNo7hb2e … m6svnCn-W0

I followed instructions and It’s work well, but is there a way to use launcher ?

Where all prebuilt stable releases are? Couldn’t find one for version 0.99, so I created it by myself. This package maybe useful for people with «App Transport Security» error.

0.99 dmg for OS X (no launcher, compiled on El Capitan 10.11.6): dl.dropbox.com/s/tzb91n8nuvhsle5/vcmi-0.99.dmg?dl=1

But before you open app, you must install dependencies in Terminal:

brew install smpeg2 innoextract libpng freetype 
brew install sdl sdl2 sdl2_ttf sdl2_image boost
brew install sdl2_mixer --with-smpeg2

After the VCMI installation is complete, perhaps you’d like to change screen resolution. It’s hard without a launcher, but possible to do in a number of ways:
enable «Extra resolutions» mod in launcher on Windows and then copy configuration files from Windows to Mac;
or just download and unzip my packed config: dl.dropbox.com/s/ictmw380ubifkf4/MacOsX_Resolutions.zip?dl=1
Then open VCMI home dir using Terminal:

cd "$HOME/Library/Application Support/vcmi"
open .

and overwrite «config», «downloads», «Mods» folders with unzipped ones.

Thank-you so much! Just one thing. Do you think you could use a tool like dylibbundler (I’m pretty sure there is a brew install for this) to bundle in all required dylibs into your app bundle? (bearing in mind keywords such as @executable_path to link the libraries to the executable) I’ve used it many times and I find the process is quite simple after building. I could do it, but you probably still have the setup.

Thing is not all of us mac users have homebrew installed, and it makes it difficult to use your app in any meaningful way. I myself strongly prefer macports as I feel it is generally a bad idea to mix GNU tools with Apple ones, and have been burned by homebrew in the past. But that’s me.

Thank you, this tool is very helpful. You can download release with included dependencies using this old link:
dl.dropbox.com/s/tzb91n8nuvhsle5/vcmi-0.99.dmg?dl=1

Awesome, seems to work great! Thanks again!

Although I fear, once I installed VCMI from my GoG installer, I am getting

Illegal instruction: 4

when running the client. Not sure what to do about it. I have OSX 10.11.6

EDIT

Strange, worked on my AMD hackentosh just fine, but not on my 2010 MacbookPro. Oh well at least we know it’s not on your end :slight_smile:

It is strange, because I have compiled this app on my Early 2015 MacBook Air MJVP2

Wonder if you built with some cpu feature that is not supported by my older i7…But an AMD fx8370 does.

Hello everyone. If there are any MacOS users who wish to help me with new builds testing please join our Slack:
slack.vcmi.eu/

I already setup automatic build uploading from Travis CI, but Mac builds are broken here and my ability to test them limited since I only have MacOS in VM and I sadly don’t have any Mac compatible GPU to passthrough here.

Ran into the following error on OS/X 10.10.5:

– Found PkgConfig: /usr/local/bin/pkg-config (found version “0.29.2”)
– Checking for module ‘libavcodec’
– No package ‘libavcodec’ found
– Checking for module ‘libavformat’
– No package ‘libavformat’ found
– Checking for module ‘libavdevice’
– No package ‘libavdevice’ found
– Checking for module ‘libavutil’
– No package ‘libavutil’ found
– Checking for module ‘libswscale’
– No package ‘libswscale’ found
– Checking for module ‘libpostproc’
– No package ‘libpostproc’ found
CMake Error at /usr/local/Cellar/cmake/3.5.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find FFmpeg (missing: FFMPEG_INCLUDE_DIRS AVCODEC_LIBRARIES
AVCODEC_INCLUDE_DIRS AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIRS
AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIRS SWSCALE_LIBRARIES
SWSCALE_INCLUDE_DIRS)

Fixed with (probably - installed a few other libs in the process):

brew install ffmpeg

may want to add this to the install instructions. Also the link to sparkle download is outdated (no longer exists).

I almost fixed DMG build, but there is something seriously wrong with Qt magic that make it possible to avoid system libraries usage instead of one bundled with DMG. Though this shouldn’t be a problem for players who don’t have Qt installed system-wide with brew.

I really can’t find out whatever it’s fixed in 5.9.1 or not:
bugreports.qt.io/browse/QTBUG-56814

Also I have weird time with CMake FIXUP_BUNDLE due to one of Boost libraries, but I guess this one would be easier to solve.

Ok problem with Boost library were caused by fact that none of our executables now use “boost-test”, but it’s dependency was still put into the bundle while CMake failed to find what executable need that library. Fixed it by removing it:
github.com/vcmi/vcmi/commit/1b9 … feb27d7757

Sadly can’t fix problem with CMake and BundleUtilities, not many answers are there:
stackoverflow.com/questions/356 … pplication

All I can find is “don’t use bundle utility for Qt” :slight_smile:

UPD: Nice guy @l2y on #qt IRC pointed me to this Kitware project:
github.com/OpenChemistry/avogadroapp
I’ll try to reuse their Qt deployment for VCMI.

Okay all other comments will be on github:
github.com/vcmi/vcmi/pull/351

Starting of game still crashing because of some issues with AI, but builds should have all needed deps for client ans sever bundles:
builds.vcmi.download/PR/351/macOS/