ports: Add libxshfence port

This commit is contained in:
2026-07-05 14:01:27 +03:00
parent 659bc50aec
commit 6e2542d896
3 changed files with 64 additions and 0 deletions

11
ports/libxshmfence/build.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash ../install.sh
NAME='libxshmfence'
VERSION='1.3.3'
DOWNLOAD_URL="https://www.x.org/releases/individual/lib/libxshmfence-$VERSION.tar.xz#d4a4df096aba96fea02c029ee3a44e11a47eb7f7213c1a729be83e85ec3fde10"
CONFIG_SUB=('config.sub')
DEPENDENCIES=('xorgproto')
CONFIGURE_OPTIONS=(
'--enable-shared=yes'
'--enable-static=no'
)

View File

@@ -0,0 +1,31 @@
diff -ruN libxshmfence-1.3.3/configure libxshmfence-1.3.3-banan_os/configure
--- libxshmfence-1.3.3/configure 2024-12-14 04:05:14.000000000 +0200
+++ libxshmfence-1.3.3-banan_os/configure 2026-07-05 09:29:32.691762812 +0300
@@ -6238,6 +6238,10 @@
lt_cv_deplibs_check_method=pass_all
;;
+banan_os*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
beos*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -11742,6 +11746,16 @@
;;
esac
;;
+
+banan_os*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker="$host_os DynamicLoader.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
beos*)
library_names_spec='$libname$shared_ext'

View File

@@ -0,0 +1,22 @@
diff -ruN libxshmfence-1.3.3/src/xshmfence_futex.h libxshmfence-1.3.3-banan_os/src/xshmfence_futex.h
--- libxshmfence-1.3.3/src/xshmfence_futex.h 2024-12-14 04:05:01.000000000 +0200
+++ libxshmfence-1.3.3-banan_os/src/xshmfence_futex.h 2026-07-05 09:37:56.106400833 +0300
@@ -45,6 +45,18 @@
return sys_futex(addr, UMTX_OP_WAIT_UINT, value);
}
+#elif defined(__banan_os__)
+
+#include <sys/futex.h>
+
+static inline int futex_wake(int32_t *addr) {
+ return futex(FUTEX_WAKE, (const uint32_t*)addr, INT_MAX, nullptr);
+}
+
+static inline int futex_wait(int32_t *addr, int32_t value) {
+ return futex(FUTEX_WAIT, (const uint32_t*)addr, value, nullptr);
+}
+
#else
#include <stdint.h>