x11-wm/windowmaker: fix cross-compilation
authorBernard Cafarelli <voyageur@gentoo.org>
Fri, 24 Jan 2020 14:29:52 +0000 (15:29 +0100)
committerBernard Cafarelli <voyageur@gentoo.org>
Fri, 24 Jan 2020 14:29:52 +0000 (15:29 +0100)
Thanks David Michael for patch and bug report

Closes: https://bugs.gentoo.org/706006
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
x11-wm/windowmaker/files/windowmaker-0.95.8-configure_default_search_paths.patch [new file with mode: 0644]
x11-wm/windowmaker/windowmaker-0.95.8-r1.ebuild

diff --git a/x11-wm/windowmaker/files/windowmaker-0.95.8-configure_default_search_paths.patch b/x11-wm/windowmaker/files/windowmaker-0.95.8-configure_default_search_paths.patch
new file mode 100644 (file)
index 0000000..fa323b7
--- /dev/null
@@ -0,0 +1,70 @@
+From: David Michael <fedo...@gmail.com>\r
+To: wmaker-dev@googlegroups.com\r
+Subject: [PATCH] configure: Allow changing default search paths\r
+Date: Thu, 16 Jan 2020 14:59:33 -0500\r
+\r
+This changes the behavior of the --with-{inc,lib}s-from arguments\r
+to replace the default paths instead of adding to them.  This is\r
+required when cross-compiling in a sysroot, since the default paths\r
+will include files from the host system which can have an\r
+incompatible architecture.\r
+---\r
+1. What happened: could not compile\r
+\r
+2. Detailed description of what happened:\r
+Cross-compiling in a sysroot searches for development files on the\r
+host.  The build fails when building between two very different\r
+architectures.\r
+\r
+3. How to reproduce the bug, if known:\r
+Cross-compile in a sysroot (from x86_64 to ppc with Gentoo in my case).\r
+\r
+6. The error occurred during: compilation\r
+\r
+8. Error messages output:\r
+There are about two megabytes of errors about float128 not being defined\r
+for the architecture, from including the x86_64 headers in /usr/include\r
+for the ppc compiler.\r
+\r
+9. Fix, if known:\r
+This commit makes it build when passing --with-{inc,lib}s-from= and it\r
+shouldn't be a big behavior change for most cases.\r
+\r
+10. Other Notes:\r
+I didn't dig into the history of those search variables, but a better\r
+fix might be to just remove them entirely.  It doesn't seem to do any\r
+good to redundantly add the default search paths, or if includedir or\r
+libdir were changed, the usual CPPFLAGS and LDFLAGS environment\r
+variables could set the search paths.\r
+\r
+ configure.ac | 8 ++------\r
+ 1 file changed, 2 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/configure.ac b/configure.ac\r
+index a19acce5..0129f4e7 100644\r
+--- a/configure.ac\r
++++ b/configure.ac\r
+@@ -284,18 +284,14 @@ _bindir=`eval echo $_bindir`\r
+ _libdir=`eval echo $libdir`\r
+ _libdir=`eval echo $_libdir`\r
\r
+-lib_search_path='-L${libdir}'\r
+-\r
+-inc_search_path='-I${includedir}'\r
+-\r
+ dnl ===============================================\r
+ dnl Specify paths to look for libraries and headers\r
+ dnl ===============================================\r
+ AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),\r
+-      [lib_search_path="$withval $lib_search_path"])\r
++      [lib_search_path="$withval"], [lib_search_path='-L${libdir}'])\r
\r
+ AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),\r
+-      [inc_search_path="$withval $inc_search_path"])\r
++      [inc_search_path="$withval"], [inc_search_path='-I${includedir}'])\r
\r
\r
+ dnl Features Configuration\r
+-- \r
+2.21.1\r
+\r
index 18e442e7939832488b5a291e49d3b5d4bbbdf777..7fd9518848a6ce060e357bd4a18c3696a298061d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -33,6 +33,8 @@ RDEPEND="${DEPEND}
 
 S=${WORKDIR}/${P/windowm/WindowM}
 
+PATCHES=( "${FILESDIR}"/${P}-configure_default_search_paths.patch )
+
 src_prepare() {
        # Fix some paths
        for file in WindowMaker/*menu* util/wmgenmenu.c; do