diff --git a/README.md b/README.md index 1a2d001..37b0862 100644 --- a/README.md +++ b/README.md @@ -83,21 +83,118 @@ texture directly — no readback between the GPU and the screen. | Windows | `DarkRoom--x86_64-setup.exe`, cross-built by CI ([windows.md](docs/dev/windows.md)) | Verified under Wine only; unsigned | | Flatpak | [`packaging/flatpak/`](packaging/flatpak/) | Manifest in tree; folders are chosen through the portal, but no Flatpak has been built to prove it | -Or build it. Git LFS is required for the model weights, and the toolchain -pins itself to 1.92.0: +## Building from source + +**Before anything.** Git LFS holds the model weights and the manual's +pictures; a clone without it has ~130-byte pointers in their place, and every +packager below refuses to ship one. The Rust toolchain pins itself to 1.92.0 +through `rust-toolchain.toml`, so rustup is all you install. Slint needs a few +system headers, and the app needs a Vulkan driver at runtime: ```bash +git clone https://gitea.tourolle.paris/dtourolle/DarkRoom.git && cd DarkRoom git lfs install && git lfs pull + +# Debian / Ubuntu +sudo apt-get install pkg-config libfontconfig1-dev libxkbcommon-dev libvulkan1 +# Arch +sudo pacman -S --needed pkgconf fontconfig libxkbcommon vulkan-icd-loader +``` + +**To try it** from the checkout, without installing anything: + +```bash cargo run --release -p darkroom-desktop ``` -Android, through the containerised toolchain ([docker/android](docker/android/README.md)): +This is for development. The binary under `target/` finds no face, scene or +panorama-fill models, and a release build does not find the manual either: +it looks for all of them in the system data directories an install creates +(`$XDG_DATA_DIRS/darkroom`, by default `/usr/local/share/darkroom` and +`/usr/share/darkroom`), never in the checkout. Those features show as +unavailable until it is installed. + +### Linux: build and install + +**On Arch**, build a package from the checkout and install it with pacman, +so it can be upgraded and removed like any other: ```bash -./docker/android/build.sh cargo ndk -t arm64-v8a build --release +cd packaging && makepkg -si ``` -[CONTRIBUTING.md](CONTRIBUTING.md) has the system packages, the four +**Elsewhere**, build the release binary and install it under `/usr/local` +by hand. These are the same files, in the same places, as the Arch package +([`packaging/PKGBUILD`](packaging/PKGBUILD)'s `package()` is the reference): + +```bash +cargo build --release --locked -p darkroom-desktop +# -> target/release/darkroom-desktop + +P=/usr/local +sudo install -Dm755 target/release/darkroom-desktop $P/bin/darkroom-desktop + +# The models: faces and eye state, scene categories, panorama border fill +sudo install -d $P/share/darkroom/models +sudo install -m644 models/face/*.onnx models/scene/* models/inpaint/*.onnx \ + $P/share/darkroom/models/ + +# The offline manual the Help menu opens +sudo install -Dm644 docs/manual/index.html $P/share/darkroom/manual/index.html +sudo install -Dm644 -t $P/share/darkroom/manual/media docs/manual/media/* + +# Launcher entry, icon and software-centre description +sudo install -Dm644 packaging/paris.tourolle.darkroom.desktop \ + $P/share/applications/paris.tourolle.darkroom.desktop +sudo install -Dm644 ui/dr-ui/ui/app-icon.png \ + $P/share/icons/hicolor/256x256/apps/paris.tourolle.darkroom.png +sudo install -Dm644 packaging/paris.tourolle.darkroom.metainfo.xml \ + $P/share/metainfo/paris.tourolle.darkroom.metainfo.xml +``` + +Then run `darkroom-desktop`, or open it from the application menu. To +uninstall, remove those files and `/usr/local/share/darkroom`. Your catalog, +settings and thumbnails live in `darkroom/` under your own XDG data, config +and cache directories (`~/.local/share`, `~/.config`, `~/.cache`) and are +not touched by either. + +Optional at runtime: `gnome-keyring` or `kwallet` to remember Nextcloud +credentials, and an ONNX Runtime in `/usr/lib` (CPU, or ROCm on an AMD GPU) to +run the models on every core rather than on the built-in engine. + +### Windows: build the installer + +The `.exe` is cross-built from Linux in a container (podman or docker), with +no Windows machine involved. Two steps — the executable, then the NSIS +installer that carries it with its models and manual: + +```bash +./docker/windows/build.sh cargo build --release --target x86_64-pc-windows-gnu -p darkroom-desktop +./docker/windows/build.sh docker/windows/package.sh +``` + +Both land in the container's cache on the host, `~/.cache/darkroom-windows/target/`: +the bare executable under `x86_64-pc-windows-gnu/release/darkroom-desktop.exe`, +the installer under `installer/DarkRoom--x86_64-setup.exe`. +Copy that to the Windows machine and run it — it installs per user, needs no +administrator rights, and adds an uninstaller. Run on its own, the bare +`.exe` looks for `models\` and `manual\` beside itself, so use the installer. +[docker/windows](docker/windows/README.md) has the details. + +### Android: build the APK + +Also containerised ([docker/android](docker/android/README.md)). This +builds, packages and debug-signs the APK, and with `--install` puts it on a +device connected over adb: + +```bash +./docker/android/package.sh --install +``` + +A debug-signed APK cannot replace one installed from a release; uninstall +that first. + +[CONTRIBUTING.md](CONTRIBUTING.md) has the four commands CI runs against what you send, and the shortest useful contribution — a develop operation is one YAML file, and it arrives with its controls, its place in the chain and its tests.