diff --git a/ports/libepoxy/build.sh b/ports/libepoxy/build.sh index 88be71d4..fbf8cc30 100755 --- a/ports/libepoxy/build.sh +++ b/ports/libepoxy/build.sh @@ -3,11 +3,11 @@ NAME='libepoxy' VERSION='1.5.10' DOWNLOAD_URL="https://download.gnome.org/sources/libepoxy/1.5/libepoxy-$VERSION.tar.xz#072cda4b59dd098bba8c2363a6247299db1fa89411dc221c8b81b8ee8192e623" -DEPENDENCIES=('mesa' 'libX11') +DEPENDENCIES=('mesa-glx' 'libX11') CONFIGURE_OPTIONS=( '-Dprefix=/usr' + '-Dbuildtype=release' '-Dtests=false' - '-Degl=no' ) configure() { diff --git a/ports/mesa-glx/build.sh b/ports/mesa-glx/build.sh new file mode 100755 index 00000000..749a0f8d --- /dev/null +++ b/ports/mesa-glx/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export MESA_VARIANT='glx' +exec ../mesa/build.sh diff --git a/ports/mesa-glx/patches/0001-add-support-for-banan-os.patch b/ports/mesa-glx/patches/0001-add-support-for-banan-os.patch new file mode 120000 index 00000000..379a1e91 --- /dev/null +++ b/ports/mesa-glx/patches/0001-add-support-for-banan-os.patch @@ -0,0 +1 @@ +../../mesa/patches/0002-add-support-for-banan-os.patch \ No newline at end of file diff --git a/ports/mesa-glx/patches/0002-add-drm-support.patch b/ports/mesa-glx/patches/0002-add-drm-support.patch new file mode 100644 index 00000000..86a01047 --- /dev/null +++ b/ports/mesa-glx/patches/0002-add-drm-support.patch @@ -0,0 +1,41 @@ +diff -ruN mesa-26.1.4/meson.build mesa-26.1.4-banan_os/meson.build +--- mesa-26.1.4/meson.build 2026-07-01 17:16:13.000000000 +0300 ++++ mesa-26.1.4-banan_os/meson.build 2026-07-05 12:36:39.810545892 +0300 +@@ -156,7 +156,7 @@ + + with_any_opengl = with_opengl or with_gles1 or with_gles2 + +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm', 'banan_os'].contains(host_machine.system()) + + gallium_drivers = get_option('gallium-drivers') + if gallium_drivers.contains('auto') +diff -ruN mesa-26.1.4/src/gallium/frontends/dri/drisw.c mesa-26.1.4-banan_os/src/gallium/frontends/dri/drisw.c +--- mesa-26.1.4/src/gallium/frontends/dri/drisw.c 2026-07-01 17:16:13.000000000 +0300 ++++ mesa-26.1.4-banan_os/src/gallium/frontends/dri/drisw.c 2026-07-05 12:36:40.392717334 +0300 +@@ -43,12 +43,12 @@ + #include "dri_helpers.h" + #include "dri_query_renderer.h" + +-#include "util/libsync.h" +- + #ifdef HAVE_LIBDRM + #include + #endif + ++#include "util/libsync.h" ++ + DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", false); + + static inline void +diff -ruN mesa-26.1.4/src/glx/drisw_glx.c mesa-26.1.4-banan_os/src/glx/drisw_glx.c +--- mesa-26.1.4/src/glx/drisw_glx.c 2026-07-01 17:16:13.000000000 +0300 ++++ mesa-26.1.4-banan_os/src/glx/drisw_glx.c 2026-07-05 12:36:40.748941796 +0300 +@@ -23,6 +23,7 @@ + + #if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE)) + ++#include + #include + #include + #include diff --git a/ports/mesa/build.sh b/ports/mesa/build.sh index f7249d29..df5ca8f3 100755 --- a/ports/mesa/build.sh +++ b/ports/mesa/build.sh @@ -3,17 +3,30 @@ NAME='mesa' VERSION='26.1.4' DOWNLOAD_URL="https://archive.mesa3d.org/mesa-$VERSION.tar.xz#072705caa9adf4740f1489194b13e278ad959166863b5271fe423a86353c9ab6" -DEPENDENCIES=('zlib' 'zstd' 'expat' 'libX11' 'libXext') +TAR_CONTENT="mesa-$VERSION" +DEPENDENCIES=('zlib' 'zstd' 'expat') CONFIGURE_OPTIONS=( '-Dprefix=/usr' - '-Dosmesa=true' - '-Dvulkan-drivers=[]' - '-Dgallium-drivers=llvmpipe' - '-Dplatforms=x11' - '-Dglx=xlib' '-Dbuildtype=release' + '-Dvulkan-drivers=' + '-Dgallium-drivers=llvmpipe' ) +if [[ "$MESA_VARIANT" == "glx" ]]; then + NAME='mesa-glx' + DEPENDENCIES+=('libX11' 'libXext' 'libXfixes' 'libxshmfence' 'libXxf86vm' 'libXrandr' 'libdrm') + CONFIGURE_OPTIONS+=( + '-Dplatforms=x11' + '-Dglx=dri' + ) +else + CONFIGURE_OPTIONS+=( + '-Dplatforms=' + '-Dglx=disabled' + '-Dosmesa=true' + ) +fi + pre_configure() { llvm_version='22.1.8' llvm_dir_name="llvm-banan_os-$llvm_version-$BANAN_ARCH"