Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 00:07:04 +0200
From:      Olli Hauer <ohauer@FreeBSD.org>
To:        Matthew Pounsett <matt@conundrum.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Complicated patching
Message-ID:  <4DD2F188.6050402@FreeBSD.org>
In-Reply-To: <958AF7F7-AD80-4F01-8F1D-E9E262B953F6@conundrum.com>
References:  <958AF7F7-AD80-4F01-8F1D-E9E262B953F6@conundrum.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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