Date: Tue, 1 Mar 2016 18:34:33 +1030 From: Shane Ambler <FreeBSD@ShaneWare.Biz> To: Chris Inacio <nacho319@gmail.com>, freebsd-ports@freebsd.org Subject: Re: library porting question - optional python bindings Message-ID: <56D54D11.2050502@ShaneWare.Biz> In-Reply-To: <CAG_PEeyLw_VS=pL-3J6NZycx9-b_qo9GRaxoeV34i5gq_Cx=bg@mail.gmail.com> References: <CAG_PEeyLw_VS=pL-3J6NZycx9-b_qo9GRaxoeV34i5gq_Cx=bg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 01/03/2016 13:08, Chris Inacio wrote:
> All,
>
> I'm trying to build a port definition for a library/application that can
> optionally include Python bindings. The library/application generally
> depends on other C libraries to exist (ZMQ v3, Protobufs-C) and if you
> enable Python support, then you need a Python interpreter plus
> Python-protobufs & python zmq.
>
> Putting an OPTION of Python in the port file is easy. Including the
> optional Python dependencies (and presumably targets - but I'm not that far
> yet) seems to be a lot more complicated. I haven't found anything that
> would tell me how I'm supposed to do that. I have found that I'm supposed
> to add pyXX prefixes to the python targets.
Python bindings as in a module that can be imported in python? or
python bindings that help the lib linking to it to be exposed to python?
The difference is a python module will be installed into
pythonx.y/site-packages while the other will install lib/libxxx.so
devel/boost-python-libs is an example of the later.
For a normal python module I would suggest making it as a separate port
that just installs the python module. This makes it easier to install
multiple versions for each python version. The py-module port can be a
slave of the main port so you don't have to maintain the same code
twice.
A port with PORTNAME=nose and PKGNAMEPREFIX=${PYTHON_PKGNAMEPREFIX}
can then end up with multiple installs to support each python version.
pkg info -ox nose
py27-nose-1.3.7 devel/py-nose
py34-nose-1.3.7 devel/py-nose
py35-nose-1.3.7 devel/py-nose
> Does anyone know of a similar application/library that I can go look at?
> Is there any documentation on how to solve this?
I have graphics/openimageio and py-openimageio as well as
graphics/opencolorio that has opencolorio-tools and py-opencolorio as
slaves.
openimageio uses SLAVE_PORT as defined by the ports infrastructure
while opencolorio defines it's own OCIO_SLAVE to distinguish between
the two slaves
Using VARIABLE?=xxx in the master Makefile allows the slave port to
override that variable.
--
FreeBSD - the place to B...Software Developing
Shane Ambler
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56D54D11.2050502>
