wine: fix sane related build failure
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 5 Jul 2015 11:15:00 +0000 (13:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 5 Jul 2015 15:16:40 +0000 (17:16 +0200)
If sane is installed system-wide on the build machine, then the
sane-config binary found is the one of the system, which returns
incorrect library paths for cross-compilation.

To fix this, this commit adds a patch to wine to make it support a
SANE_CONFIG environment variable, and then adjusts wine.mk to
explicitly pass the path to $(STAGING_DIR)/usr/bin/sane-config.

Fixes:

  http://autobuild.buildroot.org/results/8bd/8bdc1eed55075313403aa8a6c9af6a427bce198e/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
package/wine/0003-sane-config-fix.patch [new file with mode: 0644]
package/wine/wine.mk

diff --git a/package/wine/0003-sane-config-fix.patch b/package/wine/0003-sane-config-fix.patch
new file mode 100644 (file)
index 0000000..d53843a
--- /dev/null
@@ -0,0 +1,21 @@
+Add support for SANE_CONFIG variable
+
+Instead of using directly the sane-config command, allow to pass a
+SANE_CONFIG environment variable to override where to find the
+sane-config tool.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -1375,7 +1375,7 @@
+ if test "x$with_sane" != "xno"
+ then
+     ac_save_CPPFLAGS="$CPPFLAGS"
+-    WINE_PACKAGE_FLAGS(SANE,[libsane],,[`sane-config --cflags 2>/dev/null`],[`sane-config --ldflags 2>/dev/null`])
++    WINE_PACKAGE_FLAGS(SANE,[libsane],,[`${SANE_CONFIG:-sane-config} --cflags 2>/dev/null`],[`${SANE_CONFIG:-sane-config} --ldflags 2>/dev/null`])
+     AC_CHECK_HEADER(sane/sane.h,
+         [WINE_CHECK_SONAME(sane,sane_init,,[SANE_CFLAGS=""],[$SANE_LIBS])],
+         [SANE_CFLAGS=""])
index 1ae038efb5c739828e6c17389b549fbb923d9924..d6fb9c6d015738cf9987d4a51b310b78970905e2 100644 (file)
@@ -174,6 +174,7 @@ endif
 ifeq ($(BR2_PACKAGE_SANE_BACKENDS),y)
 WINE_CONF_OPTS += --with-sane
 WINE_DEPENDENCIES += sane-backends
+WINE_CONF_ENV += SANE_CONFIG=$(STAGING_DIR)/usr/bin/sane-config
 else
 WINE_CONF_OPTS += --without-sane
 endif