···11+class Openxr < Formula
22+ desc "Cross-platform VR/AR runtime and API"
33+ homepage "https://khronos.org/openxr"
44+ url "https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.49.tar.gz"
55+ sha256 "207452a51ec9d730742c385adb5af21fb266fa7be8090b251f76c0bd2b433c61"
66+ license "Apache-2.0"
77+88+ depends_on "cmake" => :build
99+ depends_on "wayland-protocols" => :build
1010+ depends_on "libxcb" => :build
1111+ depends_on "gcc" => :build
1212+ depends_on "mesa" => :build
1313+ depends_on "vulkan-loader" => :build
1414+ depends_on "nushell" => :build
1515+1616+ def install
1717+ args = %w[
1818+ -DBUILD_ALL_EXTENSIONS=ON
1919+ -DBUILD_LOADER=ON
2020+ -DDYNAMIC_LOADER=ON
2121+ -DPRESENTATION_BACKEND=wayland
2222+ -DCMAKE_BUILD_TYPE=Release
2323+ -DBUILD_TESTS=OFF
2424+ -DBUILD_CONFORMANCE_TESTS=OFF
2525+ ]
2626+2727+ # HACK: temporarily disable fixincludes for pthread.h, see https://github.com/orgs/Homebrew/discussions/6193
2828+ system "nu", "-c", "ls /home/linuxbrew/.linuxbrew/Cellar/gcc/*/lib/gcc/current/gcc/x86_64-pc-linux-gnu/*/include-fixed/pthread.h | each {|file| mv $file.name $'($file.name).bak'}"
2929+ system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
3030+ system "cmake", "--build", "build"
3131+ system "cmake", "--install", "build"
3232+ system "nu", "-c", "ls /home/linuxbrew/.linuxbrew/Cellar/gcc/*/lib/gcc/current/gcc/x86_64-pc-linux-gnu/*/include-fixed/pthread.h.bak | each {|file| mv $file.name ($file.name | str substring 0..-5)}"
3333+ end
3434+3535+ test do
3636+ # `test do` will create, run in and delete a temporary directory.
3737+ #
3838+ # This test will fail and we won't accept that! For Homebrew/homebrew-core
3939+ # this will need to be a test that verifies the functionality of the
4040+ # software. Run the test with `brew test openxr`. Options passed
4141+ # to `brew install` such as `--HEAD` also need to be provided to `brew test`.
4242+ #
4343+ # The installed folder is not in the path, so use the entire path to any
4444+ # executables being tested: `system bin/"program", "do", "something"`.
4545+ system "false"
4646+ end
4747+end