Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Nov 2006 17:11:51 -0600
From:      Craig Boston <craig@yekse.gank.org>
To:        Charles Sprickman <spork@bway.net>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [nycbug-talk] creating "local" ports (fwd)
Message-ID:  <20061103231151.GB94194@nowhere>
In-Reply-To: <Pine.OSX.4.61.0611031519500.4567@dyn-160-39-250-49.dyn.columbia.edu>
References:  <Pine.OSX.4.61.0611031519500.4567@dyn-160-39-250-49.dyn.columbia.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 03, 2006 at 03:30:47PM -0500, Charles Sprickman wrote:
> I'm finding that there are a number of ports that we need to patch for 
> some functionality that's unique to our business (qmail, mailfront, etc.). 
> Currently we just do "make patch" and then apply our patches.  This works, 
> but is a bit of a pain to maintain.

The easiest way is to make patch-* files and put them in the 'files'
directory under a port, as already mentioned.  cvsup will leave them
alone but I think portsnap might delete them.

A few times I've wanted to rm -rf /usr/ports and recreate it for
whatever reason without losing my patches, so nowadays I'm using the
following (ugly) hack:

----- BEGIN /usr/Makefile.inc ------
.include "/usr/ports-patches/Makefile"
----- END /usr/Makefile.inc ------

----- BEGIN /usr/ports-patches/Makefile -----
TMPCURDIR=${.CURDIR:S/\/usr\/ports//}
.ifmake do-patch
TPATCHES!=echo /usr/ports-patches${TMPCURDIR}/patch-*
.if ! ${TPATCHES:M*\*}
EXTRA_PATCHES+= ${TPATCHES}
.endif
.endif
----- END /usr/ports-patches/Makefile -----

Under /usr/ports-patches I set up a hierarchy mirroring /usr/ports
except it only contains local patch files that I want to apply.  The
layout works something like this:

$ cd /usr/ports-patches && find . -type f | sort
./Makefile
./devel/sdl12/patch-cmb-joystick
./graphics/png/patch-apng
./net/rdesktop/patch-seamless-fixes
./net-im/gaim/patch-cmb-jep0008
./www/firefox/patch-apng
./x11/kdebase3/patch-cmb-bsdmonitors
./x11/kdebase3/patch-cmb-unbreak-bargraph

Actually mine is slightly different since I have ports under a different
directory and define TMPCURDIR in /etc/make.conf (in order to do
conditional settings), but the above should work for a stock install.

The /usr/Makefile.inc hack is really bad, but bsd.port.mk doesn't seem
to import any other top-level local Makefiles.  It would be nice if
there was a better hook to do this sort of thing.  make.conf might work
as well but I was trying to minimize the impact on non-FreeBSD
makefiles.

Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061103231151.GB94194>