Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Nov 2015 17:07:32 +1030
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Poudriere / makefile / python3 sqlite3 dependency
Message-ID:  <56403F2C.4010108@ShaneWare.Biz>
In-Reply-To: <20151108211638.GA23398@tower.spodhuis.org>
References:  <20151108211638.GA23398@tower.spodhuis.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?56403F2C.4010108>