ports: Add mesa port
This commit is contained in:
parent
c3004a038f
commit
ab00686ac9
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash ../install.sh
|
||||||
|
|
||||||
|
NAME='mesa'
|
||||||
|
VERSION='25.0.7'
|
||||||
|
DOWNLOAD_URL="https://archive.mesa3d.org/mesa-$VERSION.tar.xz#592272df3cf01e85e7db300c449df5061092574d099da275d19e97ef0510f8a6"
|
||||||
|
DEPENDENCIES=('zlib' 'zstd' 'expat')
|
||||||
|
CONFIGURE_OPTIONS=(
|
||||||
|
'-Dprefix=/usr'
|
||||||
|
'-Dosmesa=true'
|
||||||
|
'-Dgallium-drivers=softpipe'
|
||||||
|
'-Dvulkan-drivers=[]'
|
||||||
|
'-Dplatforms=[]'
|
||||||
|
'-Dglx=disabled'
|
||||||
|
'-Dbuildtype=release'
|
||||||
|
)
|
||||||
|
|
||||||
|
configure() {
|
||||||
|
meson setup --reconfigure --cross-file "$MESON_CROSS_FILE" "${CONFIGURE_OPTIONS[@]}" build || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
meson compile -C build || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
meson install --destdir="$BANAN_SYSROOT" -C build || exit 1
|
||||||
|
|
||||||
|
ln -sf osmesa.pc $BANAN_SYSROOT/usr/lib/pkgconfig/opengl.pc
|
||||||
|
ln -sf libOSMesa.so $BANAN_SYSROOT/usr/lib/libGL.so
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
diff -ruN mesa-25.0.7/src/util/macros.h mesa-25.0.7-banan_os/src/util/macros.h
|
||||||
|
--- mesa-25.0.7/src/util/macros.h 2025-05-28 18:20:23.000000000 +0300
|
||||||
|
+++ mesa-25.0.7-banan_os/src/util/macros.h 2025-06-17 13:59:03.341231717 +0300
|
||||||
|
@@ -25,7 +25,7 @@
|
||||||
|
#define UTIL_MACROS_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
-#if defined(__HAIKU__) && !defined(__cplusplus)
|
||||||
|
+#if (defined(__HAIKU__) || defined(__banan_os__)) && !defined(__cplusplus)
|
||||||
|
#define static_assert _Static_assert
|
||||||
|
#endif
|
||||||
|
#include <stddef.h>
|
|
@ -0,0 +1,25 @@
|
||||||
|
diff -ruN mesa-25.0.7/src/util/detect_os.h mesa-25.0.7-banan_os/src/util/detect_os.h
|
||||||
|
--- mesa-25.0.7/src/util/detect_os.h 2025-05-28 18:20:23.000000000 +0300
|
||||||
|
+++ mesa-25.0.7-banan_os/src/util/detect_os.h 2025-06-17 14:04:20.625567958 +0300
|
||||||
|
@@ -76,6 +76,11 @@
|
||||||
|
#define DETECT_OS_WINDOWS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(__banan_os__)
|
||||||
|
+#define DETECT_OS_BANAN_OS 1
|
||||||
|
+#define DETECT_OS_POSIX 1
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#if defined(__HAIKU__)
|
||||||
|
#define DETECT_OS_HAIKU 1
|
||||||
|
#define DETECT_OS_POSIX 1
|
||||||
|
@@ -113,6 +118,9 @@
|
||||||
|
#ifndef DETECT_OS_FREEBSD
|
||||||
|
#define DETECT_OS_FREEBSD 0
|
||||||
|
#endif
|
||||||
|
+#ifndef DETECT_OS_BANAN_OS
|
||||||
|
+#define DETECT_OS_BANAN_OS 0
|
||||||
|
+#endif
|
||||||
|
#ifndef DETECT_OS_HAIKU
|
||||||
|
#define DETECT_OS_HAIKU 0
|
||||||
|
#endif
|
|
@ -0,0 +1,34 @@
|
||||||
|
diff -ruN mesa-25.0.7/src/util/os_misc.c mesa-25.0.7-banan_os/src/util/os_misc.c
|
||||||
|
--- mesa-25.0.7/src/util/os_misc.c 2025-05-28 18:20:23.000000000 +0300
|
||||||
|
+++ mesa-25.0.7-banan_os/src/util/os_misc.c 2025-06-17 14:14:54.254785327 +0300
|
||||||
|
@@ -69,6 +69,9 @@
|
||||||
|
# include <mach/vm_param.h>
|
||||||
|
# include <mach/vm_statistics.h>
|
||||||
|
# endif
|
||||||
|
+#elif DETECT_OS_BANAN_OS
|
||||||
|
+# include <fcntl.h>
|
||||||
|
+# include <sys/banan-os.h>
|
||||||
|
#elif DETECT_OS_HAIKU
|
||||||
|
# include <kernel/OS.h>
|
||||||
|
#elif DETECT_OS_WINDOWS
|
||||||
|
@@ -311,6 +314,20 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (sysctl(mib, 2, size, &len, NULL, 0) == 0);
|
||||||
|
+#elif DETECT_OS_BANAN_OS
|
||||||
|
+ int meminfo_fd = open("/proc/meminfo", O_RDONLY);
|
||||||
|
+ if (meminfo_fd == -1)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ struct full_meminfo_t meminfo;
|
||||||
|
+ ssize_t nread = read(meminfo_fd, &meminfo, sizeof(meminfo));
|
||||||
|
+ close(meminfo_fd);
|
||||||
|
+
|
||||||
|
+ if (nread != sizeof(meminfo))
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ *size = (meminfo.free_pages + meminfo.used_pages) * meminfo.page_size;
|
||||||
|
+ return true;
|
||||||
|
#elif DETECT_OS_HAIKU
|
||||||
|
system_info info;
|
||||||
|
status_t ret;
|
|
@ -0,0 +1,14 @@
|
||||||
|
diff -ruN mesa-25.0.7/include/c99_alloca.h mesa-25.0.7-banan_os/include/c99_alloca.h
|
||||||
|
--- mesa-25.0.7/include/c99_alloca.h 2025-05-28 18:20:23.000000000 +0300
|
||||||
|
+++ mesa-25.0.7-banan_os/include/c99_alloca.h 2025-06-17 14:29:11.535095878 +0300
|
||||||
|
@@ -39,6 +39,10 @@
|
||||||
|
|
||||||
|
# include <alloca.h>
|
||||||
|
|
||||||
|
+#elif defined(__banan_os__)
|
||||||
|
+
|
||||||
|
+# define alloca __builtin_alloca
|
||||||
|
+
|
||||||
|
#else /* !defined(_MSC_VER) */
|
||||||
|
|
||||||
|
# include <stdlib.h>
|
Loading…
Reference in New Issue