|Summary:||sys-libs/pam-1.1.5 fails to cross-compile because flex is not installed in the target|
|Product:||Gentoo Linux||Reporter:||Ambroz Bizjak <ambrop7>|
|Component:||[OLD] Core system||Assignee:||PAM Gentoo Team (OBSOLETE) <pam-bugs+disabled>|
|Severity:||normal||CC:||alexanders83, chewi, steev, zerochaos|
|Package list:||Runtime testing required:||---|
|Bug Depends on:||317337|
Description Ambroz Bizjak 2012-12-05 22:11:04 UTC
PAM requires that libfl.a from sys-devel/flex be present in the target root at build time. When building for native, this is not a problem, because there is a DEPEND on sys-devel/flex. But for cross-compile, DEPEND by default means that the package is needed on the host, so there is no guarantee that flex will also be present in the target filesystem. Reproducible: Always Steps to Reproduce: 1. Make sure sys-devel/flex is not installed in the target (!) filesystem 2. Try to cross-compile sys-libs/pam
Comment 2 Ambroz Bizjak 2012-12-05 22:23:52 UTC
Created attachment 331572 [details, diff] pam-1.1.5.ebuild-flex-check.patch This patch adds a manual check into the ebuild to abort if flex is not installed, and instructs the user to cross-compile flex and try again (as opposed to failing with an obscure error). A proper solution for this bug will only be possible after the features in the experimental EAPI 5-hdepend become part of an official EAPI. Then, sys-devel will be put both into HDEPEND and DEPEND, ensuring it is installed in both the host and the target at build time. For more information, see http://blogs.gentoo.org/zmedico/2012/09/25/experimental-eapi-5-hdepend/ . P.S. I'm not sure if the flex check should instead go into pkg_pretend()? If that was done, consider that on native installs, flex may not be installed in pkg_pretend() but will be by the time the package is built, as a dependency, so tc-is-cross-compiler really is necessary.
Comment 3 Ambroz Bizjak 2012-12-05 22:47:59 UTC
Created attachment 331576 [details, diff] pam-1.1.5.ebuild-flex-hdepend.patch Proper fix utilizing HDEPEND. P.S. This bug should depend on 317337 (EAPI HDEPEND support).
Comment 4 Alexander Stein 2013-01-09 09:31:25 UTC
I'm doing cross-compiling myself and can confirm that installing flex on the build-host is required. So reply #3 seems correct
Comment 5 James Le Cuirot 2014-01-15 12:32:25 UTC
Ambroz, you can add the dependency on bug #317337 yourself since you created this bug. I have filed a couple of other use-cases for HDEPEND, autogen and dbus-glib.
Comment 6 SpanKY 2014-05-08 22:30:23 UTC
the pam package has DEPEND=sys-devel/flex. that is sufficient to cross-compile.
Comment 7 James Le Cuirot 2014-05-08 23:22:45 UTC
Mike, please reopen this. flex needs to be installed to the *target* which DEPEND can't help with.