Porting application with RUN_DEPENDS and extra knobs

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Dec 1 21:14:52 UTC 2011


On 01/12/2011 19:25, Muhammad Moinur Rahman wrote:
> I am trying to port one of our Home Brew application for FreeBSD as we are
> moving towards BSD from Linux. Now while creating the Makefile for creating
> a port I am in a trouble. I want to automate the full script. My
> application has RUN_DEPENDS for perl. And perl should be built with
> PERL_64BITINT, THREADS and USE_PERL knobs for my application to work. Is
> there any way I can force from my Makefile to build and install perl with
> the above mentioned knobs.
> 
> I have thought of creating a patch file and changing the knobs
> in /var/db/ports/<PKG NAME>/options. But is there any official way to
> handle this?

The standard way of doing this is to create a slave port where you can
tweak the options settings and enforce whatever you require.  Compare,
for example, editors/emacs and editors/emacs-nox11.  Add a 'CONFLICTS'
variable to prevent both the original perl port and your slave copy
being installed simultaneously.

You don't need to submit this new slave port to be included in the
standard ports tree in order to use it with locally created ports.  You
can locally add a port /usr/ports/foo/bar by adding:

   /usr/ports/foo/Makefile.local

with contents:

   SUBDIR += bar

and then refer to it in port dependencies in the usual way.  If you have
a bunch of local ports, you can add in a whole new category directory in
a similar way by adding a /usr/ports/Makefile.local

However, if you do this, be careful about how you manage synching
updates to your ports tree.  This sort of change (adding files) will
persist across csup(1) runs, whereas editing files already part of the
ports would not[*].   I think it also works with 'portsnap update' but
you'll have to test to make sure.

If you wanted to submit your home brew app to the ports, then it might
be better to use eg. a PKGREQ script or a small snippet of perl in the
Makefile to verify that perl was installed WITH_THREADED = yes and so
forth, rather than adding a slave port.

	Cheers,

	Matthew

[*] If you need to keep locally edited ports

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20111201/a8b9ab03/signature.pgp


More information about the freebsd-ports mailing list