libdrm: add option to build the intel driver
authorBernd Kuhls <bernd.kuhls@t-online.de>
Sat, 27 Feb 2021 13:04:21 +0000 (14:04 +0100)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Sat, 27 Feb 2021 14:45:34 +0000 (15:45 +0100)
libpciaccess is not needed for libdrm itself, only the intel driver
depends on it:
https://cgit.freedesktop.org/mesa/drm/tree/meson.build#n240

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
libs/libdrm/Config.in [new file with mode: 0644]
libs/libdrm/Makefile

diff --git a/libs/libdrm/Config.in b/libs/libdrm/Config.in
new file mode 100644 (file)
index 0000000..32602c7
--- /dev/null
@@ -0,0 +1,11 @@
+menu "Select libdrm build options"
+               depends on PACKAGE_libdrm
+
+config LIBDRM_INTEL
+       bool "Intel support"
+       default n
+       depends on x86_64 || i386
+       help
+               Installs the Intel driver.
+
+endmenu
index 36c44e6d455daa69baead18c239b75eca89b42c8..d05ef93cf735da915be03340380f313d3e470a31 100644 (file)
@@ -16,6 +16,9 @@ PKG_HASH:=d66ad8b5c2441015ac1333e40137bb803c3bde3612ff040286fcc12158ea1bcb
 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_LIBDRM_INTEL
+
 PKG_INSTALL:=1
 PKG_BUILD_DEPENDS:=meson/host
 
@@ -25,7 +28,7 @@ include ../../devel/meson/meson.mk
 define Package/libdrm
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libpciaccess
+  DEPENDS:=+LIBDRM_INTEL:libpciaccess
   TITLE:=libdrm
   URL:=https://dri.freedesktop.org/
 endef
@@ -36,9 +39,12 @@ define Package/libdrm/description
   of the DRI protocol.
 endef
 
+define Package/libdrm/config
+       source "$(SOURCE)/Config.in"
+endef
+
 MESON_ARGS += \
-       -Dlibkms=false \
-       -Dintel=false \
+       $(if $(CONFIG_LIBDRM_INTEL),-Dintel=true -Dlibkms=true,-Dintel=false -Dlibkms=false) \
        -Dradeon=false \
        -Damdgpu=false \
        -Dnouveau=false \
@@ -60,14 +66,14 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdrm.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdrm.pc $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
 endef
 
 define Package/libdrm/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdrm.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libdrm))