library porting question - optional python bindings

Shane Ambler FreeBSD at ShaneWare.Biz
Thu Mar 3 07:20:48 UTC 2016

On 03/03/2016 03:03, Chris Inacio wrote:
> On Tue, Mar 1, 2016 at 3:04 AM, Shane Ambler <FreeBSD at> wrote:
>> 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.

>> 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.

> The library is generally a C library with 3 "targets" a library (.so),
> header files (.h), and daemon that can be used as well.
> If you enable the optional Python support, then there is an entire python
> build area with the full "python ..." that gets run *from the C
> Makefile* when the Python dependencies are available.
> So yes, I can see that it makes sense to have this has 2 separate ports
> from a port maintenance point of view, but this is distributed as a single
> distribution.
> So you're suggesting 2 ports, from one source download, and 1 of those
> ports dependent on the other port?

Yes you only need the one src tarball and distinfo between both ports.
You can also use the same pkg-descr and maybe the same pkg-plist.

If the contents of the python port Makefile is kept to a minimum you
will only have to change the master port to update both, the changes to
the master port will apply to both ports. You can use conditionals to
get variations between building each port.

The python module port only needs to depend on the master port if it
uses the libraries installed by it, which I'm expecting it would.

FreeBSD - the place to B...Software Developing

Shane Ambler

More information about the freebsd-ports mailing list