From owner-freebsd-ports@FreeBSD.ORG Fri Nov 3 23:12:01 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 753BC16A416 for ; Fri, 3 Nov 2006 23:12:01 +0000 (UTC) (envelope-from craig@yekse.gank.org) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 707B743D5C for ; Fri, 3 Nov 2006 23:11:57 +0000 (GMT) (envelope-from craig@yekse.gank.org) Received: by ion.gank.org (Postfix, from userid 1001) id 10307118CB; Fri, 3 Nov 2006 17:11:57 -0600 (CST) Date: Fri, 3 Nov 2006 17:11:51 -0600 From: Craig Boston To: Charles Sprickman Message-ID: <20061103231151.GB94194@nowhere> Mail-Followup-To: Craig Boston , Charles Sprickman , freebsd-ports@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: freebsd-ports@freebsd.org Subject: Re: [nycbug-talk] creating "local" ports (fwd) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2006 23:12:01 -0000 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