mesa: use symlinks for megadrivers + correctness fixes

This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)
This commit is contained in:
q66 2021-11-04 16:05:41 +01:00 committed by Daniel Kolesa
parent 2ef08aed69
commit 32b3f0eab8
3 changed files with 31 additions and 35 deletions

View File

@ -0,0 +1,25 @@
This converts megadriver installation to use symlinks so that we do
not have to deal with skipping the strip stage for some files, as
a result simplifying our template greatly.
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -56,7 +56,7 @@ def main():
if os.path.lexists(abs_driver):
os.unlink(abs_driver)
print('installing {} to {}'.format(args.megadriver, abs_driver))
- os.link(master, abs_driver)
+ os.symlink(os.path.basename(master), abs_driver)
try:
ret = os.getcwd()
@@ -71,8 +71,7 @@ def main():
finally:
os.chdir(ret)
- # Remove meson-created master .so and symlinks
- os.unlink(master)
+ # Remove meson-created symlinks
name, ext = os.path.splitext(master)
while ext != '.so':
if os.path.lexists(name):

View File

@ -1,15 +0,0 @@
This patch is needed to retain the master .so, so that only that filename is
stripped while the related hard links are excluded.
diff --git bin/install_megadrivers.py bin/install_megadrivers.py
index 470137e..7d56def 100644
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -71,7 +71,7 @@ def main():
os.chdir(ret)
# Remove meson-created master .so and symlinks
- os.unlink(master)
+ #os.unlink(master)
name, ext = os.path.splitext(master)
while ext != '.so':
if os.path.lexists(name):

View File

@ -1,7 +1,7 @@
# Template file for 'mesa' # Template file for 'mesa'
pkgname=mesa pkgname=mesa
version=21.2.5 version=21.2.5
revision=1 revision=2
build_style=meson build_style=meson
configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
-Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
@ -264,17 +264,15 @@ libOSMesa_package() {
} }
MesaLib-devel_package() { MesaLib-devel_package() {
depends="xorgproto libxshmfence-devel libXext-devel libXxf86vm-devel depends="mesa>=${version}_${revision} libOSMesa>=${version}_${revision}
libXdamage-devel expat-devel libXfixes-devel libX11-devel libxcb-devel libgbm-devel>=${version}_${revision}"
libdrm-devel libglvnd-devel
libOSMesa>=${version}_${revision} libgbm-devel>=${version}_${revision}
mesa>=${version}_${revision}"
if [ "$_have_vmware" ]; then if [ "$_have_vmware" ]; then
depends+=" libxatracker>=${version}_${revision}" depends+=" libxatracker>=${version}_${revision}"
fi fi
if [ "$_have_opencl" ]; then if [ "$_have_opencl" ]; then
depends+=" mesa-opencl>=${version}_${revision}" depends+=" mesa-opencl>=${version}_${revision}"
fi fi
depends+=" libdrm-devel libglvnd-devel"
short_desc+=" - development files" short_desc+=" - development files"
pkg_install() { pkg_install() {
vmove usr/include vmove usr/include
@ -304,6 +302,7 @@ mesa-opencl_package() {
depends="libclc" depends="libclc"
pkg_install() { pkg_install() {
vmove etc/OpenCL vmove etc/OpenCL
vmove usr/lib/gallium-pipe
vmove "usr/lib/libMesaOpenCL.so.*" vmove "usr/lib/libMesaOpenCL.so.*"
} }
} }
@ -313,14 +312,7 @@ mesa-dri_package() {
depends="mesa-${version}_${revision}" depends="mesa-${version}_${revision}"
shlib_provides="libgallium_dri.so" # workaround for mesa-dri-32bit shlib_provides="libgallium_dri.so" # workaround for mesa-dri-32bit
pkg_install() { pkg_install() {
# Only strip each megadriver once, via its master filename vmove usr/lib/dri
nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
! -name 'libmesa_dri_drivers.so' ! -name 'libgallium_dri.so' \
-type f -printf '%f ')
vmove "usr/lib/dri"
if [ -d "$DESTDIR/usr/lib/gallium-pipe" ]; then
vmove "usr/lib/gallium-pipe/pipe_*.so"
fi
} }
} }
@ -328,8 +320,6 @@ mesa-vaapi_package() {
short_desc="Mesa VA-API drivers" short_desc="Mesa VA-API drivers"
shlib_provides="libgallium_drv_video.so" # workaround for mesa-vaapi-32bit shlib_provides="libgallium_drv_video.so" # workaround for mesa-vaapi-32bit
pkg_install() { pkg_install() {
nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
! -name 'libgallium_drv_video.so' -type f -printf '%f ')
vmove "usr/lib/dri/*_drv_video.so" vmove "usr/lib/dri/*_drv_video.so"
} }
} }
@ -337,8 +327,6 @@ mesa-vaapi_package() {
mesa-vdpau_package() { mesa-vdpau_package() {
short_desc="Mesa VDPAU drivers" short_desc="Mesa VDPAU drivers"
pkg_install() { pkg_install() {
nostrip_files=$(find "${DESTDIR}/usr/lib/vdpau" \
! -name 'libvdpau_gallium.so*' -type f -printf '%f ')
vmove "usr/lib/vdpau/libvdpau_*" vmove "usr/lib/vdpau/libvdpau_*"
} }
} }
@ -346,8 +334,6 @@ mesa-vdpau_package() {
mesa-XvMC_package() { mesa-XvMC_package() {
short_desc="Mesa XvMC drivers" short_desc="Mesa XvMC drivers"
pkg_install() { pkg_install() {
nostrip_files=$(find "${DESTDIR}/usr/lib/libXvMC"* \
! -name 'libXvMCgallium.so' -type f -printf '%f ')
vmove "usr/lib/libXvMC*" vmove "usr/lib/libXvMC*"
} }
} }