MacOSX Development
This page describes the information you need for development of calibre under MacOSX 10.5 Leopard.
Installing the essentials
The attached build-* scripts are scripts to build various dependencies from source on OS X Tiger. They should work with minor adjustments on Leopard. To run them, first download the source of the package and extract it into the ~/build directory. Then run the script with /bin/bash /path/to/script (take a look in the build files and ensure that the paths are correct).
Installing Bazaar
Go and get the actual release of Bazaar on bzr Download page.
Bazaar 1.5 works well for MacOSX 10.5.
After installing Bazaar you can go on and get the code.
Installing PyQt
To be able to run the code, install PyQt from Riverbank. Note that it requires that you have installed SIP and qt-mac-opensource-src-*.tar.gz.
Required Python modules
How to get the code?
- Open terminal.app
- Where do you want to develop? Choose a directory, e.g. ~/Documents/calibredev/ - Change to this directory.
- Now get the actual calibre code from bzr. Execute in terminal.app:
bzr co https://code.launchpad.net/~kovid/calibre/trunk calibre
- You will find a new directory there: "calibre" - inside is all you need.
How to run the code
In terminal, change directory to where you checked out the code and run the command "make" and voila, hopefully you got something working for you.
Troubleshooting
On OSX (and Windows) you may get a Memory Error while trying to checkout the code. In which case locate the file socket.py in your python installation and change line 308 to
recv_size = min(65636, max(self._rbufsize, left))
When running make on the command line this message occur:
/bin/sh: pyrcc4: command not found subprocess.CalledProcessError: Command 'pyrcc4 -o images_rc.py images.qrc' returned non-zero exit status 127
First, have you installed PyQt? Yes? Then... The path to pyrcc4 has to be set in PYTHONPATH. Follow the instructions on this page: How to define environment variables so that MacOS X applications can see them
ValueError: unknown locale: UTF-8
Check your terminal settings. Terminal -> Preferences -> Settings -> Advanced -> International ->set LANG environmental variable on startup.
Attachments
-
build-fontconfig
(369 bytes) -
added by kovidgoyal 2 years ago.
-
build-freetype
(194 bytes) -
added by kovidgoyal 2 years ago.
-
build-imagemagick
(701 bytes) -
added by kovidgoyal 2 years ago.
-
build-libjpeg
(223 bytes) -
added by kovidgoyal 2 years ago.
-
build-libpng
(179 bytes) -
added by kovidgoyal 2 years ago.
-
build-pyqt
(187 bytes) -
added by kovidgoyal 2 years ago.
-
build-qt
(327 bytes) -
added by kovidgoyal 2 years ago.
-
build-sip
(121 bytes) -
added by kovidgoyal 2 years ago.
