From owner-freebsd-ports@FreeBSD.ORG Tue May 17 22:07:10 2011 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 A738E1065672 for ; Tue, 17 May 2011 22:07:10 +0000 (UTC) (envelope-from ohauer@FreeBSD.org) Received: from u18-124.dslaccess.de (unknown [194.231.39.124]) by mx1.freebsd.org (Postfix) with ESMTP id 4F35A8FC0C for ; Tue, 17 May 2011 22:07:10 +0000 (UTC) Received: from [172.20.1.100] (cde1100.uni.vrs [172.20.1.100]) (Authenticated sender: ohauer) by u18-124.dslaccess.de (Postfix) with ESMTPSA id D829E20380; Wed, 18 May 2011 00:07:03 +0200 (CEST) Message-ID: <4DD2F188.6050402@FreeBSD.org> Date: Wed, 18 May 2011 00:07:04 +0200 From: Olli Hauer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Matthew Pounsett References: <958AF7F7-AD80-4F01-8F1D-E9E262B953F6@conundrum.com> In-Reply-To: <958AF7F7-AD80-4F01-8F1D-E9E262B953F6@conundrum.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: Complicated patching X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ohauer@FreeBSD.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 22:07:10 -0000 On 2011-05-17 06:32, Matthew Pounsett wrote: > Hi. > > In a (possibly foolish) attempt to add a third-party patch to an application I use *without* abandoning the ports tree for this app, I'm trying to make a local modification to the port to download and include the patch in the build process. The problem I'm running into is that it is distributed from a source distribution site that uses a downloads CGI rather than a direct URL to distribution files, and the URI has nothing whatsoever to do with the name of the resulting file. This, obviously, breaks MASTER_SITES and DISTFILES because what I have to put in DISTFILES doesn't match what would go in the distinfo file. > > I'm poking around at possible alternatives, but nothing really stands out in the reading I've done. Is this sort of thing supported by the ports system at all, or should I just abandon this completely and switch to fully manual builds? > > I briefly looked at downloading the patch file, splitting it up (it includes several patches) and including the resulting files in files/patch-*. This would be worth the work, but I'm also toying with eventually submitting my changes as a patch to the port with a line in OPTIONS to include/ignore the 3rd party patches and I can't find a way to wrap an ifdef around patch-* files in the Makefile, since they seem to be auto-discovered and acted on. > > If anyone has any advice on how to handle this in a way that solves both problems, I'd appreciate it. Thanks in advance! > Matt Pounsett > Hi Matt, there is a way, sample ports: dns/djbdns, dns/bind94, mail/postfix (VDA patches) and many more A short description can be found in Mk/bsd.port.mk A longer description can be found in the porters handbook http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html Additional you can place a patch without the prefix "patch-" into the portname/files directory, then use for example .if defined(PATCH_THIS_FOO) EXTRA_PATCHES+= .endif