From owner-freebsd-ports@freebsd.org Wed Mar 2 16:33:04 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBBECAC19B2 for ; Wed, 2 Mar 2016 16:33:03 +0000 (UTC) (envelope-from nacho319@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7D53184D for ; Wed, 2 Mar 2016 16:33:03 +0000 (UTC) (envelope-from nacho319@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id z8so46084535ige.0 for ; Wed, 02 Mar 2016 08:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ntAV0ttGZTDjKYPW4vTK5nHnxW91JhpC1OAb9rw6akE=; b=DCRNEuZCq90NPh8T/vG+Mb4WuZeMAODZ7o39xio84hjfU0VO45jknDrDhE5z+NmKZn MADWkx1Nt7Y6AwgncL2TMvZ+jgHe6+COhNO4RTNwqXpUdlednnwMfnmdII0k/SzOE20e T8nRWFrWW75Kv8lQQmYR0P9foJDCsAfjoAiM/xs0b8j17bjZEQqOjg1+eWyn8eN5XrrD My3b2y4rJ7k0xDac3A0keJntH0EVi9dQyCVoV4CHvL3c+IRvDC5C7D+ngwG9MK/Jhdmo un4RtJVPxIUMGzW7f3iHdM6fGP0vZQ11bIh1gTZNXcBpoXq03c/D6JhticQse33UstdU NeoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ntAV0ttGZTDjKYPW4vTK5nHnxW91JhpC1OAb9rw6akE=; b=hEdYjV9wgi09TTelA2sv/kbKdDXq1//CWfNvCZhQ6fsOFvCaHYUJNIctRaM1MmuIRJ AN0+LbpvSR7+Qn7SoNFWNOqLWGhZkhgfyuuWaKAMRpSGB1LnjDkqRbCbjyYwObKn8TF+ RPMI3abgYg4ecmRcb5b/HvtB4Rw9Porhbcd3tLb/HxYohszzptQx75ni/MUYCcilsTj/ uIHGBOxoWG/TEPc2glzohxM65Ra0ZzeZml0cVnE0gjWWr4Os/NOIIJKV2LslUwCqvl6j qn072NjFdMDN/rWsjqKVpd5eQnbci+8bnOYrb36o9u4QBd+MMFHhVbuZhdXP9pq5u2Kc iQtw== X-Gm-Message-State: AD7BkJJ+yAe9IkO7Jg92Bp4AH2WtZuMkZKXs5BaeYIDjswtVL+hspyfEGQex8BgThNTY5BdWChlZNIYcQCxNmg== MIME-Version: 1.0 X-Received: by 10.50.60.34 with SMTP id e2mr846681igr.77.1456936382977; Wed, 02 Mar 2016 08:33:02 -0800 (PST) Received: by 10.36.118.15 with HTTP; Wed, 2 Mar 2016 08:33:02 -0800 (PST) In-Reply-To: <56D54D11.2050502@ShaneWare.Biz> References: <56D54D11.2050502@ShaneWare.Biz> Date: Wed, 2 Mar 2016 11:33:02 -0500 Message-ID: Subject: Re: library porting question - optional python bindings From: Chris Inacio To: Shane Ambler Cc: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2016 16:33:04 -0000 On Tue, Mar 1, 2016 at 3:04 AM, Shane Ambler 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. >> >> 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 > > 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 setup.py ..." 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?