From patchwork Fri Jan 23 23:24:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 432335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id EC7171402A0 for ; Sat, 24 Jan 2015 10:25:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 33DCE8BFD0; Fri, 23 Jan 2015 23:25:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W5eU2rShKVOh; Fri, 23 Jan 2015 23:25:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 49D098C08E; Fri, 23 Jan 2015 23:25:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7EEC51C295C for ; Fri, 23 Jan 2015 23:24:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7A03E30BA7 for ; Fri, 23 Jan 2015 23:24:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L40qRMEYsBD0 for ; Fri, 23 Jan 2015 23:24:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by silver.osuosl.org (Postfix) with ESMTPS id C9E803005C for ; Fri, 23 Jan 2015 23:24:56 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id a1so160105wgh.12 for ; Fri, 23 Jan 2015 15:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JjiH0mpNAN0HHvN9PtxgEJekBDwGzUhSZ5BTL4k9Rgc=; b=BPhEalXu0UhXfGa6IyO+RSLqs3soJ2XO8XYXRT9XctdCeqknZJjXHJj8JueFFh1/vK KTVi1v4Dys0U8T3GywtpThlPfC0yTzrzqwkIMSiKKjBcA4g4hzjddaOe7FZ9nXzEsK5Q jaFlSxebjRckiwfP+llAp9aeSGW17VxPV4sS4mJm3GHRa89+6+m8QBOdWq5myBj8ZfRL l0LQ+NRYDvzYI5AmIbR0oLUblsrOCVGxtEQD9t5GD8QRgIWq8FfMeyEIfeGsSzJKoeW6 H7BJRClu235WDxDANnNuxCtiNPHEzoSNSnHsPYUeUsUY4mKJQGjznApb7rzbBMq7bkwz lFDg== X-Received: by 10.180.208.79 with SMTP id mc15mr8253075wic.23.1422055495347; Fri, 23 Jan 2015 15:24:55 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id j1sm4024698wjw.25.2015.01.23.15.24.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jan 2015 15:24:54 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 24 Jan 2015 00:24:34 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 05/14 v6] package/mesa3d-headers: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Some headers required to build GL/EGL/GLES/... stuff are not provided by Khronos, so we must find an alternate source for those headers. Currently, we're missing: - gl.h for full GL (gl.h for GLES is available from Khronos) - dri_interface.h to be able to build GL-enabled Xorg mesa3d provides all of them, and they are generic enough that they can be re-used even for other GL/EGL/GLES/... implementations. Unfortunately, modifying mesa3d so that it only installs its headers is no trivial task, and would render the mesa3d package really ugly and unmaintainable in the long run. Instead, we introduce a stripped-down mesa3d-headers package, which sole purpose is to install those missing headers. Alongside the dri_interface.h header, we also need to install a pkg-config file, dri.pc, so that Xorg et al. are content and believe they have DRI available. Since we do only really require a very limited subset of files from mesa3d, we do not really care of the version we use, so there is no reason to keep them both in sync, and no reason to add a comment in mesa3d to that effect. Signed-off-by: "Yann E. MORIN" --- Notes: It should not be possible to select both mesa3d *and* mesa3d-headers at the same time, but it is difficult to foresee the multiple combinations we may have, due to poor understanding on how binary drivers may behave and may require, as well as my own poor understanding of the GL stack(s). So I decided to just print a warning in that case, and just depend on mesa3d, which would ultimately provide the headers we are interested in anyway. This can be turned into an error if preferred. --- package/Config.in | 1 + package/mesa3d-headers/Config.in | 8 +++++ package/mesa3d-headers/mesa3d-headers.hash | 2 ++ package/mesa3d-headers/mesa3d-headers.mk | 57 ++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 package/mesa3d-headers/Config.in create mode 100644 package/mesa3d-headers/mesa3d-headers.hash create mode 100644 package/mesa3d-headers/mesa3d-headers.mk diff --git a/package/Config.in b/package/Config.in index 6b2b2a3..b808483 100644 --- a/package/Config.in +++ b/package/Config.in @@ -215,6 +215,7 @@ endif source "package/linux-fusion/Config.in" source "package/lite/Config.in" source "package/mesa3d/Config.in" + source "package/mesa3d-headers/Config.in" source "package/ocrad/Config.in" source "package/psplash/Config.in" source "package/sawman/Config.in" diff --git a/package/mesa3d-headers/Config.in b/package/mesa3d-headers/Config.in new file mode 100644 index 0000000..a64fc0c --- /dev/null +++ b/package/mesa3d-headers/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_MESA3D_HEADERS + bool + help + Mesa 3D, an open-source implementation of the OpenGL specification. + + This package only installs headers needed by other packages. + + http://mesa3d.org diff --git a/package/mesa3d-headers/mesa3d-headers.hash b/package/mesa3d-headers/mesa3d-headers.hash new file mode 100644 index 0000000..df309b5 --- /dev/null +++ b/package/mesa3d-headers/mesa3d-headers.hash @@ -0,0 +1,2 @@ +# From http://mesa3d.org/relnotes/10.4.2.html +sha256 08a119937d9f2aa2f66dd5de97baffc2a6e675f549e40e699a31f5485d15327f MesaLib-10.4.2.tar.bz2 diff --git a/package/mesa3d-headers/mesa3d-headers.mk b/package/mesa3d-headers/mesa3d-headers.mk new file mode 100644 index 0000000..5bfb3c6 --- /dev/null +++ b/package/mesa3d-headers/mesa3d-headers.mk @@ -0,0 +1,57 @@ +################################################################################ +# +# mesa3d-headers +# +################################################################################ + +# mesa3d-headers is inherently incompatible with mesa3d, so if mesa3d +# is enabled, just rely on it. + +ifeq ($(BR2_PACKAGE_MESA3D),y) + +ifeq ($(BR2_PACKAGE_MESA3D_HEADERS),y) +$(warning mesa3d-headers enabled, but mesa3d enabled too) +endif + +MESA3D_HEADERS_SOURCE = +MESA3D_HEADERS_DEPENDENCIES = mesa3d + +else # mesa3d + +# Not possible to directly refer to mesa3d variables, because of first/second +# expansion trickery... +MESA3D_HEADERS_VERSION = 10.4.2 +MESA3D_HEADERS_SOURCE = MesaLib-$(MESA3D_VERSION).tar.bz2 +MESA3D_HEADERS_SITE = ftp://ftp.freedesktop.org/pub/mesa/$(MESA3D_VERSION) +MESA3D_HEADERS_LICENSE = MIT, SGI, Khronos +MESA3D_HEADERS_LICENSE_FILES = docs/license.html + +# Only installs header files +MESA3D_HEADERS_INSTALL_STAGING = YES +MESA3D_HEADERS_INSTALL_TARGET = NO + +# Not using $(SED) because we do not want to work in-place, and $(SED) +# contains -i. +define MESA3D_HEADERS_BUILD_CMDS + sed -e 's:@\(exec_\)\?prefix@:/usr:' \ + -e 's:@libdir@:${exec_prefix}/lib:' \ + -e 's:@includedir@:${prefix}/include:' \ + -e 's:@DRI_DRIVER_INSTALL_DIR@:${libdir}/dri:' \ + -e 's:@VERSION@:$(MESA3D_HEADERS_VERSION):' \ + -e 's:@DRI_PC_REQ_PRIV@::' \ + $(@D)/src/mesa/drivers/dri/dri.pc.in \ + >$(@D)/src/mesa/drivers/dri/dri.pc +endef + +define MESA3D_HEADERS_INSTALL_STAGING_CMDS + $(INSTALL) -D -m 0644 $(@D)/include/GL/gl.h \ + $(STAGING_DIR)/usr/include/GL/gl.h + $(INSTALL) -D -m 0644 $(@D)/include/GL/internal/dri_interface.h \ + $(STAGING_DIR)/usr/include/GL/internal/dri_interface.h + $(INSTALL) -D -m 0644 $(@D)/src/mesa/drivers/dri/dri.pc \ + $(STAGING_DIR)/usr/lib/pkg-config/dri.pc +endef + +endif # !mesa3d + +$(eval $(generic-package))