Patching ports

2004-05-05 Thread Mikkel Christensen
Hi

How do I add a patch to a certain port?
Usually I would use the patch program to add the patch to the source code.
But when using ports the system begins compiling right after rewtrieving the source. 
Thus not giving me a change to apply the patch.
I've seen a folder named files in which patches part of the port seem to be located. 
But just adding the patchfile here apperently wont do much good.
I've tried using the PATCHFILES variable in the Makefile but then the system 
complains the my patchfile does not have a matching MD5 hash.
Does anyone know how to handle this issue?

- Mikkel
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching ports

2004-05-05 Thread Bill Moran
Mikkel Christensen wrote:
Hi

How do I add a patch to a certain port?
Usually I would use the patch program to add the patch to the source code.
But when using ports the system begins compiling right after rewtrieving the source. 
Thus
 not giving me a change to apply the patch.
I've seen a folder named files in which patches part of the port seem to be located.
 But just adding the patchfile here apperently wont do much good.
I've tried using the PATCHFILES variable in the Makefile but then the system complains
 the my patchfile does not have a matching MD5 hash.
Does anyone know how to handle this issue?
The manual way to patch stuff is this:

make extract
cd work/any other subdirs you need to cd into
patch the source
cd back to the port dir
make
make extract will fetch the tarball and extract it into the work directory.  There 
you
can patch it to your heart's content and return to do make when done.  You can also
do make patch instead of make extract - this will do the extract step and also 
apply
any patches provided by FreeBSD.  It's a matter of whether you want to apply your 
patches
before or after the FreeBSD patches.
--
Bill Moran
Potential Technologies
http://www.potentialtech.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching ports

2004-05-05 Thread Matthew Seaman
On Wed, May 05, 2004 at 12:11:22PM +, Mikkel Christensen wrote:

 How do I add a patch to a certain port?
 Usually I would use the patch program to add the patch to the source code.
 But when using ports the system begins compiling right after rewtrieving the source. 
 Thus not giving me a change to apply the patch.
 I've seen a folder named files in which patches part of the port seem to be 
 located. But just adding the patchfile here apperently wont do much good.
 I've tried using the PATCHFILES variable in the Makefile but then the system 
 complains the my patchfile does not have a matching MD5 hash.
 Does anyone know how to handle this issue?

When building a port you can type:

# make extract

which will download any sources, check the size and checksums, unpack
the sources into the work directory and apply any patches that come
with the port.  And then stop.  At this point you can make whatever
modifications you wish to yourself, and then finish off the build by

# make

So long as your patch doesn't add or delete files from the expected
packing list then just doing a:

# make install

will work.

It is also possible to put your patch file into the port's files
directory and have it automatically applied, but you need to take care
to account for the order that patch files get applied.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgp0.pgp
Description: PGP signature


Re: Patching ports

2004-05-05 Thread Mikkel Christensen
On Wednesday 05 May 2004 12:29, Matthew Seaman wrote:
 On Wed, May 05, 2004 at 12:11:22PM +, Mikkel Christensen wrote:
 
  How do I add a patch to a certain port?
  Usually I would use the patch program to add the patch to the source code.
  But when using ports the system begins compiling right after rewtrieving the 
  source. Thus not giving me a change to apply the patch.
  I've seen a folder named files in which patches part of the port seem to be 
  located. But just adding the patchfile here apperently wont do much good.
  I've tried using the PATCHFILES variable in the Makefile but then the system 
  complains the my patchfile does not have a matching MD5 hash.
  Does anyone know how to handle this issue?
 
 When building a port you can type:
 
 # make extract
 
 which will download any sources, check the size and checksums, unpack
 the sources into the work directory and apply any patches that come
 with the port.  And then stop.  At this point you can make whatever
 modifications you wish to yourself, and then finish off the build by
 
 # make
 
 So long as your patch doesn't add or delete files from the expected
 packing list then just doing a:
 
 # make install
 
 will work.
 
 It is also possible to put your patch file into the port's files
 directory and have it automatically applied, but you need to take care
 to account for the order that patch files get applied.
 

Thank you both for a quick and explaning reply.
The last par of your answer brings up a short question though.

Will patch-files automatically be run if they are placed in the files folder?

It did not seem that way when I tried but I might have done something wrong:)

- Mikkel
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Patching ports

2004-05-05 Thread Simon Barner
Hi,

 How do I add a patch to a certain port? Usually I would use the patch
 program to add the patch to the source code. But when using ports the
 system begins compiling right after rewtrieving the source. Thus not
 giving me a change to apply the patch. I've seen a folder named files
 in which patches part of the port seem to be located. But just adding
 the patchfile here apperently wont do much good. I've tried using the
 PATCHFILES variable in the Makefile but then the system complains the
 my patchfile does not have a matching MD5 hash. Does anyone know how to
 handle this issue?

You can use ``make patch'' to extract the port and apply existing
FreeBSD patches to it. Now you can create your own local patches
(relative to ${WRKDIR} which is
/usr/ports/category/portname/work/portname-version-mumble by
default), and put them into into the files subdirectory of your port.
Please note, that the FreeBSD port system will ignore patches that do
not start with the ``patch-'' prefix (you could use the EXTRA_PATCHES
macro to work around or exploit that fact) (``grep'' the ports
tree for examples)

You can find more information on how to work on the ports collection in
the porters handbook:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html
file:///usr/share/doc/en_US.ISO8859-1/books/porters-handbook/index.html

One last side remark:
If you think that your patches are useful for either the FreeBSD or the
whole open source community, it would be really nice if you sent them as
a problem report (send-pr(1), see the porter's handbook) or to the author
of the software.

Regards,
 Simon


signature.asc
Description: Digital signature