From 42c518c02a3094376c2b0331959a1dd3aba9ed53 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 12 Nov 2023 13:36:46 +0100 Subject: [PATCH 1/3] PrismLauncher: fix Minecraft runtime on musl libc - set sane default soname for gflw and openal --- .../PrismLauncher/patches/musl-findPath.patch | 47 +++++++++++++++++++ srcpkgs/PrismLauncher/template | 5 +- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/PrismLauncher/patches/musl-findPath.patch diff --git a/srcpkgs/PrismLauncher/patches/musl-findPath.patch b/srcpkgs/PrismLauncher/patches/musl-findPath.patch new file mode 100644 index 0000000000000..8a57bc1f1180f --- /dev/null +++ b/srcpkgs/PrismLauncher/patches/musl-findPath.patch @@ -0,0 +1,47 @@ +diff --git a/launcher/MangoHud.cpp b/launcher/MangoHud.cpp +index ab79f418..ab685b82 100644 +--- a/launcher/MangoHud.cpp ++++ b/launcher/MangoHud.cpp +@@ -27,13 +27,14 @@ + #include "Json.h" + #include "MangoHud.h" + +-#ifdef __GLIBC__ ++#ifdef Q_OS_LINUX + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #define UNDEF_GNU_SOURCE + #endif + #include + #include ++#include + #endif + + namespace MangoHud { +@@ -119,7 +120,7 @@ QString getLibraryString() + + QString findLibrary(QString libName) + { +-#ifdef __GLIBC__ ++#ifdef Q_OS_LINUX + const char* library = libName.toLocal8Bit().constData(); + + void* handle = dlopen(library, RTLD_NOW); +@@ -128,14 +129,14 @@ QString findLibrary(QString libName) + return {}; + } + +- char path[PATH_MAX]; +- if (dlinfo(handle, RTLD_DI_ORIGIN, path) == -1) { ++ struct link_map *linkmap; ++ if (dlinfo(handle, RTLD_DI_LINKMAP, &linkmap) == -1) { + qCritical() << "dlinfo() failed:" << dlerror(); + dlclose(handle); + return {}; + } + +- auto fullPath = FS::PathCombine(QString(path), libName); ++ auto fullPath = QString(linkmap->l_name); + + dlclose(handle); + return fullPath; diff --git a/srcpkgs/PrismLauncher/template b/srcpkgs/PrismLauncher/template index 50f83b9af96db..a608f2a9fd0ab 100644 --- a/srcpkgs/PrismLauncher/template +++ b/srcpkgs/PrismLauncher/template @@ -1,9 +1,10 @@ # Template file for 'PrismLauncher' pkgname=PrismLauncher version=8.0 -revision=1 +revision=2 build_style=cmake -configure_args="-DLauncher_BUILD_PLATFORM=Void -DLauncher_QT_VERSION_MAJOR='5'" +configure_args="-DLauncher_BUILD_PLATFORM=Void -DLauncher_QT_VERSION_MAJOR='5' + -DLauncher_GLFW_LIBRARY_NAME=libglfw.so.3 -DLauncher_OPENAL_LIBRARY_NAME=libopenal.so.1" hostmakedepends="extra-cmake-modules openjdk17 pkg-config qt5-host-tools qt5-qmake scdoc" makedepends="qt5-devel" From de1d9b20f3af426a314b4f858a61f27dbac80973 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 14 Nov 2023 10:02:20 +0100 Subject: [PATCH 2/3] obs: add luajit buildoption, enable oneVPL on all systems --- srcpkgs/obs/patches/non-x86-64.patch | 59 ++++++++++++++++++++++++++++ srcpkgs/obs/template | 20 +++++----- 2 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 srcpkgs/obs/patches/non-x86-64.patch diff --git a/srcpkgs/obs/patches/non-x86-64.patch b/srcpkgs/obs/patches/non-x86-64.patch new file mode 100644 index 0000000000000..280d8f18fb124 --- /dev/null +++ b/srcpkgs/obs/patches/non-x86-64.patch @@ -0,0 +1,59 @@ +--- a/plugins/obs-qsv11/QSV_Encoder.cpp 2023-11-10 09:29:58.000000000 +0100 ++++ - 2023-11-14 10:27:36.335536275 +0100 +@@ -284,6 +284,7 @@ + + enum qsv_cpu_platform qsv_get_cpu_platform() + { ++#if defined(__x86_64__) + using std::string; + + int cpuInfo[4]; +@@ -363,6 +364,9 @@ + + //assume newer revisions are at least as capable as Haswell + return QSV_CPU_PLATFORM_INTEL; ++#else ++ return QSV_CPU_PLATFORM_UNKNOWN; ++#endif + } + + int qsv_hevc_encoder_headers(qsv_t *pContext, uint8_t **pVPS, uint8_t **pSPS, +--- a/plugins/obs-qsv11/common_utils_linux.cpp 2023-11-10 09:29:58.000000000 +0100 ++++ - 2023-11-14 10:28:41.685885028 +0100 +@@ -1,7 +1,9 @@ + #include "common_utils.h" + + #include ++#if defined(__x86_64__) + #include ++#endif + #include + #include + #include +@@ -191,12 +193,14 @@ + return 0.0; + } + ++#if defined(__x86_64__) + extern "C" void util_cpuid(int cpuinfo[4], int level) + { + __get_cpuid(level, (unsigned int *)&cpuinfo[0], + (unsigned int *)&cpuinfo[1], (unsigned int *)&cpuinfo[2], + (unsigned int *)&cpuinfo[3]); + } ++#endif + + struct vaapi_device { + int fd; +--- a/plugins/obs-qsv11/common_utils.h 2023-11-10 09:29:58.000000000 +0100 ++++ - 2023-11-14 10:29:16.281404822 +0100 +@@ -24,7 +24,9 @@ + extern struct adapter_info adapters[MAX_ADAPTERS]; + extern size_t adapter_count; + ++#if defined(__x86_64__) + void util_cpuid(int cpuinfo[4], int flags); ++#endif + void check_adapters(struct adapter_info *adapters, size_t *adapter_count); + + #ifdef __cplusplus diff --git a/srcpkgs/obs/template b/srcpkgs/obs/template index 90d903a7b982c..efaf2250f3b86 100644 --- a/srcpkgs/obs/template +++ b/srcpkgs/obs/template @@ -2,17 +2,18 @@ pkgname=obs version=30.0.0 revision=1 -archs="i686* x86_64* ppc64le* aarch64*" +archs="i686* x86_64* ppc64le* aarch64* riscv64*" build_style=cmake configure_args="-DOBS_VERSION_OVERRIDE=${version} -DENABLE_JACK=ON - -DENABLE_VST=OFF -DENABLE_AJA=OFF -DCALM_DEPRECATION=ON" + -DENABLE_VST=OFF -DENABLE_AJA=OFF -DCALM_DEPRECATION=ON + -DENABLE_SCRIPTING_LUA=$(vopt_if luajit 'ON' 'OFF')" hostmakedepends="pkg-config swig python3-devel qt6-base" -makedepends="LuaJIT-devel fdk-aac-devel ffmpeg-devel glu-devel +makedepends="$(vopt_if luajit LuaJIT-devel) fdk-aac-devel ffmpeg-devel glu-devel jack-devel libXcomposite-devel libcurl-devel libva-devel pulseaudio-devel python3-devel speexdsp-devel v4l-utils-devel vlc-devel qt6-svg-devel x264-devel mbedtls-devel jansson-devel wayland-devel pipewire-devel libxkbcommon-devel pciutils-devel - librist-devel srt-devel libdatachannel-devel" + librist-devel srt-devel libdatachannel-devel oneVPL-devel" depends="xset xdg-desktop-portal" short_desc="Open Broadcaster Software" maintainer="lemmi " @@ -22,13 +23,10 @@ changelog="https://github.com/obsproject/obs-studio/releases" distfiles="https://github.com/obsproject/obs-studio/archive/refs/tags/$version.tar.gz" checksum=c23dd463862b1a8f40365d84fd52105d7eafc3614fb3d470b695ba28a6e4da06 -case "$XBPS_TARGET_MACHINE" in - aarch64*) - configure_args+=" -DENABLE_QSV11=off" - ;; - *) - makedepends+=" oneVPL" - ;; +build_options="luajit" +case $XBPS_TARGET_MACHINE in + riscv64*);; + *) build_options_default="luajit";; esac pre_configure() { From 3bb7bbc8fd6403e2a2095d66133dab2c7e258dfe Mon Sep 17 00:00:00 2001 From: John Date: Tue, 14 Nov 2023 10:09:21 +0100 Subject: [PATCH 3/3] oneVPL: add devel subpackage, fix cross --- srcpkgs/oneVPL-devel | 1 + srcpkgs/oneVPL/patches/cross-pc.patch | 12 ++++++++++++ srcpkgs/oneVPL/template | 14 +++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 120000 srcpkgs/oneVPL-devel create mode 100644 srcpkgs/oneVPL/patches/cross-pc.patch diff --git a/srcpkgs/oneVPL-devel b/srcpkgs/oneVPL-devel new file mode 120000 index 0000000000000..03776a5d59e14 --- /dev/null +++ b/srcpkgs/oneVPL-devel @@ -0,0 +1 @@ +oneVPL \ No newline at end of file diff --git a/srcpkgs/oneVPL/patches/cross-pc.patch b/srcpkgs/oneVPL/patches/cross-pc.patch new file mode 100644 index 0000000000000..0b24a2124c9b2 --- /dev/null +++ b/srcpkgs/oneVPL/patches/cross-pc.patch @@ -0,0 +1,12 @@ +--- a/dispatcher/pkgconfig/vpl.pc.in 2023-07-21 23:28:38.000000000 +0200 ++++ - 2023-11-14 10:16:46.665168740 +0100 +@@ -1,6 +1,6 @@ +-prefix=@pc_rel_prefix@ +-libdir=@pc_rel_libdir@ +-includedir=@pc_rel_incdir@ ++prefix=@CMAKE_INSTALL_PREFIX@ ++libdir=${prefix}/lib ++includedir=${prefix}/include + + # oneAPI Video Processing Library (oneVPL) + Name: oneVPL diff --git a/srcpkgs/oneVPL/template b/srcpkgs/oneVPL/template index 9ceeea7ccc737..03be8b4c83fdb 100644 --- a/srcpkgs/oneVPL/template +++ b/srcpkgs/oneVPL/template @@ -1,7 +1,7 @@ # Template file for 'oneVPL' pkgname=oneVPL version=2023.3.1 -revision=1 +revision=2 build_style=cmake hostmakedepends="libva-devel libX11-devel" hostmakedepends="pkg-config" @@ -17,6 +17,18 @@ post_install() { vlicense LICENSE } +oneVPL-devel_package() { + short_desc+=" - development files" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove etc/vpl/vars.sh + vmove usr/include + vmove usr/lib/pkgconfig + vmove usr/lib/cmake + vmove "usr/lib/*.so" + } +} + oneVPL-examples_package() { short_desc+=" - examples" depends="${sourcepkg}>=${version}_${revision}"