[patch] cygport enhancement

Charles Wilson cygwin@cwilson.fastmail.fm
Tue Nov 7 15:17:00 GMT 2006


At present, if you use cvs|svn|git cygclass, you can only have one 
SRC_URI.  This patch does three related things

   (1) relaxes that restriction slightly.  Now, the *first* SRC_URI 
corresponds to the tarball created from the remote repository checkout 
via CVS_URI/SVN_URI/GIT_URI.  The other entries in SRC_URI may be 
mirror, http, or ftp URIs -- or local files (see #2, next).

   (2) Sometimes, .src.patch and .cygwin.patch just aren't enough. If 
SRC_URI contains multiple URI's, then only the first one need be 
cvs|svn|git|mirror|http|ftp.  The others are now allowed to be simple 
files; 'cygport get' will warn, not error, if it fails to recognize the 
download protocol of the 2nd...Nth URI.

   (3) If SRC_URI contains extra patches, then you need some way to 
apply them -- and src_prep() is protected.  Implement overridable (and 
no-op by default) functions src_prep_init_hook() src_prep_fini_hook(). 
The former is called just after all SRC_URIs are unpacked; the latter at 
the end of src_prep (e.g after the .src.patch and .cygwin.patch are 
applied).

These changes were necessary to support building jpeg (using the 
autotoolized source package at sourceforge, and the lossless compression 
patch from simplesystems, and the debian lossless-crop patch[locally 
modified to apply cleanly after the simplesystems change]):

----------------------%<-------------------
...
CVS_URI=":pserver:anonymous@libjpeg.cvs.sourceforge.net:/cvsroot/libjpeg"
CVS_DATE="2006-03-01"
PD=${CVS_DATE//-}
CVS_MODULE=lib${PN}
inherit cvs

SRC_URI="${PN}-${PV}-${PD}.tar.bz2 \
ftp://ftp.simplesystems.org/pub/ImageMagick/delegates/ljpeg-6b.tar.gz \
jpegv6b-losslesscrop-after-ljpeg.patch"

SRC_DIR="lib${PN}"
...
src_prep_init_hook() {
         cd ${origsrcdir}
         mv testimgl* ${SRC_DIR}/
         cd ${SRC_DIR}
         apply_patch ${origsrcdir}/ljpeg-6b.patch
         apply_patch jpegv6b-losslesscrop-after-ljpeg.patch
}
----------------------%<-------------------

--
Chuck

P.S. Ping on relocatable patch?

2006-11-07  Charles Wilson  <...>

	* bin/cygport.in (src_fetch_auto): new function. Autodetects
	protocol of passed-in URI (mirror|http|ftp) and errors if
	no recognized protocol detected
	(src_fetch_auto_warn): new function. Autodetects protocol
	of passed-in URI (mirror|http|ftp) and issues a warning if
	no recognized protocol detected
	(src_fetch): call src_fetch_auto_warn for 2nd..Nth SRC_URI
	regardless of download method (cvs|svn|git|mirror|http|ftp)
	of first SRC_URI.  If !(cvs|svn|git), call src_fetch_auto
	for first SRC_URI -- which will error if first SRC_URI's
	protocol is unrecognized.
	(src_prep_init_hook): new function. no-op.
	(src_prep_fini_hook): new function. no-op.
	(src_prep): call src_prep_init_hook and src_prep_fini_hook.

	* lib/cvs.cygclass: extract first name from SRC_URI and use that
	to generate tarball name. Ensure that working directory is
	unchanged by a call to cvs_fetch.
	* lib/svn.cygclass: extract first name from SRC_URI and use that
	to generate tarball name. Ensure that working directory is
	unchanged by a call to svn_fetch.
	* lib/git.cygclass: extract first name from SRC_URI and use that
	to generate tarball name. Ensure that working directory is
	unchanged by a call to git_fetch.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygport-mixedmode.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061107/69e14c5c/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list