From owner-freebsd-ports@FreeBSD.ORG Wed Dec 19 19:07:47 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 785E816A418; Wed, 19 Dec 2007 19:07:47 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.60.158]) by mx1.freebsd.org (Postfix) with ESMTP id 614AA13C448; Wed, 19 Dec 2007 19:07:47 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: by syn.atarininja.org (Postfix, from userid 1001) id 4A9B85C34; Wed, 19 Dec 2007 14:13:06 -0500 (EST) Date: Wed, 19 Dec 2007 14:13:06 -0500 From: Wesley Shields To: Paul Schmehl Message-ID: <20071219191306.GC36016@atarininja.org> References: <4D1AAAB26DADCFB11343F6B3@utd59514.utdallas.edu> <47693FE9.20701@gahr.ch> <41364CD63DE952CCB8602A44@utd59514.utdallas.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41364CD63DE952CCB8602A44@utd59514.utdallas.edu> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: pav@FreeBSD.org, FreeBSD Ports , Pietro Cerutti Subject: Re: Optional patching 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: Wed, 19 Dec 2007 19:07:47 -0000 On Wed, Dec 19, 2007 at 01:03:23PM -0600, Paul Schmehl wrote: > --On Wednesday, December 19, 2007 16:59:37 +0100 Pietro Cerutti > wrote: > >> Paul Schmehl wrote: >>> Is there a way to include a patch as an option to a port? I maintain >>> the security/barnyard port. There's a patch that is necessary for >>> barnyard to work correctly on a 64bit system. I'm wondering if I can >>> use OPTIONS to make this patch optional if the system is 64 bit, but I'm >>> not sure what the syntax would be inside the if statement. >>> >>> .if defined(WITH_64BIT) >>> do-patch: patchname >>> .endif >> >> >> I would do something like (please check the list of 64 bits platforms) >> >> .if ${ARCH} == "amd64" || ${ARCH} == "ia64" || ${ARCH} == "sparc64" >> # apply the patch here >> .endif >> >>> >>> I assume the patch would have to be in the filesdir but could not be >>> named "patch-foo" or it would always be applied, correct? >>> >> >> Please check the reply from pav@ for this ;-) > > That brings up an interesting question. Which would be the preferred > method? To use an OPTION knob? Or simply apply the patch if the arch > matches? I'm thinking the latter. I've tested the former method, and it > works fine. Does it matter which method I use? I don't think it matters really, but is probably a matter of personal preference. The only problem with using an option that I see is that if the user has no idea if (s)he is on a 64bit platform and turns the option off. It's for this reason I'd suggest using the .if ${ARCH} approach. -- WXS