aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/wayland/wayland.mk29
1 files changed, 17 insertions, 12 deletions
diff --git a/package/wayland/wayland.mk b/package/wayland/wayland.mk
index a823d2b761..3ab94ca30c 100644
--- a/package/wayland/wayland.mk
+++ b/package/wayland/wayland.mk
@@ -11,22 +11,27 @@ WAYLAND_LICENSE = MIT
WAYLAND_LICENSE_FILES = COPYING
WAYLAND_INSTALL_STAGING = YES
-WAYLAND_DEPENDENCIES = libffi host-pkgconf expat host-expat
+WAYLAND_DEPENDENCIES = libffi host-pkgconf host-wayland expat
-# wayland needs a wayland-scanner program to generate some of its
-# source code. By default, it builds it with CC, so it doesn't work with
-# cross-compilation. Therefore, we build it manually, and tell wayland
-# that the tool is already available.
+# wayland-scanner is only needed for building, not on the target
WAYLAND_CONF_OPT = --disable-scanner
-define WAYLAND_BUILD_SCANNER
- (cd $(@D)/src/; \
- $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
- -o wayland-scanner scanner.c wayland-util.c -lexpat; \
- $(INSTALL) -m 0755 -D wayland-scanner \
- $(HOST_DIR)/usr/bin/wayland-scanner)
+# We must provide a specialy-crafted wayland-scanner .pc file
+# which we vampirise and adapt from the host-wayland copy
+define WAYLAND_SCANNER_PC
+ $(INSTALL) -m 0644 -D $(HOST_DIR)/usr/share/pkgconfig/wayland-scanner.pc \
+ $(STAGING_DIR)/usr/lib/pkgconfig/wayland-scanner.pc
+ $(SED) 's:^prefix=.*:prefix=/usr:' \
+ -e 's:^wayland_scanner=.*:wayland_scanner=$(HOST_DIR)/usr/bin/wayland-scanner:' \
+ $(STAGING_DIR)/usr/lib/pkgconfig/wayland-scanner.pc
endef
+WAYLAND_POST_INSTALL_STAGING_HOOKS += WAYLAND_SCANNER_PC
-WAYLAND_POST_CONFIGURE_HOOKS += WAYLAND_BUILD_SCANNER
+# Remove the DTD from the target, it's not needed at runtime
+define WAYLAND_TARGET_CLEANUP
+ rm -rf $(TARGET_DIR)/usr/share/wayland
+endef
+WAYLAND_POST_INSTALL_TARGET_HOOKS += WAYLAND_TARGET_CLEANUP
$(eval $(autotools-package))
+$(eval $(host-autotools-package))