Compiling Dependencies for Mnemosyne 1.0.x on Mac OS X 10.4 and 10.5

Since it can get a little difficult, here we will list the steps to compile Mnemosyne on Mac OS X.

We're looking for someone to help us build a standalone installer; if you can be of assistance, please contact us.

Compiling yourself -the steps

  1. Install Apple's Developer tools. The Developer tools can be found on any OS X system install disk, or downloaded from the Apple Developer Connection (free registration required).
  2. Install Python 2.4.
  3. Download qt-mac-free-3.3.8.tar.gz from Trolltech. Leopard users will need to apply this patch.
  4. Install SIP.
  5. Install PyQt3 for Mac.
  6. Install PyXML, PyGame, and PyObjC.
  7. Install Mnemosyne.

Alternate option- Using Fink (works on 10.4 or earlier, not 10.5/Leopard)

Rich shares the following:

I've had a lot of success using Fink to install various command line tools into OS X 10.4.11, including newer Python and gcc versions than Apple provides; X11 applications have been more of a mixed bag, but the Mnemosyne install went well with just a couple of tricks.

For any who might not know, Fink is a port of the Debian packaging system to OS X.

http://finkproject.org/

There's a GUI, Fink Commander, which makes dealing with the thousands of packages available a little easier. The GUI isn't very Mac-like and it still helps to know a little bit about how apt-get works; the various functions in the GUI seem a little thrown together and confusing. You also need to enable use of the "unstable" repositories - lots of perfectly usable and stable programs there.

Fink puts everything it installs in its own tree under /sw so it doesn't clobber anything else you have. The tricks involve getting Mnemosyne installed and running correctly from there also.

I'm just running a G4 so all the compiling took several hours. Also, I'll note that I've read that getting X11 and Fink running correctly on Leopard currently requires some patching. I'm staying with Tiger for a little while yet.

That said, I used Fink to install the latest versions of the various Mnemosyne dependencies listed above.

Specifically, I used Fink to install from source these packages:

  • python25 1.2.5.2-1
  • qt3mac 3.3.8-12
  • sip-py25 4.7.4-1
  • pyqt-py25 3.17.4-2
  • pyxml-py25 0.8.4-1
  • pygame-py25 1.7.1release-1005
  • pyobc-py25 1.4-2

These brought a number of their own dependencies along, which I just let Fink handle; Fink tends to handle dependencies quite intelligently, which is one of the reasons it's such a useful tool.

The first thing was to get Mnemosyne to install into /sw/bin. I had to juggle my PATH environmental variable around so /sw/bin was higher in priority than paths to other versions of Python that I have installed. You may not have to do this, depending on what you have installed on your machine. I also, as root, put this symbolic link into /sw/bin: python -> python2.5

Now, running 'python setup.py install' in the folder where I had unarchived Mnemosyne installed the program correctly into /sw/bin using Python 2.5.2.

Then I had to edit, again as root, the resulting mnemosyne file and change the first line from
#!/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
to
#!/sw/bin/python

Now I can run Mnemosyne from an Xterm window and it comes up quickly as an X11 app and functions well. The only irritant is that I have to run xclipboard to get Aqua to X11 pasting to work, but I've found that's not unusual with X11 apps on OS X. Mnemosyne does use my Latex installation, which is great.

I hope somebody else find this procedure useful; it seemed simpler to me to let Fink do most of the work than to download and compile all the dependencies separately as described in the Mnemosyne documentation.

--Rich

Alternate Option- Using Macports (Works on 10.5/Leopard)

Konrad shares the following:

I've managed to install Mnemosyne on Leopard using MacPorts, here's how:

Install the XCode development tools from the CD

Install macports from http://www.macports.org/
Usage information can be found on http://guide.macports.org/#using.port

There's an error in the repository, version 4.7.4 of py-sip cannot downloaded. To fix this, edit the port file:

$ sudo vim /opt/local/var/macports/sources/rsync.macports.org/release/ports/python/py-sip/Portfile
-> Change version to 4.7.5 from 4.7.4
-> Remove the existing checksums:
checksums md5 3bae6d0fb931fe2ddcd6f6c1da245afa \
sha1 be35863fae6a14f092cd3ce47c3ab545b9233168 \
rmd160 8682a1e5cbf0f8b42f3ebe99d4b9e0b363ce8034
-> Add the following new checksum
checksums md5 32b3f3cc1afe5e73349f89a47ea27ed2

Try to install py-pyqt3
$ sudo port install py-pyqt3

This will fail because an extra patch is needed for Leopard:
$ cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_aqua_qt3-mac/work/
$ curl 'http://fink.cvs.sourceforge.net/*checkout*/fink/dists/10.4/unstable/main/finkinfo/graphics/qt3mac.patch2' | sudo patch -p0

Try again, this time it should succeed:
$ sudo port install py-pyqt3

Install the remaining packages:
$ sudo port install py-xml py-game py-pyobjc2
This will fail, run the command again until no errors occur anymore.

Install mnemosyne using the python binary from the ports:
$ tar -xvzf mnemosyne-1.0.1.1.tgz
$ cd mnemosyne-1.0.1.1/
$ sudo /opt/local/bin/python2.4 setup.py install

The binary is now inconveniently installed as:
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/mnemosyne
You can create a symlink to your ~/bin directory for convenience:
$ ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/mnemosyne ~/bin/mnemosyne

Enjoy!

More information can be found on this thread: http://sourceforge.net/forum/message.php?msg_id=4974125