[patch] cygport

Charles Wilson cygwin@cwilson.fastmail.fm
Mon Oct 23 02:54:00 GMT 2006


The attached patch (+ two new files) enables cygport to build 
"relocatable" packages using the framework devised by Bruno Haible -- if 
the upstream source supports it.  Currently, only libiconv and gettext 
support this feature (coincidentally, the upstream maintainer of both 
packages is...Bruno Haible).

A relocated package is compiled using a temporary --prefix, like 
/tmp/libiconv-reloc-912385{/bin,/share,/lib,...}  It is then installed 
into /usr{/bin,/share,/lib,...} -- but internally, all applications and 
libraries "figure out" where things are by computing relative paths 
between "where I thought I was going to be" and "where I actually am 
installed".  So, in our case
   (1) cygbuild needs to use ${RELOC}/usr/... not just /usr/...
   (2) cyginstall needs a little tweaking so that things end up in
       ${D}/${RELOC/usr/... and not ${D}/usr/...
   (3) pkg_binpkg needs to cd into ${D}${RELOC}, not ${D} before tar'ing
       things up.
There are other minor tweaks -- but if you don't 'import relocatable', 
then they are all no-ops (e.g. ${RELOC} is empty).  That is, the global 
variable _ENABLE_RELOCATION (initially empty) acts like the 
_USE_CVS_FETCH/_USE_SVN_FETCH/_USE_GIT_FETCH variables, in that a 
cygclass sets it in order to modify the behavior of functions defined in 
the main cygport script.  Don't 'import relocatable' -- and behavior is 
unchanged from current (except for the added postinstall/preremove 
features, described next).

Look for my upcoming official releases of libiconv-1.11 and gettext-0.15 
soon, for examples of how to (or not) use the relocation feature for 
these packages.


The attached patch ALSO allows cygports to handle cases where a 
multi-binpkg project has different postinstall/preinstall scripts for 
more than one of the subpackages.  This also required adding the ability 
for client cygports to turn off automatic install-info postinstall 
generation (e.g. in gettext, gettext.info belongs to the gettext-devel 
subpackage (so gettext.sh can't install it), but libasprintf.info 
belongs to the gettext subpackage.


Both of these changes were necessary to convert libiconv/gettext over to 
a cygbuild process.


NEW FILE: bin/prep_relocated_libtool_la.sh
    make sure that .la files don't have references to their
    temporary --prefix.

NEW FILE: lib/relocatable.cygclass
    mainly just "turns on" the relocation support (and "turns off"
    /usr/lib/cygports/bin/<SCRIPTS> that don't have appropriate support.

2006-10-21  Charles Wilson  <...>

	* bin/Makefile.am: add new file prep_relocated_libtool_la.sh
	* bin/prep_relocated_libtool_la.sh: new file
	* lib/Makefile.am: add new file relocatable.cygclass
	* lib/relocatable.cygclass: new file
	* bin/prep_gnu_info.sh: allow cygport client to suppress
	automatic install-info (useful if: subpackages each have own
	explicit postinstall scripts, and each subpackage "owns"
	certain info files.  To activate *suppression*, set
	SUPPRESS_AUTOMATIC_INSTALLINFO to non-empty.  Default behavior
	is unchanged from current.
	* bin/cygport.in (_ENABLE_RELOCATION): new global variable
	(_RELOCDIR): new global variable
	(__init_relocation): new function
	(__check_relocation): new function
	(__maybe_relocate): new function (main hook for relocatation
	support, called by other cygport functions)
	(cygconf): Add support for ${_RELOCDIR} and --enable-relocatable
	(docinto): Add support for ${_RELOCDIR}
	(exeinto): Add support for ${_RELOCDIR}
	(insinto): Add support for ${_RELOCDIR}
	(__prepare_relocation_ins): new function sets up top level of
	${D} to point to ${D}${_RELOCDIR}
	(cyginstall): Add support for ${_RELOCDIR}.  Optionally call
	__prepare_relocation_ins.
	(__prepetc): allow ${C}/${PN}.postinstall and ${C}/${PN}.sh as
	synonyms for ${C}/postinstall.sh (however, presence of more than
	one of these causes error message).  Allow ${C}/${PN}.preremove
	as synonym for ${C}/preremove.sh (but presence of both causes
	error message).  Allow for ${C}/${pkg_name[${n}]}.postinstall
	and/or ${C}/${pkg_name[${n}]}.preremove [n > 1].
	(__prepstrip): Add support for ${_RELOCDIR}. Also if relocation
	is enabled, call prep_relocated_libtool_la.sh
	(pkg_binpkg): add support for ${_RELOCDIR}
	(pkg_pkgcheck): add support for ${_RELOCDIR}
	(finish): don't forget to clean up /tmp/temporary-prefix
	directory (even though we never actually install anything there;
	instead we install into ${D}/tmp/temporary-prefix)

--
Chuck
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygport.diff
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061023/fe3b339d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prep_relocated_libtool_la.sh
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061023/fe3b339d/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: relocatable.cygclass
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061023/fe3b339d/attachment-0002.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