mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
mesa: Add experimental mesa 23.1 package
* do not activate this until we are ready (and 23.1.0 is final) * This marks the shift to libglvnd * mesa no longer provides libGL, and only provides an EGL vendor rendering driver in add-ons/opengl/egl_vendor.d
This commit is contained in:
@@ -4,7 +4,7 @@ pipeline."
|
||||
HOMEPAGE="http://gitlab.freedesktop.org/glvnd/libglvnd"
|
||||
COPYRIGHT="2013, NVIDIA CORPORATION"
|
||||
LICENSE="MIT"
|
||||
REVISION="4"
|
||||
REVISION="5"
|
||||
SOURCE_URI="https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$portVersion/libglvnd-v$portVersion.tar.gz"
|
||||
SOURCE_DIR="libglvnd-v$portVersion"
|
||||
CHECKSUM_SHA256="efc756ffd24b24059e1c53677a9d57b4b237b00a01c54a6f1611e1e51661d70c"
|
||||
|
||||
6
sys-libs/mesa/additional-files/50_mesa.json
Normal file
6
sys-libs/mesa/additional-files/50_mesa.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"file_format_version" : "1.0.0",
|
||||
"ICD" : {
|
||||
"library_path" : "./libEGL_mesa.so.0"
|
||||
}
|
||||
}
|
||||
178
sys-libs/mesa/mesa-23.1.0_rc1.recipe
Normal file
178
sys-libs/mesa/mesa-23.1.0_rc1.recipe
Normal file
@@ -0,0 +1,178 @@
|
||||
SUMMARY="Multi-platform GL implementation"
|
||||
DESCRIPTION="Mesa is an open-source implementation of the OpenGL \
|
||||
specification, which documents a system for rendering interactive \
|
||||
3D graphics. Mesa fills the role of the Haiku OpenGL kit, \
|
||||
providing 3D rendering to Haiku applications."
|
||||
HOMEPAGE="https://www.mesa3d.org/"
|
||||
COPYRIGHT="1999-2022 Brian Paul"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-23.1.0-rc1.tar.xz" # -rc1 vs _rc1
|
||||
#SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
|
||||
CHECKSUM_SHA256="a119a04e14a6dbae9df170de9c7d0047e11df1dc020cc6db00666654a71fe41a"
|
||||
SOURCE_DIR="mesa-23.1.0-rc1" # -rc1 vs _rc1
|
||||
#SOURCE_DIR="mesa-${portVersion}"
|
||||
#PATCHES="mesa-$portVersion.patchset"
|
||||
PATCHES="mesa-23.1.0.patchset" # -rc1 vs _rc1
|
||||
|
||||
ARCHITECTURES="?all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
libVersion=1.0.0
|
||||
libOSMesaVersion=8.0.0
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
libOSMesaVersionCompat="$libOSMesaVersion compat >= ${libOSMesaVersion%%.*}"
|
||||
|
||||
PROVIDES="
|
||||
mesa$secondaryArchSuffix = $portVersion
|
||||
lib:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
|
||||
lib:libglapi$secondaryArchSuffix = 0.0.0
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
lib:libLLVM_12$secondaryArchSuffix
|
||||
lib:libexpat$secondaryArchSuffix
|
||||
lib:libGL$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
mesa${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libOSMesa$secondaryArchSuffix = $libOSMesaVersionCompat
|
||||
devel:libglapi$secondaryArchSuffix = 0.0.0
|
||||
"
|
||||
REQUIRES_devel="
|
||||
mesa$secondaryArchSuffix == $portVersion base
|
||||
devel:libGL$secondaryArchSuffix
|
||||
"
|
||||
|
||||
SUMMARY_eglvnd="The Mesa glvnd rendering drivers for Haiku"
|
||||
DESCRIPTION_eglvnd="This glvnd rendering driver package provides \
|
||||
software pipe rendering (with LLVM-bosted performance)."
|
||||
|
||||
PROVIDES_eglvnd="
|
||||
mesa${secondaryArchSuffix}_swpipe = $portVersion
|
||||
"
|
||||
REQUIRES_eglvnd="
|
||||
mesa$secondaryArchSuffix == $portVersion base
|
||||
lib:libLLVM_12$secondaryArchSuffix
|
||||
"
|
||||
|
||||
SUMMARY_lavapipe="Vulkan software rasteriser driver"
|
||||
DESCRIPTION_lavapipe="Lavapipe is Mesa's software-based Vulkan 1.2 \
|
||||
implementation akin to LLVMpipe for OpenGL."
|
||||
|
||||
PROVIDES_lavapipe="
|
||||
mesa${secondaryArchSuffix}_lavapipe = $portVersion
|
||||
"
|
||||
REQUIRES_lavapipe="
|
||||
lib:libLLVM_12$secondaryArchSuffix
|
||||
"
|
||||
# We require libglvnd_devel for now for clairity since there is no
|
||||
# libglvnd.so and mesa 22.x provides our devel:libGL
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
libglvnd${secondaryArchSuffix}_devel
|
||||
devel:libz$secondaryArchSuffix
|
||||
devel:libLLVM_12$secondaryArchSuffix
|
||||
devel:libexpat$secondaryArchSuffix
|
||||
devel:libvulkan$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
python39$secondaryArchSuffix
|
||||
mako_python39
|
||||
cmd:ninja
|
||||
cmd:bison
|
||||
cmd:find
|
||||
cmd:flex
|
||||
cmd:meson
|
||||
cmd:git
|
||||
cmd:llvm_config >= 12
|
||||
cmd:egrep
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:which
|
||||
"
|
||||
|
||||
defineDebugInfoPackage mesa$secondaryArchSuffix \
|
||||
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_eglvnd}/opengl/egl_vendor.d/libEGL_mesa.so.0" \
|
||||
"${addOnsDir/mesa$secondaryArchSuffix/mesa${secondaryArchSuffix}_lavapipe}/vulkan/icd.d/libvulkan_lvp.so" \
|
||||
"$libDir"/libOSMesa.so.$libOSMesaVersion \
|
||||
|
||||
BUILD()
|
||||
{
|
||||
if [ -n "$secondaryArchSuffix" ]; then
|
||||
export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture"
|
||||
fi
|
||||
|
||||
mkdir -p build
|
||||
|
||||
# In the future, all we need to do is enable other gallium
|
||||
# drivers so libEGL_mesa contains other drivers in addition
|
||||
# to llvm swpipe.
|
||||
meson build \
|
||||
-Dosmesa=true -Degl=enabled -Dglvnd=true \
|
||||
-Dgallium-drivers=swrast \
|
||||
-Dvulkan-drivers=swrast \
|
||||
-Dvulkan-icd-dir=$addOnsDir/vulkan/icd.d \
|
||||
--buildtype=debugoptimized \
|
||||
--prefix=$prefix \
|
||||
--libdir=$libDir \
|
||||
--includedir=$includeDir/os/opengl
|
||||
ninja -C build $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
ninja -C build install
|
||||
|
||||
# Do a little cleanup
|
||||
rm -rf $prefix/share
|
||||
|
||||
# Mesa's EGL render driver
|
||||
mkdir -p $addOnsDir/opengl/egl_vendor.d
|
||||
mv $(find $libDir -name 'libEGL_mesa.so.0') \
|
||||
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0"
|
||||
ln -sr "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0"
|
||||
mv $libDir/libvulkan_lvp.so \
|
||||
"$addOnsDir/vulkan/icd.d"
|
||||
rm -rf $libDir/haiku
|
||||
|
||||
# Configure Mesa EGL Vendor Renderer
|
||||
cp "$portDir/additional-files/50_mesa.json" "$addOnsDir/opengl/egl_vendor.d/"
|
||||
|
||||
# Set some nice version info
|
||||
appVersion=${portVersion//\./ }
|
||||
setversion "$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" -app $appVersion -long \
|
||||
"Mesa EGL rendering drivers"
|
||||
setversion "$addOnsDir/vulkan/icd.d/libvulkan_lvp.so" -app $appVersion -long \
|
||||
"Vulkan software rasteriser driver"
|
||||
|
||||
prepareInstalledDevelLibs \
|
||||
libOSMesa
|
||||
fixPkgconfig
|
||||
|
||||
sed -i 's/develop\/headers$/develop\/headers\/os\/opengl/' $installDestDir$developLibDir/pkgconfig/osmesa.pc
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
|
||||
# swpipe renderer package
|
||||
packageEntries swpipe \
|
||||
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0" \
|
||||
"$addOnsDir/opengl/egl_vendor.d/libEGL_mesa.so.0.0.0" \
|
||||
"$addOnsDir/opengl/egl_vendor.d/50_mesa.json"
|
||||
|
||||
# lavapipe renderer package
|
||||
packageEntries lavapipe \
|
||||
"$addOnsDir/vulkan/icd.d/libvulkan_lvp.so"
|
||||
|
||||
rmdir "$addOnsDir"/opengl
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check
|
||||
}
|
||||
60
sys-libs/mesa/patches/mesa-23.1.0.patchset
Normal file
60
sys-libs/mesa/patches/mesa-23.1.0.patchset
Normal file
@@ -0,0 +1,60 @@
|
||||
From 73e30222bdce9ac66e16c0e2b524856f2cf5aa38 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander von Gluck IV <kallisti5@unixzen.com>
|
||||
Date: Sat, 15 Apr 2023 08:08:43 -0500
|
||||
Subject: [PATCH] gallium/frontends/hgl: Convert to system GLView.h.
|
||||
|
||||
* This is needed for our BGL_INDEX, BGL_ALPHA, BGL_DEPTH, etc.
|
||||
---
|
||||
meson.build | 1 +
|
||||
src/gallium/frontends/hgl/hgl.c | 3 +--
|
||||
src/gallium/frontends/hgl/meson.build | 1 +
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index c7a4be82e59..7610defb896 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1524,6 +1524,7 @@ endif
|
||||
|
||||
if with_platform_haiku
|
||||
dep_network = cc.find_library('network')
|
||||
+ dep_glkit = dependency('gl', version : '>= 1.0')
|
||||
endif
|
||||
|
||||
dep_futex = null_dep
|
||||
diff --git a/src/gallium/frontends/hgl/hgl.c b/src/gallium/frontends/hgl/hgl.c
|
||||
index 7fd5745d90f..a730593ba04 100644
|
||||
--- a/src/gallium/frontends/hgl/hgl.c
|
||||
+++ b/src/gallium/frontends/hgl/hgl.c
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "hgl_context.h"
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <GLView.h>
|
||||
|
||||
#include "util/format/u_formats.h"
|
||||
#include "util/u_atomic.h"
|
||||
@@ -18,8 +19,6 @@
|
||||
#include "util/u_inlines.h"
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
-#include "GLView.h"
|
||||
-
|
||||
|
||||
#ifdef DEBUG
|
||||
# define TRACE(x...) printf("hgl:frontend: " x)
|
||||
diff --git a/src/gallium/frontends/hgl/meson.build b/src/gallium/frontends/hgl/meson.build
|
||||
index 3b6348db338..ac4540558c4 100644
|
||||
--- a/src/gallium/frontends/hgl/meson.build
|
||||
+++ b/src/gallium/frontends/hgl/meson.build
|
||||
@@ -31,6 +31,7 @@ endif
|
||||
libsthgl = static_library(
|
||||
'sthgl',
|
||||
files_libsthgl,
|
||||
+ dependencies : [dep_glkit],
|
||||
include_directories : [
|
||||
inc_include, inc_util, inc_mesa, inc_mapi, inc_src,
|
||||
inc_gallium, inc_gallium_aux
|
||||
--
|
||||
2.37.3
|
||||
|
||||
Reference in New Issue
Block a user