2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL, vulkan-loader, wayland, pkg-config }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openxr-loader";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.0.31";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "OpenXR-SDK-Source";
|
|
|
|
rev = "release-${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-qK8l/v6nLuMAitz7DfVDjJyVjEmkeD2jgJkG5qOMCcQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 pkg-config ];
|
|
|
|
buildInputs = [ libX11 libXxf86vm libXrandr vulkan-headers libGL vulkan-loader wayland ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
cmakeFlags = [ "-DBUILD_TESTS=ON" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "layers" ];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/KhronosGroup/OpenXR-SDK-Source/issues/305
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/loader/openxr.pc.in \
|
|
|
|
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$layers/share"
|
|
|
|
mv "$out/share/openxr" "$layers/share"
|
|
|
|
# Use absolute paths in manifests so no LD_LIBRARY_PATH shenanigans are necessary
|
|
|
|
for file in "$layers/share/openxr/1/api_layers/explicit.d/"*; do
|
|
|
|
substituteInPlace "$file" --replace '"library_path": "lib' "\"library_path\": \"$layers/lib/lib"
|
|
|
|
done
|
|
|
|
mkdir -p "$layers/lib"
|
|
|
|
mv "$out/lib/libXrApiLayer"* "$layers/lib"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Khronos OpenXR loader";
|
|
|
|
homepage = "https://www.khronos.org/openxr";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|