public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCHES] multilib-build: public API for header wrapping
@ 2013-04-04 20:50 Michał Górny
  2013-04-04 20:51 ` [gentoo-dev] [PATCH 1/2] Move header wrapping code into multilib-build Michał Górny
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michał Górny @ 2013-04-04 20:50 UTC (permalink / raw
  To: Gentoo Developer Mailing List

[-- Attachment #1: Type: text/plain, Size: 2627 bytes --]

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 <install-root> 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=${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.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-07 18:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 20:50 [gentoo-dev] [PATCHES] multilib-build: public API for header wrapping Michał Górny
2013-04-04 20:51 ` [gentoo-dev] [PATCH 1/2] Move header wrapping code into multilib-build Michał Górny
2013-04-04 20:51 ` [gentoo-dev] [PATCH 2/2] multilib-minimal: enable installing wrappers Michał Górny
2013-04-04 21:17 ` [gentoo-dev] [PATCHES] multilib-build: public API for header wrapping Alexis Ballier
2013-04-07 16:58 ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox