Skip to content
Marisa DeMeglio edited this page Feb 21, 2013 · 1 revision

Table of Contents

Build a python wrapper for AmisCore

These are old notes.

SET UP YOUR COMPUTER

 1. Pick, or create, a top-level directory.  It doesn't have to be empty.
 2. Create a directory "amis"
 3. Create a directory inside it "branches"
 4. Get the command-line subversion client
 5. Get the command-line cvs client
 6. Make sure you have developer tools installed

GET SOME CODE

 1. change your directory to "top-level/amis/branches/"
 2. Checkout the AMIS source: "svn co https://amis.svn.sourceforge.net/svnroot/amis/branches/amis-core-library-refactor/"				
 3. Change your directory to "top-level/"
 4. Checkout the Ambulant source: "cvs -d:pserver:anonymous@ambulant.cvs.sf.net:/cvsroot/ambulant co ambulant"
 5. get python source tarball from their website and extract to "top-level/Python-2.5.1/"
 6. Get xerces source tarball from their website (http://xerces.apache.org), extract it to "top-level/xerces-c-src_2_7_0/"
 7. Build xerces by following the instructions on the website. [http://xml.apache.org/xerces-c/build-winunix.html#UNIX]

[./runConfigure]

 8. Build the ambulant source by following the instructions included in the source directory (INSTALL).

* there are several dependencies to build. get those out of the way first (third_party_tools directory). be sure you have the X11 SDK installed (available as part of Apple's developer tools) * CAN YOU USE XERCES FROM ANOTHER DIR? * make sure to specify --with-xerces when you configure Ambulant's build process * read the notes carefully (you have to edit a script inbetween steps)

BUILDING OUR SOURCES

From amis/branches/amis-core-library-refactor/

 make distclean
 ./autogen.sh
 make all

INTERNAL NOTES

historical notes (we did this stuff in november 2006)

 * read http://homepages.cwi.nl/~jack/presentations/nluug-praatje.pdf
  * this explains how to use bgen plus its c++ extension
  * bgen lives in python/Tools/bgen/bgen
  * its c++ extensions live in ambulant/src/pyambulant/bgen*.py
 * you have to create a few files.
 * one of these is a parser (probably called something like amisScan.py)
 * to regenerate the c++ sources, go to amis/branches/amis-core-library-refactor/PyAmisCore
 *run "python genobjects.py"
 * edit BGENDIR="/Users/marisa/Projects/Python-2.5.1/Tools/bgen/bgen" which is in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/bgenlocations.py
 * run "python amiscorescan.py"
 * if there are missing types, check the method signatures.  we may have to add support for them.  the file amiscoregen.py is the translation of my (amis) header files into bgen's understanding
 * if there is a missing type (or a method) that you don't want to implement, edit amiscorescan.py and look at the blacklisted methods (named as such: blacklistXXX).  
 * if there is a missing type that you want to mangle, look at makerepairinstructions function in amiscorescan.py.  start simply when editing this function; ask jack otherwise!!
 * if there is a missing type that you do want to implement, you need to edit amiscoresupport.py
  * for simple types, look near the top "=== Defining simple types ==="
  * if it is a c++ class, then add it to genobjects instead (python name, namespace prefix, c-class name, base class)
  * this documentation might have python name and c-class name switched
  * anything else, ask jack	
 * assuming the building of amiscorescan.py worked...
 *try building with python setup.py build
  • from AmisCore.h, check this stuff
 * if you need to add command-line flags, libraries, whatever.. edit setup.py

"DEFS" variable should give a big hint for preprocessor definitions

 * add xerces path to setup.py INCLUDEDIRS and also to DIRS (which is called something else)
 * amis should be built universally (and all its dependencies too) (!aahhh!); alternately we have to convince setup.py to build non-universal stuff.  if that's what we end up doing, talk to jack.  he might say something like:
 * AmisGuiCocoa exists but you need PyObjC to use it
 * to make ambulant::net::url's work, they were translated to strings in python

and functions and rules were added to amiscoresupport.py

 * blacklist UrlList in amiscorescan.py
 * then regenerate (PyAmisCore>make regen)
Clone this wiki locally