From owner-freebsd-questions@freebsd.org Mon Nov 9 06:37:44 2015 Return-Path: Delivered-To: freebsd-questions@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 AAC92A29C7C for ; Mon, 9 Nov 2015 06:37:44 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by mx1.freebsd.org (Postfix) with ESMTP id 403D1153B for ; Mon, 9 Nov 2015 06:37:43 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ppp121-45-31-2.lns20.adl2.internode.on.net (HELO leader.local) ([121.45.31.2]) by ipmail06.adl2.internode.on.net with ESMTP; 09 Nov 2015 17:07:42 +1030 Subject: Re: Poudriere / makefile / python3 sqlite3 dependency To: FreeBSD Questions References: <20151108211638.GA23398@tower.spodhuis.org> From: Shane Ambler Message-ID: <56403F2C.4010108@ShaneWare.Biz> Date: Mon, 9 Nov 2015 17:07:32 +1030 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20151108211638.GA23398@tower.spodhuis.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 06:37:44 -0000 On 09/11/2015 07:46, Phil Pennock wrote: > Folks, > > How do I declare a dependency upon py34-sqlite3 in a Ports Makefile, > please? In an environment where py27 is the default. > > More context: Poudriere builds, ports tree overlay of meta-ports using > RUN_DEPENDS, `jail-foo` meta-port for installing in jail `foo` to pull > in all software dependencies. This setup has been working fine for the > past couple of years. > > Mail-server port, pulls in mailman (so needs python2) and I want to > use some python3 scripts I wrote a while back but didn't get around to > enabling before now. python3 is installed, no problem. sqlite3, split > out from the main Python build, I have failed to persuade to build as > Python3.4. I have setup meta ports in the past, since using poudriere I have dropped that for a file of ports that gets used by poudriere. The best way I found to build both py27 and py34 ports is to build them in different builds. As ports with py2.x only dependencies break with py34 as default we remove the broken ones from the list of py34 ports. The other thing to watch is that so far we want to use py2.7 as default then set PYTHON_VERSION when we want to build py34 ports. This allows the py34 ports to be installed in an environment that has a py27 version as default without conflicts. As removing py27 is painful at this point it is just easier to work with both being installed. In /root/foojailports mail/mailman database/py-sqlite3 math/py-numpy x11-toolkits/py-tkinter In /root/foojailportspy34 database/py-sqlite3 math/py-numpy x11-toolkits/py-tkinter Having setup poudriere with a jail called 10.2amd64 we use the set option to get two build sets from it. Each set can then use it's own custom make.conf In /usr/local/etc/poudriere.d/foojail-make.conf DEFAULT_VERSIONS= python=2.7 In /usr/local/etc/poudriere.d/foojailpy34-make.conf DEFAULT_VERSIONS= python=2.7 PYTHON_VERSION=python3.4 We then build the ports in two passes with- poudriere bulk -j 10.2amd64 -p ptree -z foojail -f /root/foojailports poudriere bulk -j 10.2amd64 -p ptree -z foojailpy34 -f /root/foojailportspy34 To finish off we configure pkg to use both pkg sets in /usr/local/etc/pkg/repos/foojailrepo.conf FooJailPy34: { url: "file:///usr/local/poudriere/data/packages/10.2amd64-ptree-foojailpy34", mirror_type: none, pubkey: "/usr/local/etc/ssl/certs/pkg.cert", enabled: yes } FooJail: { url: "file:///usr/local/poudriere/data/packages/10.2amd64-ptree-foojail", mirror_type: none, pubkey: "/usr/local/etc/ssl/certs/pkg.cert", enabled: yes } Of course inside the jail you could either mount the pkg dirs locally and adjust the paths or use a remote url. Now when you `pkg install database/py-sqlite3` it will install both py27 and py34 versions. You could also use `pkg install py34-sqlite3-3.4.3_6` to get only one version. -- FreeBSD - the place to B...Software Developing Shane Ambler