From owner-freebsd-ports@freebsd.org Thu Dec 21 07:26:31 2017 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 09446E81D3F for ; Thu, 21 Dec 2017 07:26:31 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id E89227A0EF for ; Thu, 21 Dec 2017 07:26:30 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: by mailman.ysv.freebsd.org (Postfix) id E7E97E81D3E; Thu, 21 Dec 2017 07:26:30 +0000 (UTC) Delivered-To: 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 E6F35E81D3C for ; Thu, 21 Dec 2017 07:26:30 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 770287A0EA for ; Thu, 21 Dec 2017 07:26:29 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ppp121-45-66-21.bras1.adl6.internode.on.net (HELO leader.local) ([121.45.66.21]) by ipmail07.adl2.internode.on.net with ESMTP; 21 Dec 2017 17:56:24 +1030 Subject: Re: Again, flavors or options? To: Yuri Cc: FreeBSD Ports Mailing List References: <85f87eb1-ab21-e802-866c-93d7edbfb92a@rawbw.com> From: Shane Ambler Message-ID: <58e6b5e1-f2c4-1e07-6cb3-82253bd7e13a@ShaneWare.Biz> Date: Thu, 21 Dec 2017 17:56:21 +1030 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 07:26:31 -0000 On 21/12/2017 16:35, Freddie Cash wrote: > On Dec 20, 2017 6:16 PM, "Yuri" wrote: > > I have the port for the digital currency. It has 3 parts that install > non-intersecting file sets: daemon, cli, qt-ui. The commonality: same > repository, same build options, same license, mostly same port options. > > I am attracted to the idea to use flavors to let users choose which part do > they want: FLAVORS=default daemon qt cli As I said in my first answer, flavours changes the dependencies not the options of the port, eg a flavour using py27 another using py36 I don't think there is a way to have different options enabled for different flavours, each flavour will use the same options. Until we have the ability to break a single port into multiple packages that can be installed separately, you either have options for each item or a different port for each. So you could make the daemon and cli enabled as default, which will be available in the standard repos, then the qt-gui as an option the user needs to enable and build themselves. To simplify maintaining multiple related ports, you can use the same Makefile for each by setting up the others as slave ports, see 5.10 of the porters handbook. By setting a variable in the slave, you can use logic tests to control what varies for each port in the one Makefile. > "default" will install all of them, others will install individual parts. > Option list will be slightly different for each flavor. > > One alternative: only have port options. Then some options can't be > conditional on which parts are built. You have several options to logically control what options are enabled. You can find several possibilities in 5.13 of the porters handbook. from 5.13.3.7 - OPT1_IMPLIES= OPT2 # this means when you enable OPT1, OPT2 will automatically be turned on from 5.13.3.8 - OPT1_PREVENTS= OPT2 # this prevents enabling OPT1 and OPT2 at the same time You can use the standard logic available in any Makefile - .if ${PORT_OPTIONS:MOPT1} && ${PORT_OPTIONS:MOPT2} # make adjustments for both options being on .endif You also get custom build targets based on options (5.13.3.12) - post-patch-OPT1-on: ${REINPLACE_CMD} -e 's|opt2=True|opt2=False|' ${WRKSRC}/configure -- FreeBSD - the place to B...Software Developing Shane Ambler