A recipe to build lxml
A buildout recipe to build a statically linked lxml library.
Please see the readme in the src/z3c/recipe/staticlxml directory.
Please see the CHANGES.txt file.
- Steve McMahon
- Reinout van Rees
- Christian Zagrodnick
- Remco Wendt
The recipe supports the following options:
- Set to the desired lxml egg, e.g. lxml or lxml==2.1.2
- libxslt-url, libxml2-url
The URL to download the source tarball of these libraries from. If unset, the [versions] section of the buildout is searched, if nothing is found there, either, these default values are used:
- build-libxslt, build-libxml2
- Set to true (default) if these should be build, false otherwise. Needes to be true for a static build.
- libxslt-patch, libxml2-patch
- The name of an optional patch file to apply to the libraries
- true or false. On OS X this defaults to true.
- Needed if libxml2 is not built.
- Needed if libxslt is not built.
- Path to the xslt-config binary. Not needed if build-libxslt is set to true.
- Path to the xml2-config binary. Not needed if build-libxml2 is set to true.
- Set to true to force rebuilding libraries every time.
This is an example buildout:
[buildout] parts = lxml pylxml develop = . log-level = DEBUG download-directory = downloads download-cache = downloads versions=versions [versions] lxml = 2.1.3 [pylxml] recipe=zc.recipe.egg interpreter=pylxml eggs= lxml [lxml] recipe = z3c.recipe.staticlxml egg = lxml
This will build a static version of the lxml egg, that is, it won’t have any dependencies on libxml2 and libxslt.
The egg is installed in your buildout’s egg directory (it is not installed as a development egg). If you have a global eggs-directory configured in your ~/.buildout/default.cfg, the static lxml egg is thus placed in that global egg directory.
If you specified a specific version for the lxml egg, the egg directory is checked for an existing lxml egg. If found, it is used as-is. Specifying force = true of course means that this check isn’t performed.
This is not a complete exercise of all the ways the recipe can be configured, rather it’s a sanity check that all parts (especially, recipes we depend on) work as expected:
>>> write('buildout.cfg', ... """ ... [buildout] ... parts = lxml ... newest = false ... ... [lxml] ... recipe = z3c.recipe.staticlxml ... libxml2-url = file://%s/foo.tgz ... libxslt-url = file://%s/foo.tgz ... xml2-config = none ... xslt-config = none ... egg = lxml ... static-build = false ... """ % (distros, distros))
>>> print system('bin/buildout') Installing lxml. lxml: CMMI libxml2 ... lxml: Using libxml2 download url /distros/foo.tgz... libxml2: Unpacking and configuring configuring foo... echo building foo building foo echo installing foo installing foo lxml: CMMI libxslt ... lxml: Using libxslt download url /distros/foo.tgz... libxslt: Unpacking and configuring configuring foo... echo building foo building foo echo installing foo installing foo... lxml: Building lxml ...
- Stefan Eletzhofer, Author
- Steve McMahon
- Reinout van Rees
- Christian Zagrodnick
- Added possibility to patch both libxslt and libxml2 using cmmi’s patch / patch_options command internally (#7) [shanx]
- Fix to run some 64 bit Linux, like Suse Linux, too. [icemac]
- pep8 changes [seletz]
- Check if ld will accept the –no-as-needed link flag without an “unknown option” error. If it will, use the flag. This should cure the missing clock_gettime problem. [smcmahon]
- Look for gcc >= 4.5. If found, add LDFLAGS for force no-as-needed link of librt. This should cure the missing clock_gettime problem for recent gcc. [smcmahon]
- BUGFIX: CVE-2011-3919 Add a in-line patch for CVE-2011-3919 until we get fix from upstream. http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3919 http://people.canonical.com/~ubuntu-security/cve/2011/CVE-2011-3919.html http://git.gnome.org/browse/libxml2/commit/?id=5bd3c061823a8499b27422aee04ea20aae24f03e
- Updated default libxml/libxslt download locations to http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz and http://xmlsoft.org/sources/libxslt-1.1.26.tar.gz respectively. Those updated versions fix a Lion compile issue as reported by jladage.
- Using Python’s doctest module instead of depreacted zope.testing.doctest.
- Made smoke test a bit more fuzzy to ignore output differences when newer zc.recipe.cmmi versions are used or tests are running on Mac OS X.
- Fixed “relocation R_x86_64_32” error on 64 bit linux by using –with-pic as extra option to the libxml/libxslt build. [reinout]
- Removed accidentally checked in pdb [wosc]
- Updated our use of zc.recipe.cmmi, which from 1.2.0 on requires the URL to be known on construction time. (The new usage is backward-compatible with 1.1.x). [wosc]
- Passing include-dirs, library-dirs and rpath newline separated as required by zc.recipe.egg. This fixes non static build on linux. [zagy]
- Consult buildout’s [version] section for the libxml2/libxslt-URLs [wosc]
- Switching off building of the exslt crypt functionality. That crypt functionality isn’t found anymore on exslt.org itself. And it uses libgcrypt, which somehow leads to runtime errors regarding ‘gcry_*’ on osx and sometimes on linux. [reinout]
- The recipe checks for an existing egg before doing expensive download/compiles. Previously, the check was implicitly done after compiling libmxl/libxslt. The egg name is printed with a warning to delete it if this isn’t a proper static egg. [reinout]
- Fixed readme typos. [seletz]
- Fix to prevent rebuilding lxml all the time, thus reducing the lxml tax. [seletz]
- Only add iconv on darwin. [seletz]
- Made static-build default to true on OS X [seletz]
- Made build-libxslt and build-libxml2 default to true [seletz]
- Document default options [seletz]
- Fix Documentation REsT [seletz]
- Rerelease due to setup.cfg messup [seletz]
- Added iconv library, which enables fully static builds. This is actually a bug in lxml’s setup. [seletz]
- Updated docs, removed junk code [seletz]
- Added tweaks needed for Mac OS X [seletz]
- Added basic build steps for liblxml2, libxslt and lxml. [seletz]
- Created recipe with ZopeSkel [seletz].
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size z3c.recipe.staticlxml-0.10-py2.7.egg (25.1 kB)||File type Egg||Python version 2.7||Upload date||Hashes View|
|Filename, size z3c.recipe.staticlxml-0.10.tar.gz (22.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for z3c.recipe.staticlxml-0.10-py2.7.egg
Hashes for z3c.recipe.staticlxml-0.10.tar.gz