Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| lwc:flatpak:arsandbox [2025/12/23 17:21] – created John Harrison | lwc:flatpak:arsandbox [2025/12/26 10:12] (current) – John Harrison | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Creating and Using a flatpak of arsandbox ===== | ===== Creating and Using a flatpak of arsandbox ===== | ||
| + | ==== Debug ==== | ||
| + | === Fail and check === | ||
| + | < | ||
| + | flatpak-builder --run build-dir-arsandbox org.arsandboxg.ARSandbox.yml sh | ||
| + | </ | ||
| + | the '' | ||
| + | Now you can look around to figure out where files are so you can add the right stuff to the yml file | ||
| + | //When debugging '' | ||
| + | |||
| + | === Offline === | ||
| + | opening another terminal window after the fail and '' | ||
| + | |||
| + | ==== Create ==== | ||
| + | <hidden heavily commented yaml file: org.arsandboxg.ARSandbox.yml> | ||
| + | < | ||
| + | # yml for flatpak | ||
| + | # v1.0 John Harrison john.harrison@alum.mit.edu Dec-2025 | ||
| + | |||
| + | # prep for flatpak: | ||
| + | # sudo apt install flatpak flatpak-builder | ||
| + | # flatpak install flathub org.freedesktop.Platform// | ||
| + | |||
| + | # to create: flatpak-builder --repo=repo --force-clean --state-dir=build-cache-arsandbox build-dir-arsandbox org.arsandboxg.ARSandbox.yml | ||
| + | # then bundle as one file: flatpak build-bundle repo arsandbox_g.flatpak org.arsandboxg.ARSandbox | ||
| + | |||
| + | app-id: org.arsandboxg.ARSandbox | ||
| + | runtime: org.freedesktop.Platform | ||
| + | runtime-version: | ||
| + | sdk: org.freedesktop.Sdk | ||
| + | command: SARndbox | ||
| + | |||
| + | finish-args: | ||
| + | - --share=ipc | ||
| + | - --socket=x11 | ||
| + | - --socket=wayland | ||
| + | - --device=all | ||
| + | - --filesystem=host # allows file write to host filesystem so we can save config files | ||
| + | |||
| + | build-options: | ||
| + | env: | ||
| + | # where will we find the .pc (package config) files? | ||
| + | |||
| + | # / | ||
| + | # these map to the flatpak SDK i.e. / | ||
| + | # ~/ | ||
| + | |||
| + | # / | ||
| + | # is required for libusb and vrui since those are built as part of the flatpak | ||
| + | # when builds fail look for the .pc files inside this flatpak files directory | ||
| + | PKG_CONFIG_PATH: | ||
| + | |||
| + | modules: | ||
| + | - name: libusb | ||
| + | buildsystem: | ||
| + | # this basically means we follow the pattern: ./configure && make && make install | ||
| + | config-opts: | ||
| + | - --prefix=/ | ||
| + | # which doesn' | ||
| + | - --disable-static | ||
| + | sources: | ||
| + | - type: git | ||
| + | url: https:// | ||
| + | tag: v1.0.26 | ||
| + | |||
| + | - name: vrui | ||
| + | buildsystem: | ||
| + | build-commands: | ||
| + | # Run config to generate Config.h files: | ||
| + | # libusb was installed in /app (see above) | ||
| + | # libext defaults to /lib64 on 64 bit systems but flatpak uses /lib. libext is a custom name in vrui | ||
| + | # you can find that custom name in BuildRoot/ | ||
| + | # installdir is boilerplate. Put everything in /app | ||
| + | # SYSTEM_HAVE_LIBDBUS was to fix a comopiler error. This was used to inhibit the screensaver only | ||
| + | # so it seemed not worth trying to fix the compiler error for this | ||
| + | - make config LIBUSB1_BASEDIR=/ | ||
| + | |||
| + | # Disable DC1394 (FireWire camera) support since it was giving errors in compile and we didn't need 1394. | ||
| + | - sed -i ' | ||
| + | - sed -i ' | ||
| + | |||
| + | # Build | ||
| + | - make -j${FLATPAK_BUILDER_N_JOBS} LIBUSB1_BASEDIR=/ | ||
| + | |||
| + | # Install | ||
| + | - make install LIBUSB1_BASEDIR=/ | ||
| + | | ||
| + | sources: | ||
| + | - type: git | ||
| + | url: https:// | ||
| + | branch: main | ||
| + | |||
| + | - name: kinect | ||
| + | buildsystem: | ||
| + | # figure out the below make flags with `flatpak-builder --run build-dir-arsandbox org.arsandboxg.ARSandbox.yml sh` | ||
| + | build-commands: | ||
| + | - make VRUI_MAKEDIR=/ | ||
| + | - make install VRUI_MAKEDIR=/ | ||
| + | sources: | ||
| + | - type: git | ||
| + | url: https:// | ||
| + | branch: main | ||
| + | |||
| + | - name: arsandbox | ||
| + | buildsystem: | ||
| + | build-commands: | ||
| + | # Run config first to generate Config.h | ||
| + | - make config VRUI_MAKEDIR=/ | ||
| + | | ||
| + | # Patch Config.h to use dynamic configuration directory AND copy defaults if missing | ||
| + | # if would be better if code was fix but for now we "soft patch" | ||
| + | # note use of - l for list so yaml parser doesn' | ||
| + | - | | ||
| + | sed -i '1i #include < | ||
| + | - sed -i ' | ||
| + | |||
| + | # Patch Water2WaterUpdateShader.fs to fix read-only variable assignment | ||
| + | # really this should be fixed in the source code as well | ||
| + | - sed -i ' | ||
| + | - sed -i ' | ||
| + | - sed -i ' | ||
| + | |||
| + | # Build and Install | ||
| + | - make VRUI_MAKEDIR=/ | ||
| + | - make install VRUI_MAKEDIR=/ | ||
| + | sources: | ||
| + | - type: git | ||
| + | url: https:// | ||
| + | branch: main</ | ||
| + | </ | ||
| + | === Create the repo === | ||
| + | < | ||
| + | flatpak-builder --repo=repo --force-clean --state-dir=build-cache-arsandbox build-dir-arsandbox org.arsandboxg.ARSandbox.yml | ||
| + | </ | ||
| + | - put the finished build in a folder called '' | ||
| + | - do not use any part of any previous build | ||
| + | - provide a cache folder so flatpak-builder doesn' | ||
| + | - give a temp directory for the build | ||
| + | |||
| + | === bundle the repo as one file === | ||
| + | < | ||
| + | flatpak build-bundle repo arsandbox_g.flatpak org.arsandboxg.ARSandbox | ||
| + | </ | ||
| + | - the name of file | ||
| + | - app ID | ||
| + | |||
| ==== Give user permission to access Kinect ==== | ==== Give user permission to access Kinect ==== | ||
| < | < | ||
| Line 26: | Line 171: | ||
| </ | </ | ||
| - | * Run Calibrate | + | * Run Calibrate |
| - | * flatpak run --command=RawKinectViewer org.arsandboxg.ARSandbox | + | * See what the Kinect sees: '' |
| - | * | + | * Run: '' |
| + | * Run "low spec mode": '' | ||