XR for Universal Blue and Fedora Atomic Desktops
vr fedora-atomic linux
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove Envision-OCI files

Envision-OCI is now a separate project and has been moved into its own repo.

-172
-35
ci/build-oci.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 4 - 5 - const axr = path self .. 6 - const registry = "registry.gitlab.com" 7 - const project = "matrixfurry/xr-packages" 8 - 9 - def main [ 10 - image: string # name of the image to build 11 - --username (-u): string 12 - --token (-t): string 13 - --no-login (-l) # Use this if the machine is already authenticated with the container registry 14 - ] { 15 - let username = $username | default $env.CI_REGISTRY_USERNAME? 16 - let token = $token | default $env.CI_REGISTRY_PASSWORD? 17 - let registry_image = [$registry $project $image] | str join '/' 18 - 19 - if ($username | is-empty) and not $no_login { 20 - error make { 21 - msg: "Username not provided" 22 - help: "Please provide a username with --username or $env.CI_REGISTRY_USERNAME" 23 - } 24 - } 25 - if ($token | is-empty) and not $no_login { 26 - error make { 27 - msg: "Token not provided" 28 - help: "Please provide a deployment token with --token or $env.CI_REGISTRY_PASSWORD" 29 - } 30 - } 31 - 32 - if not $no_login {podman login $registry -u $username -p $token} 33 - podman build -t $registry_image ($axr | path join "oci" $image) 34 - podman push $registry_image 35 - }
-36
envision-oci/pkg-install.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 4 - 5 - use std log 6 - 7 - def main [ 8 - --uninstall (-u) 9 - staged_path?: string 10 - ] { 11 - if not $uninstall { 12 - if ($staged_path | is-empty) { 13 - error make {msg: "please provide a path to the extracted archive"} 14 - } 15 - 16 - cd $staged_path 17 - log info $"Installing from (pwd)" 18 - 19 - chmod +x ./Envision-x86_64.AppImage 20 - ./Envision-x86_64.AppImage --appimage-extract 21 - 22 - open squashfs-root/org.gabmus.envision.Devel.desktop 23 - | str replace "Exec=envision" "Exec=sh -c 'export PATH=$HOME/.local/bin/envision-oci-shim:$PATH; exec envision --skip-dependency-check'" 24 - | save -f ~/.local/share/applications/org.gabmus.envision.Devel.desktop 25 - 26 - rm -rf ~/.local/bin/envision-oci-shim 27 - cp -r oci-shim ~/.local/bin/envision-oci-shim 28 - chmod 744 ~/.local/bin/envision-oci-shim/* 29 - 30 - cp -f squashfs-root/org.gabmus.envision.Devel.svg ~/.local/share/icons/hicolor/scalable/apps/org.gabmus.envision.Devel.svg 31 - } else { 32 - rm -f ~/.local/share/icons/hicolor/scalable/apps/org.gabmus.envision.Devel.svg 33 - rm -f ~/.local/share/applications/org.gabmus.envision.Devel.desktop 34 - rm -rf ~/.local/bin/envision-oci-shim 35 - } 36 - }
-41
envision-oci/pkg.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 4 - 5 - const axr = path self .. 6 - 7 - # Upload envision-oci package to GitLab for AtomicXR Homebrew 8 - def main [ 9 - job: int # envision GitLab job ID 10 - version: int # envision-oci package version 11 - token?: string # GitLab deploy token 12 - ] { 13 - cd (mktemp -dt) 14 - 15 - let token = $token | default $env.DEPLOY_TOKEN? 16 - if ($token | is-empty) { 17 - error make { 18 - msg: "Either --token or $env.DEPLOY_TOKEN is required" 19 - } 20 - } 21 - 22 - mkdir pkg 23 - cp ($axr | path join "envision-oci/pkg-install.nu") pkg/install.nu 24 - chmod 744 pkg/install.nu 25 - 26 - mkdir pkg/oci-shim 27 - cp ($axr | path join "envision-oci/shim.nu") pkg/oci-shim/cmake 28 - cp ($axr | path join "envision-oci/shim.nu") pkg/oci-shim/cargo 29 - chmod 744 pkg/oci-shim/* 30 - 31 - http get $"https://gitlab.com/gabmus/envision/-/jobs/($job)/artifacts/raw/Envision-x86_64.AppImage" 32 - | save -p pkg/Envision-x86_64.AppImage 33 - 34 - {envision_version: $job} | to json | save -p pkg/meta.json 35 - 36 - tar -C pkg -zcvf envision-oci.tar.gz . 37 - 38 - open --raw $"envision-oci.tar.gz" 39 - | into binary 40 - | http put --content-type application/gzip $"https://gitlab.com/api/v4/projects/75293878/packages/generic/envision-oci/($version)/envision-oci.tar.gz" -H {DEPLOY-TOKEN: $token} 41 - }
-42
envision-oci/shim.nu
··· 1 - #!/usr/bin/env nu 2 - # SPDX-License-Identifier: AGPL-3.0-only 3 - # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 4 - 5 - # The purpose of this shim is to make Envision build software in a OCI container, with preinstalled build dependencies. 6 - # Just rename this script to the desired build tool, then prepend it to Envision's PATH environment variable. It will 7 - # run instead of the system build tool. 8 - 9 - use std log 10 - 11 - const cmd = path self | path basename 12 - const image = "registry.gitlab.com/matrixfurry/xr-packages/xr-multi:latest" 13 - 14 - def main --wrapped [...args] { 15 - let args = $args | where ($it | is-not-empty) 16 - 17 - # HACK: I don't exactly know why the source path gets appended to the command line 18 - let last_as_workdir = $cmd == "cmake" and $args.0 == "-B" 19 - let workdir = if $last_as_workdir { 20 - $args | last 21 - } else { 22 - pwd 23 - } 24 - let args = if $last_as_workdir { 25 - $args | drop 1 26 - } else { 27 - $args 28 - } 29 - 30 - log info $"Working directory: ($workdir)" 31 - log info $"Running in OCI container via shim: ($cmd) ($args | str join ' ')" 32 - 33 - # TODO: Use image from AtomicXR container registry 34 - podman run ...[ 35 - --security-opt label=disable 36 - --security-opt apparmor=unconfined 37 - -v $"($env.HOME):($env.HOME)" 38 - --workdir $workdir 39 - --env=PWD=$workdir 40 - --rm 41 - ] $image $cmd ...$args 42 - }
-18
oci/xr-multi/Containerfile
··· 1 - # SPDX-License-Identifier: AGPL-3.0-only 2 - # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 3 - 4 - # OCI Container with pre-installed dependencies for building common XR apps 5 - # TODO: consider adding runtime stage for running built applications inside the container 6 - 7 - FROM fedora:latest AS builder 8 - 9 - # TODO WiVRn 10 - # TODO WiVRn Dashboard 11 - 12 - RUN dnf group install -y development-tools 13 - RUN dnf install -y \ 14 - envision-monado \ 15 - envision-xrizer \ 16 - onnxruntime-devel \ 17 - fmt-devel git-lfs glew-devel gtest-devel jq lz4-devel tbb-devel 18 - RUN dnf builddep -y opencomposite