3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/openxr-loader/default.nix

41 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL }:
2019-08-09 02:53:19 +01:00
stdenv.mkDerivation rec {
pname = "openxr-loader";
2020-06-06 15:42:51 +01:00
version = "1.0.9";
2019-08-09 02:53:19 +01:00
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "OpenXR-SDK-Source";
rev = "release-${version}";
2020-06-06 15:42:51 +01:00
sha256 = "0xm5bwbsv2qlx1mg9zr98q7rm5hginrff4z0ahv7jrqrzv24acp7";
2019-08-09 02:53:19 +01:00
};
nativeBuildInputs = [ cmake python3 ];
buildInputs = [ libX11 libXxf86vm libXrandr vulkan-headers libGL ];
2019-08-09 02:53:19 +01:00
enableParallelBuilding = true;
cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
outputs = [ "out" "dev" "layers" ];
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"
'';
meta = with stdenv.lib; {
description = "Khronos OpenXR loader";
homepage = "https://www.khronos.org/openxr";
2019-08-09 02:53:19 +01:00
platforms = platforms.linux;
license = licenses.asl20;
maintainers = [ maintainers.ralith ];
};
}