Option vs. flavor?

Shane Ambler FreeBSD at ShaneWare.Biz
Sun Dec 17 04:23:57 UTC 2017


On 17/12/2017 08:32, Yuri wrote:
> On 12/16/17 13:39, Franco Fichtner wrote:
>> Why not use a separate data package as optional dependency? Solves the
>> conditional fetch.
> 
> 
> But with the port option fetch is also conditional. There is no need to
> create an extra-package.

Flavours aren't for option variations, they are for the same code being
linked against multiple versions of other ports, each with different
dependencies - eg python 2.7/3.6 or ruby 2.2/ruby2.4

You could either make a separate port for the data files or add it as an
option to the main port.

Using an option for the data files, you either make it a default option
so that the data is installed by anyone that installs the pkg or have it
off so that anyone who wants the data files needs to build the port
themselves. Having 4.5GB of optional data, I wouldn't suggest having it
as an option that is on, this way the package repos don't need to add
4.5GB of data for each arch that pkgs are built for.

Add a second port for data files - see games/alephone and alephone-data
for an example. To prevent the pkg being added to pkg repos, add
NO_PACKAGE= Data files too big, user to download manually
Using a second data port means the user can download and install the
data without having to compile the program.

Add info about this to pkg-message for the user to read, even if it is
about building the data port to get the extra data.

As for adding it as an option -

OPTIONS_DEFINE= EXTRADATA

EXTRADATA_DISTFILES= extra_data_files.tgz

post-install-EXTRADATA-on:
    ${COPYTREE_SHARE} ${WRKDIR}/extra_data_files ${STAGEDIR}/${DATADIR}

-- 
FreeBSD - the place to B...Software Developing

Shane Ambler



More information about the freebsd-ports mailing list