<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>geek scrap &#187; egg</title>
	<atom:link href="http://geekscrap.com/tags/egg/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekscrap.com</link>
	<description>there is at least one way to do it</description>
	<lastBuildDate>Tue, 12 Apr 2011 10:14:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Install wxPython in buildout</title>
		<link>http://geekscrap.com/2010/01/install-wxpython-in-buildout/</link>
		<comments>http://geekscrap.com/2010/01/install-wxpython-in-buildout/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 06:40:17 +0000</pubDate>
		<dc:creator>geekscrap</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How-tos]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[egg]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[setuptools]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://geekscrap.com/?p=12</guid>
		<description><![CDATA[While completing setup of this blog with WordPress, I&#8217;ve also been working on another task: adding wxPython dependency to a pythonic project of mine. The deployment of this project is done through buildout, a nice piece of software that handles a sandboxed environment for python projects. You can find download and install instructions to start [...]]]></description>
			<content:encoded><![CDATA[<p>While completing setup of this blog with WordPress, I&#8217;ve also been working on another task: adding <a rel="nofollow" href="http://www.wxpython.org/">wxPython</a> dependency to a pythonic project of mine. The deployment of this project is done through <a rel="nofollow" href="http://www.buildout.org/">buildout</a>, a nice piece of software that handles a sandboxed environment for python projects.</p>
<p>You can find download and install instructions to start a buildout barebone <a rel="nofollow" href="http://www.buildout.org/install.html">here</a>, however I will do a small recap:</p>
<p><span id="more-12"></span>First, check that your python installation has <a rel="nofollow" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a> installed (platform-specific install instructions <a rel="nofollow" href="http://pypi.python.org/pypi/setuptools">here</a>).</p>
<p>Then run the following commands to create your new project and fetch bootstrapping script:</p>
<pre lang="Bash">$ mkdir projectdir
$ cd projectdir
$ wget http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py
$ mkdir downloads # this is needed, as buildout won't create it by itself.</pre>
<p>Next step is writing buildout.cfg, an ini-style configuration file that specifies the setup for your deployment. The generic section is named &#8220;buildout&#8221; and its &#8220;parts&#8221; attribute refers to other sections that must be evaluated. I&#8217;ve created two parts: an example named &#8220;myproject&#8221;, which downloads, builds and installs a couple of fake eggs with wxPython in PYTHONPATH and a &#8220;wxPython&#8221; part, which downloads, builds and installs wxPython inside &#8220;parts&#8221; directory.</p>
<p>Each part is evaluated using a recipe, which is a plugin that is dynamically download from <a rel="nofollow" href="http://pypi.python.org/pypi">eggs repository</a> or any other repository you pass through a find-links attribute. For my purposes I&#8217;ve employed two recipes from <a rel="nofollow" href="http://www.minitage.org/">minitage project</a>, a software deployment project developed by a nice french dude called kiorky (you can chat with him and obtain support at #minitage on irc.freenode.net).</p>
<pre lang="INI">[buildout]
download-cache = downloads
parts =
    wxPython
    myproject

[myproject]
recipe = minitage.recipe.egg
eggs =
    myegg
    myotheregg
extra_paths = ${wxPython:location}/lib/python

[wxPython]
recipe = minitage.recipe.cmmi
url = http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.10.1.tar.bz2
post-make-hook = ${buildout:directory}/hooks.py:wxpython_post_make_hook
configure-options =
    --enable-debug --enable-debug_gdb # replace with --enable-optimize in production code
    --enable-display
    --enable-geometry
    --enable-graphics_ctx
    --enable-mediactrl
    --enable-sound
    --enable-unicode
    --with-libjpeg=builtin
    --with-libpng=builtin
    --with-libtiff=builtin
    --with-opengl
    --with-sdl
    --with-zlib=builtin
# Platform-dependent options, add as needed. Platform names are from sys.platform.lower().
configure-options-darwin = --with-mac --enable-monolithic
configure-options-linux2 = --with-gtk2</pre>
<p>Configure-make-make-install recipe, namely minitage.recipe.cmmi, has a series of special options called &#8220;hooks&#8221; that allow extending the building process with non-standard actions through python code. I&#8217;ve added a call to wxpython_post_make_hook in hooks.py to deal with special post-install code:</p>
<pre lang="python">import os
import sys
import subprocess

def wxpython_post_make_hook(o, b):
    return subprocess.call([sys.executable, 'setup.py',
        'WX_CONFIG=%s' % os.path.join(o['location'], 'bin', 'wx-config'),
        'BUILD_GIZMOS=0', 'BUILD_STC=0',
        'install', '--home=%s' % o['location'],
        ], cwd=os.path.join(o['compile-directory'], 'wxPython'))</pre>
<p>Please note that I&#8217;ve disabled gizmos and stc support from wxPython, because I don&#8217;t need them and  they would require additional building in contrib.</p>
<p>Finally, launch the bootstrapping code:</p>
<pre lang="bash">$ python2.6 ./bootstrap.py</pre>
<p>Of course, if you have a different version of python installed, adjust the command accordingly.</p>
<p>Now buildout is ready to be executed with:</p>
<pre lang="bash">$ ./bin/buildout</pre>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://geekscrap.com/2010/01/install-wxpython-in-buildout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
