The package rpms/openvr.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/openvr.git/commit/?id=118d467b267ee2....
Change: +%ifarch i686
Thanks.
Full change: ============
commit 118d467b267ee2c0887ac3b262afe9c7698f13e9 Author: Davide Cavalca dcavalca@fedoraproject.org Date: Sun Oct 29 19:50:03 2023 -0700
Initial import; Fixes: RHBZ#2244984
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9231b4d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/openvr-1.26.7.tar.gz diff --git a/1511.patch b/1511.patch new file mode 100644 index 0000000..eff42c0 --- /dev/null +++ b/1511.patch @@ -0,0 +1,53 @@ +From 9803a10192582b21c1bbcbc4c625a1c641ab5b1d Mon Sep 17 00:00:00 2001 +From: Dan Church amphetamachine@gmail.com +Date: Sat, 23 Jan 2021 15:59:00 -0600 +Subject: [PATCH 1/2] Use GNUInstallDirs to determine lib install path + +--- + src/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 29b69c5c..4da45b62 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -4,6 +4,8 @@ project(openvr_api) + set( LIBNAME "openvr_api" ) + set(OPENVR_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../headers) + ++include(GNUInstallDirs) ++ + # Set some properies for specific files. + if(APPLE) + set(CMAKE_MACOSX_RPATH 1) +@@ -101,7 +103,7 @@ endif() + target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS}) + target_include_directories(${LIBNAME} PUBLIC ${OPENVR_HEADER_DIR}) + +-install(TARGETS ${LIBNAME} DESTINATION lib) ++install(TARGETS ${LIBNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(FILES ${PUBLIC_HEADER_FILES} DESTINATION include/openvr) + + # Generate a .pc file for linux environments + +From 69ad8a0810e1941062833fdec37e1e9632f390e2 Mon Sep 17 00:00:00 2001 +From: Dan Church amphetamachine@gmail.com +Date: Sat, 23 Jan 2021 16:07:36 -0600 +Subject: [PATCH 2/2] Update pkg-config entry + +--- + src/openvr.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/openvr.pc.in b/src/openvr.pc.in +index 3edba91c..0041a5ce 100644 +--- a/src/openvr.pc.in ++++ b/src/openvr.pc.in +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} +-libdir=${prefix}/lib ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ + includedir=${prefix}/include/openvr + + Name: openvr diff --git a/1716.patch b/1716.patch new file mode 100644 index 0000000..ecea434 --- /dev/null +++ b/1716.patch @@ -0,0 +1,110 @@ +From 54a58e479f4d63e62e9118637cd92a2013a4fb95 Mon Sep 17 00:00:00 2001 +From: Lubosz Sarnecki lubosz.sarnecki@collabora.com +Date: Thu, 15 Aug 2019 16:07:01 +0200 +Subject: [PATCH 1/2] cmake: Add option to build with system jsoncpp. + +This patch adds the CMake build option `USE_SYSTEM_JSONCPP`, +which instead of using the internal `jsoncpp.cpp` links against +the system installed jsoncpp library. + +This results in a `libopenvr_api.so` that is only 115K instead of 301K +on my system. + +Distributions like Debian will prefer this behaviour, since it will give +them the possibility to maintain version and security issues for jsoncpp +in one place. + +This behaviour can be enabled by + +``` +cmake -DUSE_SYSTEM_JSONCPP=True . +``` + +When the flag is not set, the build will behave like it did before. + +I tested this patch using the system wide jsoncpp successfully +with xrdesktop. +--- + CMakeLists.txt | 1 + + src/CMakeLists.txt | 12 +++++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8956cdad..1150c53d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,6 +28,7 @@ option(BUILD_UNIVERSAL "Builds the shared or framework as a universal (fat, 32- + option(BUILD_OSX_I386 "Builds the shared or framework as a 32-bit binary, even on a 64-bit platform" OFF) + option(USE_LIBCXX "Uses libc++ instead of libstdc++" ON) + option(USE_CUSTOM_LIBCXX "Uses a custom libc++" OFF) ++option(USE_SYSTEM_JSONCPP "Uses the system installed jsoncpp." OFF) + + add_definitions( -DVR_API_PUBLIC ) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b83710af..a7b64db9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -34,8 +34,14 @@ endif() + # Set the source group and files. + set(CORE_FILES + openvr_api_public.cpp +- jsoncpp.cpp + ) ++ ++if(NOT USE_SYSTEM_JSONCPP) ++ set(JSON_CPP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/jsoncpp) ++ include_directories(${JSON_CPP_DIR}) ++ list(APPEND CORE_FILES ${JSON_CPP_DIR}/jsoncpp.cpp) ++endif() ++ + set(VRCORE_FILES + vrcore/dirtools_public.cpp + vrcore/envvartools_public.cpp +@@ -100,6 +106,10 @@ if(USE_CUSTOM_LIBCXX) + set(EXTRA_LIBS ${EXTRA_LIBS} c++ c++abi) + endif() + ++if(USE_SYSTEM_JSONCPP) ++ list(APPEND EXTRA_LIBS jsoncpp) ++endif() ++ + target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS}) + target_include_directories(${LIBNAME} PUBLIC ${OPENVR_HEADER_DIR}) + + +From a7a6995d1d6f9ee1a17a3741661156f9706c40ce Mon Sep 17 00:00:00 2001 +From: Lubosz Sarnecki lubosz.sarnecki@collabora.com +Date: Thu, 15 Aug 2019 15:05:34 +0200 +Subject: [PATCH 2/2] thirdparty: Move jsoncpp to thridparty directory. + +Even though the previous patch in this patch set enabled the build with +a system wide jsoncpp and worked for me, it still left the internal +jsoncpp includes in the include path, since the includes were placed +in `CMAKE_CURRENT_SOURCE_DIR`. This could cause problems on other systems +when trying to build with a system wide jsoncpp. + +In order to remove the internal json.h from the include path, +I moved all jsoncpp files into a thridparty directory amd include +it in the case of `USE_SYSTEM_JSONCPP` not being set. +--- + {src => thirdparty/jsoncpp}/json/json-forwards.h | 0 + {src => thirdparty/jsoncpp}/json/json.h | 0 + {src => thirdparty/jsoncpp}/jsoncpp.cpp | 0 + 3 files changed, 0 insertions(+), 0 deletions(-) + rename {src => thirdparty/jsoncpp}/json/json-forwards.h (100%) + rename {src => thirdparty/jsoncpp}/json/json.h (100%) + rename {src => thirdparty/jsoncpp}/jsoncpp.cpp (100%) + +diff --git a/src/json/json-forwards.h b/thirdparty/jsoncpp/json/json-forwards.h +similarity index 100% +rename from src/json/json-forwards.h +rename to thirdparty/jsoncpp/json/json-forwards.h +diff --git a/src/json/json.h b/thirdparty/jsoncpp/json/json.h +similarity index 100% +rename from src/json/json.h +rename to thirdparty/jsoncpp/json/json.h +diff --git a/src/jsoncpp.cpp b/thirdparty/jsoncpp/jsoncpp.cpp +similarity index 100% +rename from src/jsoncpp.cpp +rename to thirdparty/jsoncpp/jsoncpp.cpp diff --git a/openvr-api-soversion.patch b/openvr-api-soversion.patch new file mode 100644 index 0000000..087ccdd --- /dev/null +++ b/openvr-api-soversion.patch @@ -0,0 +1,11 @@ +diff -Naur a/src/CMakeLists.txt b/src/CMakeLists.txt +--- a/src/CMakeLists.txt 2023-10-24 19:58:37.076421394 -0700 ++++ b/src/CMakeLists.txt 2023-10-24 20:00:26.807622046 -0700 +@@ -78,6 +78,7 @@ + # Build the library. + if(BUILD_SHARED) + add_library(${LIBNAME} SHARED ${SOURCE_FILES}) ++ set_target_properties(${LIBNAME} PROPERTIES SOVERSION 1.0.0) + elseif(BUILD_FRAMEWORK) + set( LIBNAME "OpenVR" ) + add_library( ${LIBNAME} diff --git a/openvr-skip-steamvr-check.patch b/openvr-skip-steamvr-check.patch new file mode 100644 index 0000000..81c8886 --- /dev/null +++ b/openvr-skip-steamvr-check.patch @@ -0,0 +1,13 @@ +diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt +index 545ff1a..3270bcb 100644 +--- a/samples/CMakeLists.txt ++++ b/samples/CMakeLists.txt +@@ -52,7 +52,7 @@ set(SHARED_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shared) + # (needed to prevent a segfault in OpenVR). + if(CMAKE_HOST_UNIX) + find_file(OPENVRPATHS openvrpaths.vrpath PATHS $ENV{HOME}/.config/openvr "$ENV{HOME}/Library/Application Support/OpenVR/.openvr") +- if(${OPENVRPATHS} MATCHES OPENVRPATHS-NOTFOUND) ++ if(${OPENVRPATHS} MATCHES OPENVRPATHS-NOTFOUND AND NOT SKIP_STEAMVR_CHECK) + message(FATAL_ERROR "${OPENVRPATHS} Please install SteamVR SDK to continue..") + endif() + endif() diff --git a/openvr-use-system-sdl2-vulkan.patch b/openvr-use-system-sdl2-vulkan.patch new file mode 100644 index 0000000..5cfd545 --- /dev/null +++ b/openvr-use-system-sdl2-vulkan.patch @@ -0,0 +1,72 @@ +diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt +index 545ff1a..dacb2ba 100644 +--- a/samples/CMakeLists.txt ++++ b/samples/CMakeLists.txt +@@ -137,35 +137,44 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + list(APPEND SDL2_LIBRARIES ${${lib}_LIBRARY}) + endforeach() + else() +- foreach(lib ${SDL_REQUIRED_LIBRARIES}) +- find_library(${lib}_LIBRARY +- NAMES ++ if (USE_SYSTEM_SDL2) ++ find_package(${SDL_REQUIRED_LIBRARIES} REQUIRED) ++ else() ++ foreach(lib ${SDL_REQUIRED_LIBRARIES}) ++ find_library(${lib}_LIBRARY ++ NAMES + ${lib} +- PATHS +- ${THIRDPARTY_DIR}/sdl2-2.0.3/bin +- PATH_SUFFIXES +- linux${PLATFORM} +- ${WINDOWS_PATH_SUFFIXES} +- ) +- list(APPEND SDL2_LIBRARIES ${${lib}_LIBRARY}) +- endforeach() ++ PATHS ++ ${THIRDPARTY_DIR}/sdl2-2.0.3/bin ++ PATH_SUFFIXES ++ linux${PLATFORM} ++ ${WINDOWS_PATH_SUFFIXES} ++ ) ++ list(APPEND SDL2_LIBRARIES ${${lib}_LIBRARY}) ++ endforeach() ++ endif() + endif() + set(SDL2_INCLUDE_DIR ${THIRDPARTY_DIR}/sdl2-2.0.3/include) + + ## Vulkan + if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) +- find_library(VULKAN_LIBRARY +- NAMES +- vulkan-1 +- vulkan +- PATHS +- ${THIRDPARTY_DIR}/vulkan-1.0.49.0/lib +- PATH_SUFFIXES +- linux${PLATFORM} +- ${WINDOWS_PATH_SUFFIXES} +- NO_DEFAULT_PATH +- ) +- set(VULKAN_INCLUDE_DIR ${THIRDPARTY_DIR}/vulkan-1.0.49.0/include) ++ if (USE_SYSTEM_VULKAN) ++ find_package(Vulkan REQUIRED) ++ list(APPEND EXTRA_LIBS ${Vulkan_LIBRARIES}) ++ else() ++ find_library(VULKAN_LIBRARY ++ NAMES ++ vulkan-1 ++ vulkan ++ PATHS ++ ${THIRDPARTY_DIR}/vulkan-1.0.49.0/lib ++ PATH_SUFFIXES ++ linux${PLATFORM} ++ ${WINDOWS_PATH_SUFFIXES} ++ NO_DEFAULT_PATH ++ ) ++ set(VULKAN_INCLUDE_DIR ${THIRDPARTY_DIR}/vulkan-1.0.49.0/include) ++ endif() + endif() + + diff --git a/openvr.spec b/openvr.spec new file mode 100644 index 0000000..9e8c447 --- /dev/null +++ b/openvr.spec @@ -0,0 +1,206 @@ +# Samples aren't supported on i686 +%ifarch i686 +%bcond_with samples +%else +%bcond_without samples +%endif + +%global common_description %{expand: +OpenVR is an API and runtime that allows access to VR hardware from multiple +vendors without requiring that applications have specific knowledge of the +hardware they are targeting.} + +Name: openvr +Version: 1.26.7 +Release: %autorelease +Summary: OpenVR SDK + +License: BSD-3-Clause +URL: https://github.com/ValveSoftware/openvr +Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +# Use GNUInstallDirs to determine lib install path +Patch: %{url}/pull/1511.patch +# Add ability to build with system installed jsoncpp +Patch: %{url}/pull/1716.patch +# Add option to neuter the steamvr check +Patch: openvr-skip-steamvr-check.patch +# Add ability to build with system installed SDL2 and Vulkan +Patch: openvr-use-system-sdl2-vulkan.patch +# Define soversion for the OpenVR API library +Patch: openvr-api-soversion.patch + +BuildRequires: cmake +BuildRequires: gcc-c++ + +BuildRequires: jsoncpp-devel + +%if %{with samples} +BuildRequires: chrpath +BuildRequires: glslang +BuildRequires: glslc +BuildRequires: sed + +BuildRequires: glew-devel +BuildRequires: libGL-devel +BuildRequires: qt5-qtbase-devel +BuildRequires: SDL2-devel +BuildRequires: vulkan-loader-devel +%endif + +%description %{common_description} + +%package api +Summary: OpenVR API libraries + +%description api %{common_description} + +This package provides the shared libraries for the OpenVR Application API. + +%package devel +Summary: Development headers for %{name} +Requires: jsoncpp-devel +Requires: %{name}-api%{?_isa} = %{version}-%{release} + +%description devel %{common_description} + +This package provides the development headers for OpenVR. + +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc %{common_description} + +This package provides additional documentation for OpenVR. + +%if %{with samples} +%package samples +Summary: OpenVR Samples + +%description samples %{common_description} + +This package provides various sample programs and drivers using OpenVR. +%endif + +%prep +%autosetup -p1 + +# Delete prebuilt binaries and libraries +rm -r bin lib samples/bin/{android*,linux*,win*} + +# Delete prebuilt shaders +rm samples/bin/shaders/*.spv + +# Delete bundled library sources +rm -r thirdparty samples/thirdparty + +%if %{with samples} +# Fix paths in samples +sed -i 's:../hellovr_actions.json:%{_datadir}/%{name}/hellovr_actions.json:' \ + samples/hellovr_opengl/hellovr_opengl_main.cpp +sed -i 's:../shaders/:%{_libdir}/%{name}/shaders/:' \ + samples/hellovr_vulkan/hellovr_vulkan_main.cpp +sed -i 's:../cube_texture.png:%{_datadir}/%{name}/cube_texture.png:' \ + samples/hellovr_opengl/hellovr_opengl_main.cpp \ + samples/hellovr_vulkan/hellovr_vulkan_main.cpp +%endif + +%build +# Build library +%cmake \ + -DBUILD_SHARED=ON \ + -DUSE_SYSTEM_JSONCPP=ON +%cmake_build + +%if %{with samples} +# Build shaders +# see samples/bin/shaders/build_vulkan_shaders.bat +for f in samples/bin/shaders/*.hlsl; do + base="$(dirname "$f")/$(basename "$f" .hlsl)" + + glslangValidator \ + -S vert \ + -e VSMain \ + -o "${base}_vs.spv" \ + -V \ + --hlsl-iomap \ + --auto-map-bindings \ + --shift-cbuffer-binding 0 \ + --shift-texture-binding 1 \ + --shift-sampler-binding 2 \ + -D "$f" + + glslangValidator \ + -S frag \ + -e PSMain \ + -o "${base}_ps.spv" \ + -V \ + --hlsl-iomap \ + --auto-map-bindings \ + --shift-cbuffer-binding 0 \ + --shift-texture-binding 1 \ + --shift-sampler-binding 2 \ + -D "$f" +done + +# Build samples +pushd samples +%cmake \ + -DSKIP_STEAMVR_CHECK=ON \ + -DUSE_SYSTEM_SDL2=ON \ + -DUSE_SYSTEM_VULKAN=ON +%cmake_build + +# Build sample drivers +pushd drivers +%cmake +%cmake_build +%endif + +%install +%cmake_install + +%if %{with samples} +# Samples have to be installed manually +install -Dpm0755 -t %{buildroot}%{_bindir} samples/bin/linux%{__isa_bits}/* +install -Dpm0644 -t %{buildroot}%{_datadir}/%{name} \ + samples/bin/*.json \ + samples/bin/cube_texture.png +install -Dpm0644 -t %{buildroot}%{_libdir}/%{name}/shaders \ + samples/bin/shaders/*.spv + +# Sample drivers have to be installed manually +install -Dpm0755 -t %{buildroot}%{_libdir}/%{name}/drivers \ + samples/drivers/%{_vpath_builddir}/drivers/*/libdriver_*.so + +# Fix runpath in samples and sample drivers +chrpath -d %{buildroot}%{_bindir}/* %{buildroot}%{_libdir}/%{name}/drivers/*.so +%endif + +%files api +%license LICENSE +%doc README.md +%{_libdir}/libopenvr_api.so.1{,.*} + +%files devel +%{_includedir}/%{name} +%{_datadir}/pkgconfig/%{name}.pc +%{_libdir}/libopenvr_api.so + +%files doc +%license LICENSE +%doc docs controller_callouts + +%if %{with samples} +%files samples +%license LICENSE +%{_bindir}/hellovr_opengl +%{_bindir}/hellovr_vulkan +%{_bindir}/helloworldoverlay +%{_bindir}/tracked_camera_openvr_sample +%{_datadir}/%{name}/ +%{_libdir}/%{name}/ +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..d495c28 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (openvr-1.26.7.tar.gz) = d1f4f3e1b3444a465f1e82e448928f4b14aef91bfdb87d2063df309b590a2e4f62e29b3ea42ee02451d18efe647814b5dabe1528134e0e0f9cf2e4aeb4cf97ee
arch-excludes@lists.fedoraproject.org