zc.buildout recipe that parses compile options from libraries config scripts
Project description
The LibInc recipe can parse CFLAGS, LDFLAGS and other information tipically returned by libraries config scripts like gdal-config, libpng-config and others. The parsed information can be used by other recipes as hexagonit.recipe.cmmi or zc.recipe.egg to make the build process more robust.
The initial version of this recipe has been written within the PrimaGIS topic of the 2007 Plone Naples Sprint and it is used for the PCL/PrimaGIS buildout.
Detailed Documentation
Warning: Work in progress
This zc.buildout recipe is pre-alpha quality.
Supported options
- flags-command
a list of commands that return the linking options, one per line
Example usage
We’ll use a simple config command to demonstrate the recipe.
>>> import os.path >>> testdata = join(os.path.dirname(__file__), 'testdata') >>> ls(testdata) d .svn - sample-config
The options are accessible by other recipes:
>>> mkdir(sample_buildout, 'recipes') >>> write(sample_buildout, 'recipes', 'echo.py', ... """ ... import logging ... ... class Echo: ... def __init__(self, buildout, name, options): ... self.name, self.options = name, options ... ... def install(self): ... logging.getLogger(self.name).info(self.options.get('echo', '')) ... return () ... ... def update(self): ... pass ... """)>>> write(sample_buildout, 'recipes', 'setup.py', ... """ ... from setuptools import setup ... ... setup( ... name = "recipes", ... entry_points = {'zc.buildout': ['echo= echo:Echo']}, ... ) ... """)
Let’s create a buildout to build and install the package.
>>> write(sample_buildout, 'buildout.cfg', ... """ ... [buildout] ... develop = recipes ... parts = package ... ... [package] ... recipe = recipes:echo ... echo = ... include-dirs: ${config-package:include-dirs} ... library-dirs: ${config-package:library-dirs} ... libraries: ${config-package:libraries} ... cflags: ${config-package:cflags} ... ldflags: ${config-package:ldflags} ... ... [config-package] ... recipe = bopen.recipe.libinc ... flags-command = ... %(testdata)s/sample-config --cflags ... %(testdata)s/sample-config --libs ... %(testdata)s/sample-config --version ... include-dirs = /usr/include/mysample ... library-dirs = /usr/lib/mysample ... libraries = mysample ... """ % {'testdata': testdata})>>> print system(buildout + ' -N') Develop: ... config-package: .../testdata/sample-config --cflags -> -I/usr/include -I/usr/include/sample config-package: .../testdata/sample-config --libs -> -L/usr/lib -L/usr/lib/sample -lsample -lsample_rt config-package: .../testdata/sample-config --version -> 1.0 config-package: include-dirs: /usr/include /usr/include/sample /usr/include/mysample library-dirs: /usr/lib /usr/lib/sample /usr/lib/mysample libraries: sample sample_rt mysample cflags: -I/usr/include -I/usr/include/sample -I/usr/include/mysample ldflags: -L/usr/lib -L/usr/lib/sample -L/usr/lib/mysample -lsample -lsample_rt -lmysample Installing config-package. Installing package. package: include-dirs: /usr/include /usr/include/sample /usr/include/mysample library-dirs: /usr/lib /usr/lib/sample /usr/lib/mysample libraries: sample sample_rt mysample cflags: -I/usr/include -I/usr/include/sample -I/usr/include/mysample ldflags: -L/usr/lib -L/usr/lib/sample -L/usr/lib/mysample -lsample -lsample_rt -lmysample
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bopen.recipe.libinc-0.2.1.tar.gz
.
File metadata
- Download URL: bopen.recipe.libinc-0.2.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703f1c31fc9f2eb308d50bebeed3e14eda309ca349ca975a191f2ffcf4309266 |
|
MD5 | 6ff0224b3a3bdaa1d3b50c14a9c1a2a5 |
|
BLAKE2b-256 | 1a44522fddc27d8fe6a7e6d0fc7b354b35b5d62b58e11b03f368227a1b89b5fd |
File details
Details for the file bopen.recipe.libinc-0.2.1-py2.4.egg
.
File metadata
- Download URL: bopen.recipe.libinc-0.2.1-py2.4.egg
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9da9355806dba14fae2f084774ec8fe3ff16137784a775d01e2433c9d49aa81 |
|
MD5 | 70ed5b5bfabee42255ac24b2b635b5c5 |
|
BLAKE2b-256 | 45cbc3e51bc720dcc8ffa4863a379bc98f0625ba8a3aad48f1483614c37cf425 |