04 September 2016

Compiling QMC2 and MAME under Mac OS El Capitan/Sierra (Update 02/2017)

Compiling an own QMC2 MacOSX build has been a longstanding target of mine: From time to time, official MacOS binaries have been missing or delayed. In particular installing QT in its legacy version 4.8.7 proved difficult. Homebrew changed this and now the QMC2 compiling process works very well.

Since MAME 0.177 I have also been compiling my own builds under El Captain and later on MacOS Sierra, and it just works.

Compiling QMC2 - the details

(A) The starting point is the QMC2 Wiki - which in the meantime is no longer outdated:

(B) For El Capitan and MacOS Sierra, QT 4.8.7 needs to be installed via Homebrew (as now documented under (A):

Step 1 - go to http://brew.sh

Step 2 - open your Terminal and install Homebrew by copy pasting the entire Terminal command from the window:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step 3 - run the following commands from the Terminal:
brew install qt4
brew linkapps qt (links the qt4 commands to the Applications folder -> that has been a recommendation which I am no longer sure about, but it should be no issue to manually remove the symlinks later on)

Voila, I have a running QT 4.8.7 environment under El Capitan/Sierra :-).

(C) As soon as you have the proper QT environment in place, compiling of QMC2 as explained under (A) worked like a breeze - in short:
Switch to the tmp directory of your MacOSX system via Terminal, then download the source code of QT2 (tmp directory assures that these files are deleted):
svn co https://svn.code.sf.net/p/qmc2/code/trunk qmc2
Then switch into the qmc2 directory:
cd qmc2
Then make the executables (in my example with an alternative image set, otherwise just make):
make IMGSET=crazy
Then install, and make sure that an existing qmc2 directory in the Applications folder is renamed before executing this command:
make install
Means: Without 'sudo make' you cannot overwrite an existing qmc2 directory in Applications - rename it  to e.g 'qmc2.old' beforehand just in case.

But why compiling QMC2 in the first place? First of all, sometimes you have to wait for the Mac binaries for quite some time, and for some versions, they just don't appear online. Secondly, I like building QMC2 with customized icons and without the additional plugins. And finally, compiling from the svn repository is fun :-).

The result is a fairly nice black-themed QMC2, which I quite like. 
Screenshot with Black Theme, Click to enlarge
Compiling MAME - the (not so many) details:

Compiling MAME ever since El Captain is just as easy as it can get. Following the official instructions produces me builds that just work. This also means that these rather complicated build instructions are outdated.

It is just as easy as that:
  • Have XCode and SDL2 installed
  • Download and extract the MAME source code
  • Open Terminal and move to the MAME source code folder
  • make -j5 (if you have a quadcore machine) - drink coffee or tea during the build time
Only the cleanup seems a bit messy to me. Due to the lack of a 'make install' procedure, you must get rid of the source code chunks in your build manually.

Since MAME 0.177 until the current version all builds run without problems.

MAME in Homebrew: This is a very nice initiative. Here you also get all the dependencies installed automagically, and the MAME executable is in $PATH. My only major concern here is that these binaries are some four months behind the latest release, currently 0.179. So if you are not doing your own ROM sets, you can easily run into incompatible games. This is why I would not recommend this route right now (it would be interesting to understand why these builds are way behind).

8 comments:

  1. I've compiled my own version of MAME for some time because I always wanted a build without MESS support which made things easier using Clrmamepro to keep my collection in order and up to date. Now that I learned better how to use Clrmamepro with subsets, I can stick to full builds of MAME.

    I originally compiled Qt manually, but I prefer having some type of organization and record of what I have installed manually, so I switched to using Homebrew. (http://brew.sh )

    Now it's as simple as "brew install qt4 mame"

    ReplyDelete
    Replies
    1. Oh that's great, many thanks. Finally qt4 can be installed decently in El Captain. Just did the update of my post.

      Delete
  2. You can install Homebrew, as your steps show and then from the Terminal enter:

    $ brew install mame

    ReplyDelete
  3. By the way, installing mame via brew downloads all the required dependencies automatically.

    Once mame is installed you can update mame using the command;

    $ brew update -v; brew upgrade -v; brew doctor -v

    Please enter
    $man brew
    to read up on the options I mention above.

    ReplyDelete
    Replies
    1. Hi Alex, I didn't know that mame has reached Homebrew, that is great! But according to braumeister.org, it is no the current version, but 0.179. That would be kind of a showstopper for me because compiling the latest MAME source is no issue and ready SDL binaries are avalable the same day. But many thanks for the hint and your comments!

      Delete
  4. I forgot to mention, you can then enter

    $ mame

    and a very nice command line version of mame opens up

    so again, launch terminal and enter 'mame' and your off to the arcades!

    ReplyDelete
    Replies
    1. I will definitely have a look into it, thanks!!

      Delete
  5. Reminds me that I will freshen it up a bit (again). Things became far less complicated, also and in particular due to Homebrew!

    ReplyDelete

Any comments are welcome!