From 2e01734bb156a9d1aee168dca2e1e2f1ea701716 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 5 Jan 2025 18:56:11 +0100 Subject: [PATCH] user/mesa-amber: new package This is the older branch of mesa intended for stuff like old and big endian harwdare. It's feature-limited (no opencl, no llvm) and fully replaces the regular mesa. --- user/libegl-amber | 1 + user/libgbm-amber | 1 + user/libgbm-amber-devel | 1 + user/libgl-amber | 1 + user/libglapi-amber | 1 + user/libgles1-amber | 1 + user/libgles2-amber | 1 + user/libosmesa-amber | 1 + user/libxatracker-amber | 1 + user/mesa-amber-devel | 1 + ...ch64-force-persistent-buffers-to-GTT.patch | 38 +++ user/mesa-amber/patches/add-use-elf-tls.patch | 34 ++ .../patches/disable-ppc64-asm.patch | 25 ++ user/mesa-amber/patches/musl-endian.patch | 19 ++ user/mesa-amber/patches/musl-stacksize.patch | 35 ++ user/mesa-amber/patches/musl.patch | 60 ++++ .../patches/no-unlink-megadrivers.patch | 25 ++ .../patches/va-no-amdgpu-llvm.patch | 23 ++ user/mesa-amber/template.py | 311 ++++++++++++++++++ user/mesa-amber/update.py | 2 + user/mesa-dri-amber | 1 + user/mesa-gallium-nine-amber | 1 + user/mesa-vulkan-amber | 1 + 23 files changed, 585 insertions(+) create mode 120000 user/libegl-amber create mode 120000 user/libgbm-amber create mode 120000 user/libgbm-amber-devel create mode 120000 user/libgl-amber create mode 120000 user/libglapi-amber create mode 120000 user/libgles1-amber create mode 120000 user/libgles2-amber create mode 120000 user/libosmesa-amber create mode 120000 user/libxatracker-amber create mode 120000 user/mesa-amber-devel create mode 100644 user/mesa-amber/patches/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch create mode 100644 user/mesa-amber/patches/add-use-elf-tls.patch create mode 100644 user/mesa-amber/patches/disable-ppc64-asm.patch create mode 100644 user/mesa-amber/patches/musl-endian.patch create mode 100644 user/mesa-amber/patches/musl-stacksize.patch create mode 100644 user/mesa-amber/patches/musl.patch create mode 100644 user/mesa-amber/patches/no-unlink-megadrivers.patch create mode 100644 user/mesa-amber/patches/va-no-amdgpu-llvm.patch create mode 100644 user/mesa-amber/template.py create mode 100644 user/mesa-amber/update.py create mode 120000 user/mesa-dri-amber create mode 120000 user/mesa-gallium-nine-amber create mode 120000 user/mesa-vulkan-amber diff --git a/user/libegl-amber b/user/libegl-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libegl-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libgbm-amber b/user/libgbm-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libgbm-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libgbm-amber-devel b/user/libgbm-amber-devel new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libgbm-amber-devel @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libgl-amber b/user/libgl-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libgl-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libglapi-amber b/user/libglapi-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libglapi-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libgles1-amber b/user/libgles1-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libgles1-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libgles2-amber b/user/libgles2-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libgles2-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libosmesa-amber b/user/libosmesa-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libosmesa-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/libxatracker-amber b/user/libxatracker-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/libxatracker-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/mesa-amber-devel b/user/mesa-amber-devel new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/mesa-amber-devel @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/mesa-amber/patches/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch b/user/mesa-amber/patches/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch new file mode 100644 index 0000000000..ea1080a0d2 --- /dev/null +++ b/user/mesa-amber/patches/0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch @@ -0,0 +1,38 @@ +From d72aa8ae74ffb7329003f9f23ffa05833af951ab Mon Sep 17 00:00:00 2001 +From: Jon Nettleton +Date: Fri, 14 Aug 2020 13:36:08 +0200 +Subject: [PATCH] radeonsi: On Aarch64 force persistent buffers to GTT + +This fixes a glamore corruption issue on the HoneyComb and by +internet reports should also fix problems seen on Huaweii +Kunpeng hardware. + +The root cause of the corruption needs to be worked out, but +this patch also adds a noticable performance improvement. The +aquarium webgl demo under chromium increases from 39-49 FPS +when 5000 fish being rendered is selected. Glmark scores also +improve by ~200 with no specific tests showing any regression. + +Signed-off-by: Jon Nettleton +--- + src/gallium/drivers/radeonsi/si_buffer.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c +index 6b58aebee2d..c9e983367a0 100644 +--- a/src/gallium/drivers/radeonsi/si_buffer.c ++++ b/src/gallium/drivers/radeonsi/si_buffer.c +@@ -151,6 +151,11 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res, + */ + if (!sscreen->info.kernel_flushes_hdp_before_ib || !sscreen->info.is_amdgpu) + res->domains = RADEON_DOMAIN_GTT; ++ ++#if defined(PIPE_ARCH_AARCH64) ++ if (size <= 1024 * 1024) ++ res->domains = RADEON_DOMAIN_GTT; ++#endif + } + + /* Tiled textures are unmappable. Always put them in VRAM. */ +-- +2.26.2 diff --git a/user/mesa-amber/patches/add-use-elf-tls.patch b/user/mesa-amber/patches/add-use-elf-tls.patch new file mode 100644 index 0000000000..420665ea83 --- /dev/null +++ b/user/mesa-amber/patches/add-use-elf-tls.patch @@ -0,0 +1,34 @@ +Upstream: https://gitlab.freedesktop.org/mesa/mesa/issues/966 +Status: Not fixed upstream + +diff --git meson.build meson.build +index e1e94e71049..96ab3fb3e45 100644 +--- a/meson.build ++++ b/meson.build +@@ -447,7 +447,8 @@ endif + + # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS. + use_elf_tls = false +-if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and ++with_use_elf_tls = get_option('use-elf-tls') ++if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and with_use_elf_tls and + (not with_platform_android or get_option('platform-sdk-version') >= 29) and + (not with_platform_windows or not with_shared_glapi)) + pre_args += '-DUSE_ELF_TLS' +diff --git meson_options.txt meson_options.txt +index a7030aba31e..966cfeca298 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -446,6 +446,12 @@ option( + value : 25, + description : 'Android Platform SDK version. Default: Nougat version.' + ) ++option( ++ 'use-elf-tls', ++ type : 'boolean', ++ value : true, ++ description : 'Build support for initial-exec TLS model' ++) + option( + 'zstd', + type : 'combo', diff --git a/user/mesa-amber/patches/disable-ppc64-asm.patch b/user/mesa-amber/patches/disable-ppc64-asm.patch new file mode 100644 index 0000000000..ec121a9e05 --- /dev/null +++ b/user/mesa-amber/patches/disable-ppc64-asm.patch @@ -0,0 +1,25 @@ +commit 40a554d5ca9c08a4dd3181bb47339aded5252628 +Author: Daniel Kolesa +Date: Thu Jan 20 03:32:35 2022 +0100 + + disable ppc64le asm + + This is problematic in threaded applications with musl, so + just fall back to plain-C version. + +diff --git a/meson.build b/meson.build +index bd54e78..eafdfad 100644 +--- a/meson.build ++++ b/meson.build +@@ -1339,11 +1339,6 @@ elif host_machine.cpu_family() == 'sparc64' + with_asm_arch = 'sparc' + pre_args += ['-DUSE_SPARC_ASM'] + endif +-elif host_machine.cpu_family().startswith('ppc64') and host_machine.endian() == 'little' +- if system_has_kms_drm +- with_asm_arch = 'ppc64le' +- pre_args += ['-DUSE_PPC64LE_ASM'] +- endif + elif host_machine.cpu_family() == 'mips64' and host_machine.endian() == 'little' + if system_has_kms_drm + with_asm_arch = 'mips64el' diff --git a/user/mesa-amber/patches/musl-endian.patch b/user/mesa-amber/patches/musl-endian.patch new file mode 100644 index 0000000000..7a14dac5a3 --- /dev/null +++ b/user/mesa-amber/patches/musl-endian.patch @@ -0,0 +1,19 @@ +--- a/src/util/u_endian.h ++++ b/src/util/u_endian.h +@@ -87,6 +87,16 @@ + #define UTIL_ARCH_LITTLE_ENDIAN 1 + #define UTIL_ARCH_BIG_ENDIAN 0 + ++#else ++/* Musl libc */ ++#include ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++# define PIPE_ARCH_LITTLE_ENDIAN ++#elif __BYTE_ORDER == __BIG_ENDIAN ++# define PIPE_ARCH_BIG_ENDIAN ++#endif ++ + #endif + + #if !defined(UTIL_ARCH_LITTLE_ENDIAN) || !defined(UTIL_ARCH_BIG_ENDIAN) diff --git a/user/mesa-amber/patches/musl-stacksize.patch b/user/mesa-amber/patches/musl-stacksize.patch new file mode 100644 index 0000000000..be2f5d454f --- /dev/null +++ b/user/mesa-amber/patches/musl-stacksize.patch @@ -0,0 +1,35 @@ +diff --git ./include/c11/threads_posix.h ./include/c11/threads_posix.h +index 45cb6075e6..1a2ea1a450 100644 +--- a/include/c11/threads_posix.h ++++ b/include/c11/threads_posix.h +@@ -281,15 +281,29 @@ static inline int + thrd_create(thrd_t *thr, thrd_start_t func, void *arg) + { + struct impl_thrd_param *pack; ++#ifdef __GLIBC__ ++ pthread_attr_t *attrp = NULL; ++#else ++ pthread_attr_t attr = { 0 }; ++ pthread_attr_init(&attr); ++ pthread_attr_setstacksize(&attr, 8388608); ++ pthread_attr_t *attrp = &attr; ++#endif + assert(thr != NULL); + pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param)); + if (!pack) return thrd_nomem; + pack->func = func; + pack->arg = arg; +- if (pthread_create(thr, NULL, impl_thrd_routine, pack) != 0) { ++ if (pthread_create(thr, attrp, impl_thrd_routine, pack) != 0) { ++#ifndef __GLIBC__ ++ pthread_attr_destroy(&attr); ++#endif + free(pack); + return thrd_error; + } ++#ifndef __GLIBC__ ++ pthread_attr_destroy(&attr); ++#endif + return thrd_success; + } + diff --git a/user/mesa-amber/patches/musl.patch b/user/mesa-amber/patches/musl.patch new file mode 100644 index 0000000000..6474cc600d --- /dev/null +++ b/user/mesa-amber/patches/musl.patch @@ -0,0 +1,60 @@ +diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h +index 06ca905..bb244f8 100644 +--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h ++++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h +@@ -30,6 +30,7 @@ + + #include + #include ++#include + #include "util/list.h" + #include "util/rwlock.h" + #include "ac_gpu_info.h" +diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h +index 22f99c4..c405810 100644 +--- a/src/gallium/drivers/freedreno/freedreno_util.h ++++ b/src/gallium/drivers/freedreno/freedreno_util.h +@@ -107,6 +107,9 @@ extern bool fd_binning_enabled; + #include + #include + #include ++#include ++ ++#define gettid() ((pid_t)syscall(SYS_gettid)) + + #define DBG(fmt, ...) \ + do { \ +diff --git a/src/gallium/frontends/nine/nine_debug.c b/src/gallium/frontends/nine/nine_debug.c +index f3a6a94..f4a6c41 100644 +--- a/src/gallium/frontends/nine/nine_debug.c ++++ b/src/gallium/frontends/nine/nine_debug.c +@@ -65,7 +65,7 @@ _nine_debug_printf( unsigned long flag, + { + static boolean first = TRUE; + static unsigned long dbg_flags = DBG_ERROR | DBG_WARN; +- unsigned long tid = 0; ++ pthread_t tid = 0; + + if (first) { + first = FALSE; +@@ -74,7 +74,7 @@ _nine_debug_printf( unsigned long flag, + + #if defined(HAVE_PTHREAD) + if (dbg_flags & DBG_TID) +- tid = (unsigned long)pthread_self(); ++ tid = pthread_self(); + #endif + + if (dbg_flags & flag) { +diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c +index 81b64f1..01c6bba 100644 +--- a/src/util/rand_xor.c ++++ b/src/util/rand_xor.c +@@ -28,6 +28,7 @@ + #if defined(HAVE_GETRANDOM) + #include + #endif ++#include /* size_t, ssize_t */ + #include + #include + #endif diff --git a/user/mesa-amber/patches/no-unlink-megadrivers.patch b/user/mesa-amber/patches/no-unlink-megadrivers.patch new file mode 100644 index 0000000000..c19c427194 --- /dev/null +++ b/user/mesa-amber/patches/no-unlink-megadrivers.patch @@ -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): diff --git a/user/mesa-amber/patches/va-no-amdgpu-llvm.patch b/user/mesa-amber/patches/va-no-amdgpu-llvm.patch new file mode 100644 index 0000000000..6ee73f745e --- /dev/null +++ b/user/mesa-amber/patches/va-no-amdgpu-llvm.patch @@ -0,0 +1,23 @@ +--- a/src/gallium/targets/dri/dri.sym ++++ b/src/gallium/targets/dri/dri.sym +@@ -4,9 +4,6 @@ + __driDriverGetExtensions*; + nouveau_drm_screen_create; + radeon_drm_winsys_create; +- amdgpu_winsys_create; +- fd_drm_screen_create; +- ac_init_shared_llvm_once; + local: + *; + }; +--- a/src/gallium/targets/va/va.sym ++++ b/src/gallium/targets/va/va.sym +@@ -5,8 +5,6 @@ + # Workaround for an LLVM warning with -simplifycfg-sink-common + # due to LLVM being initialized multiple times. + radeon_drm_winsys_create; +- amdgpu_winsys_create; +- ac_init_shared_llvm_once; + local: + *; + }; diff --git a/user/mesa-amber/template.py b/user/mesa-amber/template.py new file mode 100644 index 0000000000..f294149e36 --- /dev/null +++ b/user/mesa-amber/template.py @@ -0,0 +1,311 @@ +pkgname = "mesa-amber" +pkgver = "21.3.9" +pkgrel = 0 +build_style = "meson" +configure_args = [ + "-Db_ndebug=true", + "-Ddefault_library=shared", + "-Dcpp_std=gnu++14", + "-Ddraw-use-llvm=false", + "-Dglvnd=false", + "-Dosmesa=true", + "-Duse-elf-tls=false", + "-Dgbm=enabled", + "-Degl=enabled", + "-Dgles1=enabled", + "-Dgles2=enabled", + "-Ddri3=enabled", + "-Dgallium-vdpau=disabled", + "-Dgallium-xvmc=disabled", + "-Dllvm=disabled", + "-Dlmsensors=enabled", + "-Dshared-glapi=enabled", + "-Dplatforms=x11,wayland", + "-Dglx=dri", +] +hostmakedepends = [ + "bison", + "flex", + "glslang-progs", + "meson", + "pkgconf", + "python-mako", + "wayland-progs", + "wayland-protocols", +] +makedepends = [ + # base driver/platform stuff + "libdrm-devel", + # wayland + "wayland-devel", + "wayland-protocols", + # x11 + "libx11-devel", + "libxcb-devel", + "libxdamage-devel", + "libxext-devel", + "libxfixes-devel", + "libxrandr-devel", + "libxshmfence-devel", + "libxv-devel", + "libxxf86vm-devel", + # misc libs + "elfutils-devel", + "libarchive-devel", + "libexpat-devel", + "libffi-devel", + "libsensors-devel", + "libxml2-devel", + "lua5.4-devel", + "ncurses-devel", + "zlib-ng-compat-devel", + "zstd-devel", + # video accel + "libva-bootstrap", +] +provides = [self.with_pkgver("mesa")] +provider_priority = 0 +pkgdesc = "Mesa 3D Graphics Library" +maintainer = "q66 " +license = "MIT" +url = "https://www.mesa3d.org" +source = f"https://mesa.freedesktop.org/archive/mesa-{pkgver}.tar.xz" +sha256 = "91fe6f20339884e37a7c47bfba42fb1cd397512c9ed5ad423de369f047cd8b5c" +# lots of issues in swrast and so on +hardening = ["!int"] +# cba to deal with cross patching nonsense +options = ["!cross"] + +_gallium_drivers = ["swrast"] +_vulkan_drivers = [] + +# these are good assumptions on all targets we support for now +_have_nvidia = True +_have_amd = True +_have_hwdec = True +_have_virgl = True + +# these change with platforms +_have_intel = False +_have_vmware = False +_have_nine = False +_have_arm = False +_have_vulkan = False +_have_zink = False + +match self.profile().arch: + case "x86_64": + _have_intel = True + _have_vmware = True + _have_nine = True + case "aarch64": + _have_arm = True + case "ppc64le": + configure_args += ["-Dpower8=true"] + case "ppc64": + configure_args += ["-Dpower8=false"] + +_have_vulkan = _have_intel +_have_zink = _have_vulkan + +if _have_amd: + # no radeonsi because amber branch does not support our latest llvm + # therefore, no radv either as that would not make any sense + _gallium_drivers += ["r300", "r600"] + +if _have_intel: + _gallium_drivers += ["crocus", "iris", "i915"] + if _have_vulkan: + _vulkan_drivers += ["intel"] + +if _have_nvidia: + _gallium_drivers += ["nouveau"] + if _have_arm: + _gallium_drivers += ["tegra"] + +if _have_arm: + _gallium_drivers += [ + "kmsro", + "v3d", + "vc4", + "freedreno", + "etnaviv", + "lima", + "panfrost", + ] + +if _have_virgl: + _gallium_drivers += ["virgl"] + +if _have_nine: + configure_args += ["-Dgallium-nine=true"] + +if _have_vmware: + _gallium_drivers += ["svga"] + configure_args += ["-Dgallium-xa=enabled"] +else: + configure_args += ["-Dgallium-xa=disabled"] + +if _have_hwdec: + configure_args += ["-Dgallium-va=enabled"] +else: + configure_args += ["-Dgallium-va=disabled"] + +if _have_vulkan: + makedepends += ["vulkan-loader-devel"] + configure_args += [ + "-Dvulkan-layers=device-select,overlay" + + (",intel-nullhw" if _have_intel else "") + ] + +if _have_zink: + _gallium_drivers += ["zink"] + +configure_args += ["-Dgallium-drivers=" + ",".join(_gallium_drivers)] +configure_args += ["-Dvulkan-drivers=" + ",".join(_vulkan_drivers)] +configure_args += ["-Ddri-drivers="] + + +def post_install(self): + self.install_license("docs/license.rst") + + +@subpackage("libglapi-amber") +def _(self): + self.pkgdesc = "Free implementation of the GL API" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libglapi")] + + return ["usr/lib/libglapi.so.*"] + + +@subpackage("libgbm-amber") +def _(self): + self.pkgdesc = "Generic Buffer Management" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libgbm")] + + return ["usr/lib/libgbm.so.*"] + + +@subpackage("libgbm-amber-devel") +def _(self): + self.pkgdesc = "Generic Buffer Management" + self.provides = [self.with_pkgver("libgbm-devel")] + self.depends += [self.parent] + + return [ + "usr/include/gbm.h", + "usr/lib/libgbm.so", + "usr/lib/pkgconfig/gbm.pc", + ] + + +@subpackage("libosmesa-amber") +def _(self): + self.pkgdesc = "Mesa off-screen interface" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libosmesa")] + + return ["usr/lib/libOSMesa.so.*"] + + +@subpackage("libgles1-amber") +def _(self): + self.pkgdesc = "Free implementation of OpenGL ES 1.x API" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libgles1")] + + return ["usr/lib/libGLESv1_CM.so.*"] + + +@subpackage("libgles2-amber") +def _(self): + self.pkgdesc = "Free implementation of OpenGL ES 2.x API" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libgles2")] + + return ["usr/lib/libGLESv2.so.*"] + + +@subpackage("libegl-amber") +def _(self): + self.pkgdesc = "Free implementation of the EGL API" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libegl")] + + return ["usr/lib/libEGL.so.*"] + + +@subpackage("libgl-amber") +def _(self): + self.pkgdesc = "Free implementation of the OpenGL API" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libgl")] + + return ["usr/lib/libGL.so.*"] + + +@subpackage("mesa-gallium-nine-amber", _have_nine) +def _(self): + self.pkgdesc = "Mesa implementation of D3D9" + self.depends += [self.parent] + self.provides = [self.with_pkgver("mesa-gallium-nine")] + + return ["usr/lib/d3d"] + + +@subpackage("libxatracker-amber", _have_vmware) +def _(self): + self.pkgdesc = "X acceleration library" + self.subdesc = "runtime library" + self.depends += [self.parent] + self.provides = [self.with_pkgver("libxatracker")] + + return ["usr/lib/libxatracker*.so.*"] + + +@subpackage("mesa-dri-amber") +def _(self): + self.pkgdesc = "Mesa DRI drivers" + self.depends += [self.parent] + self.install_if = [self.parent] + # transitional + self.provides = [ + self.with_pkgver("mesa-vaapi"), + self.with_pkgver("mesa-dri"), + ] + + return ["usr/lib/dri"] + + +@subpackage("mesa-vulkan-amber", _have_vulkan) +def _(self): + self.pkgdesc = "Mesa Vulkan drivers" + self.install_if = [self.with_pkgver("mesa-dri-amber"), "vulkan-loader"] + self.depends += [self.parent] + self.provides = [self.with_pkgver("mesa-vulkan")] + + return [ + "usr/bin/mesa-overlay-control.py", + "usr/lib/libvulkan_*.so", + "usr/lib/libVkLayer_*.so", + "usr/share/vulkan/explicit_layer.d/VkLayer_*.json", + "usr/share/vulkan/implicit_layer.d/VkLayer_*.json", + "usr/share/vulkan/icd.d/*.json", + ] + + +@subpackage("mesa-amber-devel") +def _(self): + self.depends += [self.parent, self.with_pkgver("libgbm-amber-devel")] + self.provides = [self.with_pkgver("mesa-devel")] + + return self.default_devel() diff --git a/user/mesa-amber/update.py b/user/mesa-amber/update.py new file mode 100644 index 0000000000..07114a2cd4 --- /dev/null +++ b/user/mesa-amber/update.py @@ -0,0 +1,2 @@ +pkgname = "mesa" +pattern = r"mesa-(21\.3\.\d+)\.tar" diff --git a/user/mesa-dri-amber b/user/mesa-dri-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/mesa-dri-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/mesa-gallium-nine-amber b/user/mesa-gallium-nine-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/mesa-gallium-nine-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file diff --git a/user/mesa-vulkan-amber b/user/mesa-vulkan-amber new file mode 120000 index 0000000000..f010a6d46d --- /dev/null +++ b/user/mesa-vulkan-amber @@ -0,0 +1 @@ +mesa-amber \ No newline at end of file