[patch] cygport-0.2.7 hooks for additional prep, install customization

Charles Wilson cygwin@cwilson.fastmail.fm
Sat Jan 6 03:14:00 GMT 2007


Cygport automates many of the tedious steps of the build process for 
cygwin ports (and that's a GOOD thing).  However, at present there are 
cases when the existing customization/extension points provided by 
cygport are not sufficient -- the user needs to intervene 
before/after/during some of the automated steps.

[implementation details]
[1] Possibiliyt: remove the readonly protection on the existing, 
internal, automation functions (like __prep_installdir or src_prep). 
This is a really bad idea: some of these functions (especially the __* 
ones) are NOT part of cygport's public interface, and are subject to 
change in later releases -- a .cygport file that redefines these is 
brittle with respect to future releases of the cygport framework. 
Others, like src_prep(), are large, complicated, and must NOT be changed 
in any appreciable way, because other functions in cygport depend on 
stuff being "just so".  .cygport files that redefine these functions 
will ALSO be brittle -- and worse, could break things with respect to 
later cygport framework releases that are hard to identify.  Finally, 
carrying around duplicate copies (one in cygport itself, the other in 
the .cygport file) with only minor difference is a silly waste. IMNSHO.

[2] Possibility: supply additional customization/extension points to 
allow the end user more flexibility to customize certain aspects of the 
automated "tedious steps" when necessary.  Without, mind you, obligating 
.cygport files to carry around lots of redundant copies of functions 
defined in the main cygport framework, nor overriding functions which 
are *supposed* to be internal implementation details of the cygport 
framework itself.

Obviously, I prefer [2], which is implemented below for the prep and 
install stages.

Note that src_prep_init_hook is NOT called as the absolute first step in 
'cygport ... prep', because that makes no sense: src_prep needs to at 
least create the various (empty) directories that all cygports expect to 
be present, and unpack the main src entities.  It isn't clear to me 
whether this customization point should come before or after applying 
the patches in cygport-0.2.7's new PATCH_URI list.  I choose "before", 
because that will work better for ncurses[*].

---------------------------------------------------------------
[*] ncurses's official patches are distributed as:

    (1) a "rollup patch" that is a shell script, and which contains a 
shar archive of all patches prior to that date.  This script applies the 
patches itself.  The upstream maintainer generates rollup patches every 
three months or so.

    (2) a possibly empty set of up to 12 weekly, noncumulative .patch files.

If I put the patches in (2) into PATCH_URI, they need to be applied 
after the rollup patch script is run -- and THAT needs to be done in 
src_prep_init_hook().  So, src_prep invokes src_prep_init_hook() before 
it applies the patches in PATCH_URI.
---------------------------------------------------------------


2007-01-05  Charles Wilson  <...>

	* cygport.in (src_prep_init_hook): new (empty) function
	(src_prep_fini_hook): ditto
	(src_prep): fix bug where 'cd ${SRCDIR}' happened before
	checking if '${SRCDIR}' actually exists.
	(src_prep): call src_prep_init_hook() after setting up the
	cygport directory structure, unpacking all entities in SRC_URI,
	but before applying any of the patches in PATCH_URI, and before
	mirroring the origsrc directory to the src directory, or
	applying the .src.patch and .cygwin.patch to the src directory).
	(src_prep): call src_prep_fini_hook() after doing ALL of the
	above.
	(src_install_init_hook): new (empty) function
	(src_install_fini_hook): new (empty) function
	(main) [case inst*]: call src_install_init_hook FIRST, then
	other automated installation steps, then src_install_fini_hook
	LAST
	(main): export all hook functions.

--
Chuck



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygport-hooks.patch
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070106/e8f4c4f6/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