From: Benny M. <ben...@gm...> - 2009-06-18 20:38:59
|
2009/6/18 Benny Malengier <ben...@gm...>: > 2009/6/18 Emrys Williams <emr...@ev...>: >> I am (foolishly, some might say) trying to build a native binary version >> of gramps for Mac, using this system: >> https://sourceforge.net/apps/trac/gtk-osx/wiki/Build >> and haven't reached as far as gramps yet. I am still making gtk (et al) >> build. It was Benny's idea. >> >> The idea is to build a system entirely in user space - no root access - >> which I can make into an executable with the bundling utility from the >> same project. Mac users could then install that into their own user >> space with one click. (No laughing at the back, please.) >> >> I know next to nothing about modern application building, but have made >> some halting progress. My experiences are described at the thread >> https://sourceforge.net/apps/phpbb/gtk-osx/viewtopic.php?f=3&t=5 >> My first question is about pycairo and pygobject installation. The >> aclocal.m4 scripts used in the build process for them contains code that >> uses not a specified directory for scripts for this code, but looks at >> the system default directory for the existing installation of python, >> rather than the one I'm building in user space. It does this: >> >> am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; >> print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" > > This is declaring a variable, > > am_cv_python_pythondir > > using a bit of python code. You could set it to something hard coded locally. > To know what the code returns, enter it in a terminal. I would guess > $PYTHON and $PYTHON_PREFIX are defined somewhere higher in the script, > normally on linux they would be > $PYTHON = python > and > $PYTHON_PREFIX = /usr > > The last you can find in Mac from a python terminal: > k$ python > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import sys >>>> sys.prefix > '/usr' >>>> > > Now we can do that line you give to see what it gives on linux: >>>> from distutils import sysconfig >>>> print sysconfig.get_python_lib(0,0,prefix='/usr') > /usr/lib/python2.5/site-packages > > So the above is for python2.5 the value for your > am_cv_python_pythondir variable in linux. It will be different in > python2.6 as that directory is deprecated. I did not really say why did I :-) The script must need the correct dir as set by python so as to install packages in the correct place I suspect. Eg, on my box, cairo is installed in /usr/lib/python2.5/site-packages/cairo What the dir specifically means is here: http://docs.python.org/distutils/apiref.html#module-distutils.sysconfig method get_python_lib. Note that in the code you show, the first two parameters are 0, so False. Benny > |