package/mesa3d-headers: fix install of dri.pc
authorBernd Kuhls <bernd.kuhls@t-online.de>
Wed, 23 Oct 2019 06:22:19 +0000 (08:22 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sun, 26 Apr 2020 09:22:00 +0000 (11:22 +0200)
mesa3d-headers is a little bit special: it uses the same sources as
the mesa3d package, named just 'mesa' upstream. mesa uses the meson
buildsystem, an that is what we use in the mesa3d package.

However, mesa3d-headers does not install the whole of mesa; it only
installs a select set of headers for those binary blobs that do not
provide them.

mesa does not provide such a feature (only installing headers) with
its meson buildsystem. As a consequence, we've made mesa3d-headers a
generic package, that basically only copies headers over.

Additionally, mesa3d-headers also provides the dri.pc file for when
Xorg is enabled; see 7468b60e7c (package/mesa3d-headers: also install
dri header and .pc file).

We used to manually generate that file from a .in template that was
present in mesa source code at the time it was still using autotools.
But when they switched over to using meson, the template was dropped
[0], and the dri.pc is now entirely generated using meson internals
[1].

So we now have no template present in the source code, so we must
come up with our own. This simplifies the replacement pattern to
just inject the version string.

[0] https://cgit.freedesktop.org/mesa/mesa/commit/?id=158758618264eac113025a86a360dc305ed4498b
[1] https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/meson.build?h=19.2#n93

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Tested-by: Vincent Fazio <vfazio@xes-inc.com>
[yann.morin.1998@free.fr:
  - entirely rework the commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/mesa3d-headers/dri.pc [new file with mode: 0644]
package/mesa3d-headers/mesa3d-headers.mk

diff --git a/package/mesa3d-headers/dri.pc b/package/mesa3d-headers/dri.pc
new file mode 100644 (file)
index 0000000..bd9a33b
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=/usr
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+dridriverdir=/usr/lib/dri
+
+Name: dri
+Description: Direct Rendering Infrastructure
+Version: @VERSION@
+Cflags: -I${includedir}
index 2801da1156501caf54c9db256c1fd351775df087..b12dad7bd0f8c85bef4fffc7ce997da0678de53a 100644 (file)
@@ -34,13 +34,8 @@ ifeq ($(BR2_PACKAGE_XORG7),y)
 # Not using $(SED) because we do not want to work in-place, and $(SED)
 # contains -i.
 define MESA3D_HEADERS_BUILD_DRI_PC
-       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 \
+       sed -e 's:@VERSION@:$(MESA3D_HEADERS_VERSION):' \
+           package/mesa3d-headers/dri.pc \
            >$(@D)/src/mesa/drivers/dri/dri.pc
 endef