From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 843621381F3 for ; Thu, 4 Apr 2013 20:50:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 63BADE07B5; Thu, 4 Apr 2013 20:50:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67ACEE0769 for ; Thu, 4 Apr 2013 20:50:23 +0000 (UTC) Received: from pomiocik.lan (77-253-144-190.adsl.inetia.pl [77.253.144.190]) (using SSLv3 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id D34A633DC52 for ; Thu, 4 Apr 2013 20:50:21 +0000 (UTC) Date: Thu, 4 Apr 2013 22:50:46 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: Gentoo Developer Mailing List Subject: [gentoo-dev] [PATCHES] multilib-build: public API for header wrapping Message-ID: <20130404225046.434b7ba1@pomiocik.lan> Organization: Gentoo X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.17; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA512; boundary="Sig_/YfFWqiOmHG1K688ETr1ak1D"; protocol="application/pgp-signature" X-Archives-Salt: a3cd2855-7deb-4767-99c0-0503f2b234e9 X-Archives-Hash: 4e4f9b031430f28f78af22b54521532d --Sig_/YfFWqiOmHG1K688ETr1ak1D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, Following the introduction of header wrapping in autotools-multilib, I'm submitting two patches: one providing a public API for it in multilib-build, and the other one using it in multilib-minimal. Both patches will be sent in reply to this mail. The API consists of two functions: multilib_prepare_wrappers and multilib_install_wrappers. Although currently they handle header wrapping only, they could be theoretically extended to support more kinds of wrappers. Both functions take an optional argument which defaults to ${ED}. That argument is used for obtaining wrapped files and storing the wrappers. However, it does not affect the temporary storage location which is '${ED}/tmp' unconditionally. Both functions use environment variables to obtain the list of files to be wrapped. The MULTILIB_WRAPPED_HEADERS variable is used, the same as in the initial approach. In future, more variables can be used to support more kinds of wrappers. The multilib_prepare_wrappers function needs to be called for each ABI after the files for that ABI were installed, with the root to which they were installed. It moves the necessary out of the root, and prepares the wrapper in the temporary area. The multilib_install_wrappers functions needs to be called once after all the wrappers were prepared and they can be installed. The wrappers are installed in the root passed to it, and temporary area is cleaned. That said, there are two generic approaches to wrapping: a) install-and-wrap approach as used by the current eclasses: foo_install() { some_foo_install # installs to ${D} multilib_prepare_wrappers } multilib_foreach_abi foo_install multilib_install_wrappers In this approach, each successive ABI potentially overwrites files installed by the previous one. The wrapper preparation needs to follow the install phase so that wrapped files are preserved in their original form. Afterwards, wrappers are installed on top of the install. b) install-then-merge approach: bar_install() { local myfakeroot=3D${ED}/_${ABI} some_bar_install "${myfakeroot}" # installs to the fake root multilib_prepare_wrappers "${myfakeroot}" multibuild_merge_root "${myfakeroot}" "${ED}" } multilib_parallel_foreach_abi bar_install multilib_install_wrappers This time, all per-ABI installs are done in separate directories. This allows them to be done in parallel. The wrapper preparation needs to be done on the separate copies, then those can be merged onto the real root. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/YfFWqiOmHG1K688ETr1ak1D Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQJ8BAEBCgBmBQJRXeenXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ1RUJGMjBGOTk2RkIzQzIyQ0M2RkNBNDBC QUJGMUQ1RkY4QzgxMTBBAAoJELq/HV/4yBEKr2oP/R4ljFZagsCGE3tP7+WYQeWc nAb4N9lo5g1iAG7dFg229neaWDboOmRqxYomGelKA4noeHS8Ol8DNzSjyNdyDeQk luovNIRRUdzGWVxvGCP9xqDSFjbWm7V44DvWMsATzuWhpsQ41rPhfRLeGeBdxfun 3TZjMDqKlmoYDLMUMLlKzvsWy0APjMB36XfHFSGbIoBQOk8HxcPLdto2Hu5PWNDO kITdaKFvn2kY3kkANwb0sCWmHqdDwRo+hWfbd68ZUFdSzgI7YX45gCKrIIwsJeJX LnYftUfN2N7hyxnRFgrpaaWYVE8RLHNl5LrC1Q8T5y4DH3SvbHDDTRBQmj7mdtq8 IbPruBl7bVo0fF+86JwbVO01Af8iR3ZVE5Ja9Hz+RodXfy+qUb3I05IU4bgW4os8 y0kMLeL20ULfFJ2cZXBmYi6I3bJFFPPjHN8TV9q0wvYWxA0SSyVaiTqa8AwmaoP9 jxXoDk5Lig8tZ+k2qlfGVX1Pxz+AJ/EEaAHgHlGGjDKz29tqE+5iTP98swCiU3NJ MIU/WZdPEaIlrOGPbmuI4znTcribqYTkpUROTNoZ6LGOv3BcFEzQ+TIoUPvDEJ2c huAJVMfA+8xA+8S2bUr7+8VcFishop3FSJFO5NBdh+ikl2n00S3Wb9GY57ZCKCiw Kgx/bffDd4KLZKhCyVxc =RdbA -----END PGP SIGNATURE----- --Sig_/YfFWqiOmHG1K688ETr1ak1D--