This page describes how to do the following:
-
Get MacPorts and the required support packages installed to run D-RATS
- Install py2app so that you can build proper .app packages of python programs
- Build .app packages of D-RATS using the source distribution
1. Prepare the environment
- Install all OS updates (this document was written against MacOS 10.4.11 PPC)
- Install X11 from OS install disc
- Install Xcode 2.5 on OSX 10.4 or Xcode 3.1 on 10.5
-
Install MacPorts 1.7.1
-
Modify the MacPorts build configuration to include extra linker options. Edit the master config by running
nano /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl In that file, change this line:
default configure.ldflags {"-L${prefix}/lib"} to this:
default configure.ldflags {"-L${prefix}/lib -Xlinker -headerpad_max_install_names"} When you are done, save and quit that file (Control-O, ENTER, and then Control-X)
NOTE: An alternative to all of the editing described above, would be to use a command line sed script to accomplish the above edits:
sed -e "s/default configure.ldflags {\"\-L\${prefix}\/lib/& -Xlinker -headerpad_max_install_names/g" -i .org /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl
- Install support libraries:
sudo port install cairo +quartz pango +quartz py25-serial py25-xml py25-hashlib py25-gtk sudo port install -f py25-libxslt
NOTE: Unless you have a good reason not to, run the following to activate the MacPorts python runtime:
sudo port install python_select sudo python_select python25
Installing all the packages above will take a long time, so go amuse yourself in some other way. When you get past this point, you should be able to run D-RATS from source by doing the following from an X11 terminal:
/opt/local/bin/python2.5 d-rats
2. Installing Py2App
-
Install the py2app-devel package from MacPorts:
sudo port install py25-macholib py25-py2app
3. Building the .app package
-
Fetch the desired version of D-RATS in source form and save it to a working directory. Do not download the regular source distribution because it does not contain the build scripts. Instead, grab a tarball snapshot of the appropriate tag in the source repository. To do this, go to the tag list at http://www.d-rats.com/hg/hgwebdir.cgi/d-rats.hg/tags and click on the desired version. On the resulting page, click the "gz" link at the top to get a tarball.
-
From the terminal, enter the working directory, extract the archive, and enter the resulting distribution directory (the example assumes a d-rats-build directory under you home)
cd d-rats-build tar xzf d-rats-0.3.0.tar.gz cd d-rats-0.3.0
-
Run the setup.py script against py2app and fix up the pango font library:
/opt/local/bin/python2.5 setup.py py2app bash ./build/macos/make_pango.sh /opt/local dist/d-rats-0.3.0.app
NOTE: Be sure to substitute for the version you're building.
-
If all is successful, you should have a dist/d-rats-VERSION.app package. To move it to your desktop for easy access, do the following:
mv dist/d-rats-0.3.0.app ~/Desktop
NOTE: Be sure to substitute for the version you're building.
-
Finally, zip the .app using the "File->Create archive" function in the Finder
|
Last Updated on Friday, 28 August 2009 09:17 |