From cb4c08b09163bd5a60a21f56bcc81296d859418b Mon Sep 17 00:00:00 2001 From: Bruno Herfst Date: Wed, 22 Apr 2026 21:20:57 +1000 Subject: [PATCH 1/2] init_install --- README.md | 99 +++++------------------ docs/OF_RASP.md | 71 ++++++++++++++++ scripts/install_ofrasp_deps.sh | 98 ++++++++++++++++++++++ scripts/install_spine.sh | 117 +++++++++++++++++++++++++++ scripts/msys2/install_ofrasp_deps.sh | 79 ++++++++++++++++++ scripts/ofrasp/deps_common.sh | 47 +++++++++++ 6 files changed, 434 insertions(+), 77 deletions(-) create mode 100644 docs/OF_RASP.md create mode 100644 scripts/install_ofrasp_deps.sh create mode 100644 scripts/install_spine.sh create mode 100644 scripts/msys2/install_ofrasp_deps.sh create mode 100644 scripts/ofrasp/deps_common.sh diff --git a/README.md b/README.md index 4961160465e..d81f2592f3a 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,32 @@ -[openFrameworks](http://openframeworks.cc/) -================ +# ofRasp -openFrameworks is a C++ toolkit for creative coding. If you are new to OF, welcome! +*openFrameworks with Edit mode. Pi-native. Web-native.* -- [Grab the Nightly Release (to avoid submodule cloning)](https://github.com/openframeworks/openFrameworks/releases) -- [Setup guides for different Platforms](https://openframeworks.cc/download/) -- [Join Our Slack](https://join.slack.com/t/openframeworks/shared_invite/zt-1r2brqms0-dZMMFZgZhFTgomjJ0vlCjA) -- [Discuss on the Forum](https://forum.openframeworks.cc) -- [Follow OF on Mastodon](https://fosstodon.org/@openframeworks) +This repo is a distribution of [openFrameworks](https://openframeworks.cc/) aimed at **always-on Edit mode**, **Raspberry Pi**, and the **web**. The toolkit is still openFrameworks: `ofApp`, `ofMain.h`, and the addon ecosystem behave the same way. -## Build status +**→ [More Info, pillars, non-goals, and status](docs/OF_RASP.md)** -* The **master** branch contains the newest, most recently updated code. This code is packaged and available for download in the "Nightly Builds" section of [openframeworks.cc/download](https://openframeworks.cc/download/). -* The **stable** branch contains the code corresponding to the last stable openFrameworks release. This stable code is packaged and available for download at [openframeworks.cc/download](https://openframeworks.cc/download/). +## Quick start -Platform | Master branch | Stable branch ------------------------------|:---------|:--------- -Windows MSYS2 | [![Build status](https://github.com/openframeworks/openFrameworks/workflows/build-msys2/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![Build status](https://github.com/openframeworks/openFrameworks/workflows/build-msys2/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) -Windows Visual Studio | [![Build status](https://github.com/openframeworks/openFrameworks/workflows/build-vs/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![Build status](https://github.com/openframeworks/openFrameworks/workflows/build-vs/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) -Linux 64 & Arm | [![Linux Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-linux64-and-arm/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![Linux Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-linux64-and-arm/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) -Emscripten | [![Emscripten Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-emscripten/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![Emscripten Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-emscripten/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) -macos | [![macos Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-macos/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![macos Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-macos/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) -iOS & tvOS | [![iOS tvOS Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-ios-tvos/badge.svg)](https://github.com/openframeworks/openFrameworks/actions) | [![iOS tvOS Build Status](https://github.com/openframeworks/openFrameworks/workflows/build-ios-tvos/badge.svg?branch=stable)](https://github.com/openframeworks/openFrameworks/actions) +1. Clone the repository. The **default branch is `ofrasp`** (ofRasp development). You can still switch to **stock openFrameworks** in this fork with `git checkout master` (branch name may differ; use `git branch -a`). +2. **Dependencies + ofRasp fixups** (works on **Windows, macOS, Linux / Raspberry Pi**): from the repo root run + `bash ./scripts/install_ofrasp_deps.sh` + - **MSYS2 UCRT64:** installs `pacman` packages for OF + clones **`addons/ofxFft`** (kissfft for the sound code path) and vendors **`addons/ofxLibTess2/libtess2`**. Add **`ofxLibTess2`** to your app’s `addons.make` so tessellator symbols link. + - **macOS / Linux:** prints which upstream `scripts/linux/.../install_dependencies.sh` (or Xcode / OF docs) to use, then runs the same **ofxFft** + **libtess2** fixups. If you already installed OF system packages, use `bash ./scripts/install_ofrasp_deps.sh --fixups-only`. +3. **Spine addons** (ofRasp forks — ImGui, FFT, EnTT): + `bash ./scripts/install_spine.sh` + Clones or updates `addons/ofxImGui`, `addons/ofxFft`, `addons/ofxEnTT` from `https://github.com/ofrasp/`. Edit `SPINE_REPOS` in that script to add more. +4. Build sketches with the usual [openFrameworks setup](https://openframeworks.cc/download/) flow for your platform. More context: **[docs/OF_RASP.md](docs/OF_RASP.md)**. - +## Relationship to upstream +- **Upstream source tree:** [openframeworks/openFrameworks](https://github.com/openframeworks/openFrameworks) +- **Sync:** add `upstream`, `git fetch upstream`, merge or rebase as you prefer. +- **Stock OF readme** (badges, folder tour, community links): + [github.com/openframeworks/openFrameworks/blob/master/README.md](https://github.com/openframeworks/openFrameworks/blob/master/README.md) +Contributing conventions in this tree still follow **[CONTRIBUTING.md](CONTRIBUTING.md)** where they apply; ofRasp-specific work is discussed on **this fork’s** issues and PRs. -## folder structure +## License -This release of OF comes with several folders: - -* addons -* apps -* docs -* examples -* export (on some systems) -* libs -* other -* scripts -* projectGenerator - - -`docs` has some documentation around OF usage, per platform things to consider, etc. You should definitely take a look in there; for example, if you are on OSX, read the osx.md. `apps` and `examples` are where projects go -- `examples` contains a variety of projects that show you how to use OF, and `apps` is where your own projects will go. `libs` contains the libraries that OF uses, including the openframeworks core itself. `addons` are for additional functionality that's not part of the core. `export` is for DLLs and dylibs that need to be put in each compiled project. The `scripts` folder has the templates and small scripts for automating OF per platform. `project generator` is a GUI based tool for making new projects - this folder is only there in packaged releases. - -One idea that's important is that OF releases are designed to be self-contained. You can put them anywhere on your hard drive, but it's not possible to mix different releases of OF together, so please keep each release (0.8.0, 0.8.1) separate. Projects may generally work from release to release, but this is not guaranteed. Because OF is self-contained, there's extensive use of local file paths (ie, ../../../) throughout OF. It's important to be aware of how directories are structured. A common error is to take a project and move it so that it's a level below or above where it used to be compared to the root of OF. This means that links such as ../../../libs will break. - -## Get involved - -The openframeworks forum: - -[http://forum.openframeworks.cc/](http://forum.openframeworks.cc/) - -is a warm and friendly place. Please ask or answer a question. The most important part of this project is that it's a community, more than just a tool, so please join us! Also, this is free software, and we learn so much about what is hard, what doesn't make sense, what is useful, etc. The most basic questions are acceptable here! Don't worry, just join the conversation. Learning in OF is social, it's hard to do it alone, but together we can get far! - -Our GitHub site is active: - -[https://github.com/openframeworks/openFrameworks](https://github.com/openframeworks/openFrameworks) - -if you have bugs or feature requests, consider opening an issue. If you are a developer and want to help, pull requests are warmly welcome. Please read the contributing guide for guidelines: - -[https://github.com/openframeworks/openFrameworks/blob/master/CONTRIBUTING.md](https://github.com/openframeworks/openFrameworks/blob/master/CONTRIBUTING.md -) - -We also have a developer's mailing list, which is useful for discussing issues around the development and future of OF. - -## Developers - -To grab a copy of openFrameworks for your platform, check the [download page](http://openframeworks.cc/download) on the main site. - -If you are working with the Git repository, the `stable` branch of the OF repository corresponds to the most recent release, with a few important differences: - -1. The release includes a simple openFrameworks project generator. -2. This GitHub repository contains code and libs for all the platforms, but the releases are done on a per-platform basis. -3. This GitHub repository has no project files for the different examples. They are generated automatically for each release using a tool in `apps/projectGenerator/`. -4. There are no external dependencies in this repository, you can download them using the download_libs.sh script for each platform in the particular platform folder inside scripts. - -If you want to work with the openFrameworks GitHub repository, you need to download the external dependencies and you should use the project generator to create project files for all the code in `examples/`. To generate the project files with the project generator enable the 'Advanced Options' in the settings tab, then use 'Update Multiple' to update the projects for the `examples/` folder path in the repo. - -To set up the project generator submodule within the OF repo, use the command `git submodule init` then `git submodule update` whilst inside the openFrameworks repo. - -For more info on working with the Project Generator, for per-platform readmes, and more information, see the [documentation](docs/table_of_contents.md). - -## Versioning - -openFrameworks uses [Semantic Versioning](http://semver.org/), although strict adherence will only come into effect at version 1.0.0. +MIT — see **[LICENSE.md](LICENSE.md)** (same as upstream openFrameworks). diff --git a/docs/OF_RASP.md b/docs/OF_RASP.md new file mode 100644 index 00000000000..7d2d02ba859 --- /dev/null +++ b/docs/OF_RASP.md @@ -0,0 +1,71 @@ +# ofRasp + +*openFrameworks with Edit mode. Pi-native. Web-native.* + +> A long-running branch of [openFrameworks](http://openframeworks.cc) that prioritizes always-on editing. + +## What is this? + +ofRasp **is openFrameworks.** Your sketches compile unchanged — `ofApp`, `ofMain.h`, every `ofx`* addon still works the same way. + +## Bootstrap (vendored addons in `addons/`) + +To keep clean with upstream ... + +Run **`./scripts/install_ofrasp_deps.sh`** from the repo root. Besides OS-specific package hints, it clones **`addons/ofxFft`** (kissfft sources used by the core sound path) and vendors **`addons/ofxLibTess2/libtess2`**. The **`ofxLibTess2`** folder in this repo holds `addon_config.mk`; add **`ofxLibTess2`** to your project’s **`addons.make`** so Makefile builds link libtess2 with `ofTessellator`. Then run **`./scripts/install_spine.sh`** for ofRasp-pinned forks (ImGui, EnTT, ofxFft etc.). + +## Edit mode + +Every sketch ships with always-on editor. While your sketch is running, hit `Ctrl-E` to see: + +- **Nodes** panel listing every entity in the scene +- **Properties** panel to scrub any `ofParameter`, position, color, radius, or other reflected field +- **Viewport** gizmo for direct manipulation +- **Toolbar** with your app name and menu hooks + +Hit `Ctrl-E` again and the editor disappears — your sketch is a clean render again, frame-perfect, zero overhead. +It's what Unity calls Play/Edit, what Max/MSP calls locked/unlocked. + +## The three pillars + +### 1. Edit mode + +The reflection plumbing that powers ofRasp is an EnTT. The intent is that *every* future OF-style sketch shipped on ofRasp is editable by its author (or viewer) without writing a line of GUI code. + +### 2. Pi-native + +Upstream OF's Raspberry Pi support has drifted. ofRasp tries to keep Pi as a first-class target: GLES3 renderer maintained, headless-friendly build paths, reproducible one-command setup on a fresh Raspberry Pi OS install. Pi is the smallest full-stack Edit-mode machine we can ship. + +### 3. Web-native + +The long arc: ofrasp.com itself runs as an ofRasp sketch under Emscripten. + +## No-goals (things we will deliberately remove) + +- **No projectGenerator.** Every example ships a single project-agnostic `build.sh` that derives the project name from its own folder. + +- **No apothecary.** We rely on platform package managers — MSYS2 `pacman`, `apt`, Homebrew, `vcpkg` — for dependencies. `install_dependencies.sh` wires this up for you. + +## Relationship to upstream openFrameworks + +We send fixes that make sense upstream back as PRs. ofRasp-specific changes (Edit mode core, build system, ImGui-in-core) stay on this branch. However most of it will be in seperate addons. + +If you want stock openFrameworks: `git checkout master`. If you want ofRasp: `git checkout ofrasp` + +## Status + +Early. Interface is unstable — in particular, the exact API for how Edit mode plugs into a sketch is still in flux. The compatibility promise for upstream OF code is stable. + +## License + +MIT, same as upstream openFrameworks. See [LICENSE.md](../LICENSE.md). + +## Contact + +- **Website:** [ofrasp.com](https://ofrasp.com) +- **Upstream:** [openframeworks.cc](http://openframeworks.cc) — everything OF's forum/Slack/docs say is still true here. +- **Issues / discussion:** on this fork's GitHub repo. + +--- + +*ofRasp is an unofficial fork. Not affiliated with or endorsed by the openFrameworks project. openFrameworks is the work of many people over many years; ofRasp stands on their shoulders.* diff --git a/scripts/install_ofrasp_deps.sh b/scripts/install_ofrasp_deps.sh new file mode 100644 index 00000000000..8320b2e8385 --- /dev/null +++ b/scripts/install_ofrasp_deps.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# install_ofrasp_deps.sh +# +# Platform-aware ofRasp dependency helper (openFrameworks repo root). +# +# Windows (MSYS2 UCRT64): full pacman install + shared fixups (ofxFft, ofxLibTess2/libtess2) +# macOS: prints OF setup pointers + runs shared fixups only +# Linux (incl. Raspberry Pi): prints distro install pointers + runs fixups only +# +# System packages on macOS / Linux are not fully automated here — use upstream +# OF scripts for your OS (same as stock openFrameworks), then run this script. +# +# Usage (always from openFrameworks repo root): +# ./scripts/install_ofrasp_deps.sh +# ./scripts/install_ofrasp_deps.sh --fixups-only +# +# --fixups-only : only clone ofxFft / vendor libtess2 under addons/ofxLibTess2 (no pacman) +# beyond needing bash + git). Safe on any OS after OF deps exist. +# ----------------------------------------------------------------------------- + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +OF_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +export OF_ROOT + +FIXUPS_ONLY=0 +if [[ "${1:-}" == "--fixups-only" ]] || [[ "${1:-}" == "-F" ]]; then + FIXUPS_ONLY=1 +fi + +# shellcheck source=scripts/ofrasp/deps_common.sh +source "${SCRIPT_DIR}/ofrasp/deps_common.sh" + +if [[ "${FIXUPS_ONLY}" -eq 1 ]]; then + ofrasp_deps_run_fixups + echo + echo "=== Fixups done. Next: ./scripts/install_spine.sh ===" + exit 0 +fi + +uname_s="$(uname -s 2>/dev/null || echo unknown)" + +# MSYS2 / MinGW: full installer lives next to this file +case "${uname_s}" in + MINGW* | MSYS* | CYGWIN*) + if [[ -n "${MINGW_PACKAGE_PREFIX:-}" ]] && [[ -n "${MINGW_PREFIX:-}" ]]; then + exec "${SCRIPT_DIR}/msys2/install_ofrasp_deps.sh" + fi + echo "NOTE: MSYS2 UCRT64 shell not detected (MINGW_* unset)." >&2 + echo " For full Windows deps, open 'MSYS2 UCRT64' and run:" >&2 + echo " ${SCRIPT_DIR}/msys2/install_ofrasp_deps.sh" >&2 + echo " Running ofRasp fixups only (ofxFft, tess2)..." >&2 + ofrasp_deps_run_fixups + echo + echo "=== Next: open MSYS2 UCRT64 for pacman deps, then ./scripts/install_spine.sh ===" + exit 0 + ;; +esac + +case "${uname_s}" in + Darwin) + echo "=== macOS ===" + echo "Install Xcode Command Line Tools (xcode-select --install) and follow:" + echo " https://openframeworks.cc/download/" + echo "Use OF’s macOS project templates / download_libs.sh as documented upstream." + echo + ofrasp_deps_run_fixups + echo + echo "=== Next: ./scripts/install_spine.sh ===" + ;; + Linux) + echo "=== Linux (includes Raspberry Pi OS) ===" + echo "Install openFrameworks system packages for your distro (same as upstream OF), e.g.:" + if command -v apt-get >/dev/null 2>&1; then + echo " sudo ${SCRIPT_DIR}/linux/debian/install_dependencies.sh" + echo " # or: sudo ${SCRIPT_DIR}/linux/ubuntu/install_dependencies.sh" + elif command -v dnf >/dev/null 2>&1; then + echo " sudo ${SCRIPT_DIR}/linux/fedora/install_dependencies.sh" + elif command -v pacman >/dev/null 2>&1 && [[ -f /etc/arch-release ]]; then + echo " ${SCRIPT_DIR}/linux/archlinux/install_dependencies.sh (see script for sudo)" + else + echo " See scripts/linux// in this repo." + fi + echo + ofrasp_deps_run_fixups + echo + echo "=== Next: ./scripts/install_spine.sh ===" + ;; + *) + echo "=== Unknown OS: ${uname_s} ===" >&2 + echo "Running fixups only (ofxFft, tess2). Install OF system deps manually." >&2 + ofrasp_deps_run_fixups + echo + echo "=== Next: ./scripts/install_spine.sh ===" + ;; +esac diff --git a/scripts/install_spine.sh b/scripts/install_spine.sh new file mode 100644 index 00000000000..6b968870be8 --- /dev/null +++ b/scripts/install_spine.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# install_spine.sh +# +# Clone or update the ofRasp "spine" addons into /addons. +# Default remote: https://github.com/ofrasp/.git +# +# Requires: git, bash +# Works from: MSYS2 UCRT64, Linux, macOS, WSL (anywhere git works). +# +# Usage (from openFrameworks repo root): +# ./scripts/install_spine.sh +# ./scripts/install_spine.sh --full # full clone (no --depth) +# +# Override org or URLs: +# OFRASP_ORG=myfork ./scripts/install_spine.sh +# OFRASP_GIT_BASE=https://github.com/ofrasp ./scripts/install_spine.sh +# +# Add or remove repos by editing SPINE_REPOS below. +# ----------------------------------------------------------------------------- + +set -euo pipefail + +OF_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +ADDONS_DIR="${OF_ROOT}/addons" +ORG="${OFRASP_ORG:-ofrasp}" +GIT_BASE="${OFRASP_GIT_BASE:-https://github.com/${ORG}}" +DEPTH_ARG=(--depth 1) +DO_PULL=1 + +usage() { + cat <<'EOF' +Usage: ./scripts/install_spine.sh [--full] [--no-pull] + + --full Full clone (omit --depth 1) + --no-pull Skip git pull on existing clones + +Environment: + OFRASP_ORG GitHub org or user (default: ofrasp) + OFRASP_GIT_BASE e.g. https://github.com/ofrasp (overrides org-based URL) + +Edit SPINE_REPOS in this script to add spine addons. +EOF +} + +while [[ $# -gt 0 ]]; do + case "$1" in + -h | --help) + usage + exit 0 + ;; + --full) + DEPTH_ARG=() + shift + ;; + --no-pull) + DO_PULL=0 + shift + ;; + *) + echo "Unknown option: $1 (try --help)" >&2 + exit 1 + ;; + esac +done + +# GitHub repo name = folder name under addons/ (OF convention). +SPINE_REPOS=( + ofxImGui + ofxFft + ofxEnTT +) + +if [[ ${#DEPTH_ARG[@]} -eq 0 ]]; then + depth_note="full clone (no --depth)" +else + depth_note="${DEPTH_ARG[*]}" +fi + +echo "=== ofRasp spine addons ===" +echo " OF_ROOT = ${OF_ROOT}" +echo " ADDONS_DIR = ${ADDONS_DIR}" +echo " GIT_BASE = ${GIT_BASE}" +echo " depth = ${depth_note}" +echo + +mkdir -p "${ADDONS_DIR}" + +for repo in "${SPINE_REPOS[@]}"; do + dest="${ADDONS_DIR}/${repo}" + url="${GIT_BASE}/${repo}.git" + + if [[ -d "${dest}/.git" ]]; then + if [[ "${DO_PULL}" -eq 1 ]]; then + echo ">>> ${repo}: existing clone — updating (ff-only)" + git -C "${dest}" fetch --tags --prune origin + head_branch="$(git -C "${dest}" rev-parse --abbrev-ref HEAD)" + git -C "${dest}" pull --ff-only origin "${head_branch}" || { + echo " WARN: ff-only pull failed for ${repo}; resolve manually in ${dest}" >&2 + } + else + echo ">>> ${repo}: existing clone — skipped (--no-pull)" + fi + continue + fi + + if [[ -e "${dest}" ]]; then + echo "ERROR: ${dest} exists but is not a git repo; move it aside or remove it." >&2 + exit 1 + fi + + echo ">>> ${repo}: cloning ${url}" + git clone "${DEPTH_ARG[@]}" "${url}" "${dest}" +done + +echo +echo "=== Done. Spine addons are under: ${ADDONS_DIR} ===" diff --git a/scripts/msys2/install_ofrasp_deps.sh b/scripts/msys2/install_ofrasp_deps.sh new file mode 100644 index 00000000000..77062bc4e6c --- /dev/null +++ b/scripts/msys2/install_ofrasp_deps.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# install_ofrasp_deps.sh (MSYS2 / MinGW entry) +# +# Full pacman install for Windows MSYS2 UCRT64. Normally invoked via: +# ./scripts/install_ofrasp_deps.sh +# which detects MSYS2 and execs this script. +# +# Direct usage (MSYS2 UCRT64 shell only): +# ./scripts/msys2/install_ofrasp_deps.sh +# +# See also: scripts/ofrasp/deps_common.sh (shared ofxFft + ofxLibTess2/libtess2) +# ----------------------------------------------------------------------------- + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +OF_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" +export OF_ROOT + +# shellcheck source=scripts/ofrasp/deps_common.sh +source "${SCRIPT_DIR}/../ofrasp/deps_common.sh" + +# --- sanity checks ----------------------------------------------------------- + +if [[ -z "${MINGW_PACKAGE_PREFIX:-}" ]]; then + echo "ERROR: \$MINGW_PACKAGE_PREFIX is not set." >&2 + echo " Open the 'MSYS2 UCRT64' shell and re-run (not plain MSYS)." >&2 + exit 1 +fi + +if [[ -z "${MINGW_PREFIX:-}" ]]; then + echo "ERROR: \$MINGW_PREFIX is not set." >&2 + exit 1 +fi + +echo "=== Environment ===" +echo " MSYSTEM = ${MSYSTEM:-?}" +echo " MINGW_PACKAGE_PREFIX = ${MINGW_PACKAGE_PREFIX}" +echo " MINGW_PREFIX = ${MINGW_PREFIX}" +echo + +# --- packages ---------------------------------------------------------------- + +msys_pkgs=( + make + unzip + git +) + +mingw_pkgs=( + gcc + pkgconf + assimp cairo curl freeimage + glew glfw glm fmt zlib brotli libpng + harfbuzz libsndfile libusb libxml2 mpg123 + nlohmann-json openal opencv + pugixml rtaudio uriparser utf8cpp + ntldd-git +) + +full_pkgs=("${msys_pkgs[@]}") +for p in "${mingw_pkgs[@]}"; do + full_pkgs+=("${MINGW_PACKAGE_PREFIX}-${p}") +done + +echo "=== Syncing pacman database ===" +pacman -Sy --noconfirm + +echo +echo "=== Installing ${#full_pkgs[@]} packages (idempotent) ===" +printf ' %s\n' "${full_pkgs[@]}" +echo +pacman -S --noconfirm --needed "${full_pkgs[@]}" + +ofrasp_deps_run_fixups + +echo +echo "=== Done. Next: ./scripts/install_spine.sh (from openFrameworks repo root). ===" diff --git a/scripts/ofrasp/deps_common.sh b/scripts/ofrasp/deps_common.sh new file mode 100644 index 00000000000..c5f8c09af0c --- /dev/null +++ b/scripts/ofrasp/deps_common.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# deps_common.sh — sourced by install_ofrasp_deps.sh (do not run directly). +# +# Shared post-install steps for ofRasp on every OS: +# - addons/ofxFft (kissfft sources for ofOpenALSoundPlayer) +# - addons/ofxLibTess2/libtess2 (memononen/libtess2; list ofxLibTess2 in addons.make) +# +# Requires: OF_ROOT absolute path set by caller; git on PATH. +# ----------------------------------------------------------------------------- + +if [[ -z "${OF_ROOT:-}" ]]; then + echo "ERROR: deps_common.sh must be sourced after OF_ROOT is set." >&2 + return 1 2>/dev/null || exit 1 +fi + +ofrasp_deps_clone_ofxfft() { + local ofxfft_dir="${OF_ROOT}/addons/ofxFft" + if [[ ! -d "${ofxfft_dir}/libs/kiss" ]]; then + echo + echo "=== Cloning ofxFft into ${ofxfft_dir} ===" + rm -rf "${ofxfft_dir}" + git clone --depth 1 https://github.com/kylemcdonald/ofxFft.git "${ofxfft_dir}" + else + echo + echo "=== ofxFft already present at ${ofxfft_dir} (skipping) ===" + fi +} + +ofrasp_deps_vendor_tess2() { + local tess2_dir="${OF_ROOT}/addons/ofxLibTess2/libtess2" + if [[ ! -d "${tess2_dir}/Source" ]]; then + echo + echo "=== Vendoring libtess2 into ${tess2_dir} ===" + mkdir -p "$(dirname "${tess2_dir}")" + rm -rf "${tess2_dir}" + git clone --depth 1 https://github.com/memononen/libtess2.git "${tess2_dir}" + else + echo + echo "=== libtess2 already vendored at ${tess2_dir} (skipping) ===" + fi +} + +ofrasp_deps_run_fixups() { + ofrasp_deps_clone_ofxfft + ofrasp_deps_vendor_tess2 +} From 24a0306eddbd700c7213e74e93cf6c01f3549e7b Mon Sep 17 00:00:00 2001 From: Bruno Herfst Date: Thu, 23 Apr 2026 02:35:00 +1000 Subject: [PATCH 2/2] install --- INSTALL_OFRASP.md | 76 +++++++++++ README.md | 30 ++--- docs/OF_RASP.md | 28 ++-- scripts/install_ofrasp_deps.sh | 41 ++---- scripts/install_ofrasp_from_git.sh | 122 ++++++++++++++++++ ...stall_spine.sh => install_ofrasp_spine.sh} | 32 +++-- scripts/msys2/install_ofrasp_deps.sh | 8 +- scripts/ofrasp/deps_common.sh | 47 ------- 8 files changed, 258 insertions(+), 126 deletions(-) create mode 100644 INSTALL_OFRASP.md create mode 100644 scripts/install_ofrasp_from_git.sh rename scripts/{install_spine.sh => install_ofrasp_spine.sh} (75%) delete mode 100644 scripts/ofrasp/deps_common.sh diff --git a/INSTALL_OFRASP.md b/INSTALL_OFRASP.md new file mode 100644 index 00000000000..7fedfa34aa3 --- /dev/null +++ b/INSTALL_OFRASP.md @@ -0,0 +1,76 @@ +# Install ofRasp from GitHub + +Short guide to clone this fork and get a **buildable** tree. For stock openFrameworks see **[INSTALL_FROM_GITHUB.md](INSTALL_FROM_GITHUB.md)**. + +--- + +## Before you start + +- Use a path **without spaces** (many scripts assume that). +- You need **Git** and **Bash** (Git Bash on Windows, or MSYS2 / WSL / Terminal on Unix). + +--- + +## 1. Clone + +Default branch is **`ofrasp`**. + +**HTTPS** (no SSH key): + +```bash +git clone https://github.com/ofrasp/openFrameworks.git +cd openFrameworks +``` + +**SSH**: + +```bash +git clone git@github.com:ofrasp/openFrameworks.git +cd openFrameworks +``` + +Confirm branch: + +```bash +git branch --show-current # expect: ofrasp +``` + +To work from **development** checkout: + +```bash +git checkout ofrasp-dev +``` + +--- + +## 2. One-shot install (openFrameworks + ofRasp) + +From the **openFrameworks repo root**, in **Bash** (Git Bash, MSYS2, Linux, macOS): + +```bash +bash ./scripts/install_ofrasp_from_git.sh +``` + +--- + +## 3. Build something + +- Follow your platform’s usual OF workflow: **Makefile**, **Visual Studio**, or **Xcode**, as in **[download / setup](https://openframeworks.cc/download/)**. +- Examples that ship **`build.bat`** / **`build.sh`** can be built from their folder (see comments in those scripts). +- **CMake / CLion:** if you use **ofxCMake**, see **[docs/CMAKE_OFRASP.md](docs/CMAKE_OFRASP.md)** — set **`OF_ROOT`** to this ofRasp repo, run the same deps/spine steps, then configure **per app**. + +ofRasp aims to rely on **package managers** and small scripts instead of apothecary / Project Generator for day-to-day use; PG is still valid if you prefer it. + +--- + +## 6. Stay in sync with upstream openFrameworks + +```bash +git remote add upstream https://github.com/openframeworks/openFrameworks.git # once +git fetch upstream +git merge upstream/master # or rebase, per your workflow +``` + +Resolve conflicts, then re-run **`install_ofrasp_from_git.sh`** (or at least **`install_ofrasp_spine.sh`**) if addon scripts or forks changed. + +--- diff --git a/README.md b/README.md index d81f2592f3a..60d7caaedf0 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,22 @@ This repo is a distribution of [openFrameworks](https://openframeworks.cc/) aimed at **always-on Edit mode**, **Raspberry Pi**, and the **web**. The toolkit is still openFrameworks: `ofApp`, `ofMain.h`, and the addon ecosystem behave the same way. -**→ [More Info, pillars, non-goals, and status](docs/OF_RASP.md)** +**→ [More Info, pillars, non-goals, and status](docs/OF_RASP.md)** +**→ [Install from GitHub](INSTALL_OFRASP.md)** (clone, deps, spine, build) +**→ [CMake + ofxCMake](docs/CMAKE_OFRASP.md)** (optional) ## Quick start -1. Clone the repository. The **default branch is `ofrasp`** (ofRasp development). You can still switch to **stock openFrameworks** in this fork with `git checkout master` (branch name may differ; use `git branch -a`). -2. **Dependencies + ofRasp fixups** (works on **Windows, macOS, Linux / Raspberry Pi**): from the repo root run - `bash ./scripts/install_ofrasp_deps.sh` - - **MSYS2 UCRT64:** installs `pacman` packages for OF + clones **`addons/ofxFft`** (kissfft for the sound code path) and vendors **`addons/ofxLibTess2/libtess2`**. Add **`ofxLibTess2`** to your app’s `addons.make` so tessellator symbols link. - - **macOS / Linux:** prints which upstream `scripts/linux/.../install_dependencies.sh` (or Xcode / OF docs) to use, then runs the same **ofxFft** + **libtess2** fixups. If you already installed OF system packages, use `bash ./scripts/install_ofrasp_deps.sh --fixups-only`. -3. **Spine addons** (ofRasp forks — ImGui, FFT, EnTT): - `bash ./scripts/install_spine.sh` - Clones or updates `addons/ofxImGui`, `addons/ofxFft`, `addons/ofxEnTT` from `https://github.com/ofrasp/`. Edit `SPINE_REPOS` in that script to add more. -4. Build sketches with the usual [openFrameworks setup](https://openframeworks.cc/download/) flow for your platform. More context: **[docs/OF_RASP.md](docs/OF_RASP.md)**. - -## Relationship to upstream - -- **Upstream source tree:** [openframeworks/openFrameworks](https://github.com/openframeworks/openFrameworks) -- **Sync:** add `upstream`, `git fetch upstream`, merge or rebase as you prefer. -- **Stock OF readme** (badges, folder tour, community links): - [github.com/openframeworks/openFrameworks/blob/master/README.md](https://github.com/openframeworks/openFrameworks/blob/master/README.md) +1. Clone the repository. The **default branch is `ofrasp`** use ofrasp-dev for development. You can still switch to **stock openFrameworks** in this fork with `git checkout master` (branch name may differ; use `git branch -a`). + +2. **One-shot from git:** from the repo root run + `bash ./scripts/install_ofrasp_from_git.sh` + + **OR** run those pieces yourself (e.g. **[INSTALL_FROM_GITHUB.md](INSTALL_FROM_GITHUB.md)** for **`download_libs`**, then **`install_ofrasp_deps.sh`**, then **`install_ofrasp_spine.sh`**). + +3. Build sketches as the usual. More context: **[docs/OF_RASP.md](docs/OF_RASP.md)**. + +## Contributing Contributing conventions in this tree still follow **[CONTRIBUTING.md](CONTRIBUTING.md)** where they apply; ofRasp-specific work is discussed on **this fork’s** issues and PRs. diff --git a/docs/OF_RASP.md b/docs/OF_RASP.md index 7d2d02ba859..5df8a17d0bf 100644 --- a/docs/OF_RASP.md +++ b/docs/OF_RASP.md @@ -8,20 +8,14 @@ ofRasp **is openFrameworks.** Your sketches compile unchanged — `ofApp`, `ofMain.h`, every `ofx`* addon still works the same way. -## Bootstrap (vendored addons in `addons/`) - -To keep clean with upstream ... - -Run **`./scripts/install_ofrasp_deps.sh`** from the repo root. Besides OS-specific package hints, it clones **`addons/ofxFft`** (kissfft sources used by the core sound path) and vendors **`addons/ofxLibTess2/libtess2`**. The **`ofxLibTess2`** folder in this repo holds `addon_config.mk`; add **`ofxLibTess2`** to your project’s **`addons.make`** so Makefile builds link libtess2 with `ofTessellator`. Then run **`./scripts/install_spine.sh`** for ofRasp-pinned forks (ImGui, EnTT, ofxFft etc.). - ## Edit mode Every sketch ships with always-on editor. While your sketch is running, hit `Ctrl-E` to see: -- **Nodes** panel listing every entity in the scene -- **Properties** panel to scrub any `ofParameter`, position, color, radius, or other reflected field -- **Viewport** gizmo for direct manipulation -- **Toolbar** with your app name and menu hooks + - **Nodes** panel listing every entity in the scene + - **Properties** panel to scrub any `ofParameter`, position, color, radius, or other reflected field + - **Viewport** gizmo for direct manipulation + - **Toolbar** with your app name and menu hooks Hit `Ctrl-E` again and the editor disappears — your sketch is a clean render again, frame-perfect, zero overhead. It's what Unity calls Play/Edit, what Max/MSP calls locked/unlocked. @@ -30,21 +24,17 @@ It's what Unity calls Play/Edit, what Max/MSP calls locked/unlocked. ### 1. Edit mode -The reflection plumbing that powers ofRasp is an EnTT. The intent is that *every* future OF-style sketch shipped on ofRasp is editable by its author (or viewer) without writing a line of GUI code. +The reflection plumbing that powers ofRasp is an ECS called EnTT. The intent is that *every* future OF-style sketch shipped on ofRasp is editable by its author (or viewer) without writing a line of GUI code. Human Altering. + +ofRasp's reflection layer is built on EnTT, an ECS framework. The intent is that *every* sketch run through ofRasp should be editable by its author—or its viewer—without writing a single line of GUI code. We call this Human Editable. ### 2. Pi-native -Upstream OF's Raspberry Pi support has drifted. ofRasp tries to keep Pi as a first-class target: GLES3 renderer maintained, headless-friendly build paths, reproducible one-command setup on a fresh Raspberry Pi OS install. Pi is the smallest full-stack Edit-mode machine we can ship. +Upstream OF's Raspberry Pi support has drifted. ofRasp tries to keep Pi as a first-class target: GLES3 renderer maintained, headless-friendly build paths, reproducible one-command setup on a fresh Raspberry Pi OS install. Pi is the smallest full-stack Edit-mode machine we can ship, and embedded systems with limited memory tend to run better on 32-bit than 64-bit. ### 3. Web-native -The long arc: ofrasp.com itself runs as an ofRasp sketch under Emscripten. - -## No-goals (things we will deliberately remove) - -- **No projectGenerator.** Every example ships a single project-agnostic `build.sh` that derives the project name from its own folder. - -- **No apothecary.** We rely on platform package managers — MSYS2 `pacman`, `apt`, Homebrew, `vcpkg` — for dependencies. `install_dependencies.sh` wires this up for you. +Export to web should be easy. ofrasp.com itself runs as an ofRasp sketch, compiled to the browser via Emscripten. ## Relationship to upstream openFrameworks diff --git a/scripts/install_ofrasp_deps.sh b/scripts/install_ofrasp_deps.sh index 8320b2e8385..b9995d13f0f 100644 --- a/scripts/install_ofrasp_deps.sh +++ b/scripts/install_ofrasp_deps.sh @@ -4,19 +4,17 @@ # # Platform-aware ofRasp dependency helper (openFrameworks repo root). # -# Windows (MSYS2 UCRT64): full pacman install + shared fixups (ofxFft, ofxLibTess2/libtess2) -# macOS: prints OF setup pointers + runs shared fixups only -# Linux (incl. Raspberry Pi): prints distro install pointers + runs fixups only +# Windows (MSYS2 UCRT64): full pacman install for OF +# macOS / Linux: prints upstream OF install pointers # -# System packages on macOS / Linux are not fully automated here — use upstream -# OF scripts for your OS (same as stock openFrameworks), then run this script. +# ofRasp addon sources (ofxFft, ofxLibTess2, ImGui, EnTT, …) come from +# ./scripts/install_ofrasp_spine.sh — run that after this script, or use +# ./scripts/install_ofrasp_from_git.sh for the full chain. # # Usage (always from openFrameworks repo root): # ./scripts/install_ofrasp_deps.sh -# ./scripts/install_ofrasp_deps.sh --fixups-only +# ./scripts/install_ofrasp_deps.sh --fixups-only # runs install_ofrasp_spine.sh only (legacy name) # -# --fixups-only : only clone ofxFft / vendor libtess2 under addons/ofxLibTess2 (no pacman) -# beyond needing bash + git). Safe on any OS after OF deps exist. # ----------------------------------------------------------------------------- set -euo pipefail @@ -30,13 +28,9 @@ if [[ "${1:-}" == "--fixups-only" ]] || [[ "${1:-}" == "-F" ]]; then FIXUPS_ONLY=1 fi -# shellcheck source=scripts/ofrasp/deps_common.sh -source "${SCRIPT_DIR}/ofrasp/deps_common.sh" - if [[ "${FIXUPS_ONLY}" -eq 1 ]]; then - ofrasp_deps_run_fixups - echo - echo "=== Fixups done. Next: ./scripts/install_spine.sh ===" + echo "=== --fixups-only: running ./scripts/install_ofrasp_spine.sh (ofRasp addons) ===" + bash "${SCRIPT_DIR}/install_ofrasp_spine.sh" exit 0 fi @@ -51,10 +45,7 @@ case "${uname_s}" in echo "NOTE: MSYS2 UCRT64 shell not detected (MINGW_* unset)." >&2 echo " For full Windows deps, open 'MSYS2 UCRT64' and run:" >&2 echo " ${SCRIPT_DIR}/msys2/install_ofrasp_deps.sh" >&2 - echo " Running ofRasp fixups only (ofxFft, tess2)..." >&2 - ofrasp_deps_run_fixups - echo - echo "=== Next: open MSYS2 UCRT64 for pacman deps, then ./scripts/install_spine.sh ===" + echo "=== Next: ./scripts/install_ofrasp_spine.sh (ofxFft, ofxLibTess2, …) ===" >&2 exit 0 ;; esac @@ -66,9 +57,7 @@ case "${uname_s}" in echo " https://openframeworks.cc/download/" echo "Use OF’s macOS project templates / download_libs.sh as documented upstream." echo - ofrasp_deps_run_fixups - echo - echo "=== Next: ./scripts/install_spine.sh ===" + echo "=== Next: ./scripts/install_ofrasp_spine.sh (ofxFft, ofxLibTess2, …) ===" ;; Linux) echo "=== Linux (includes Raspberry Pi OS) ===" @@ -84,15 +73,11 @@ case "${uname_s}" in echo " See scripts/linux// in this repo." fi echo - ofrasp_deps_run_fixups - echo - echo "=== Next: ./scripts/install_spine.sh ===" + echo "=== Next: ./scripts/install_ofrasp_spine.sh (ofxFft, ofxLibTess2, …) ===" ;; *) echo "=== Unknown OS: ${uname_s} ===" >&2 - echo "Running fixups only (ofxFft, tess2). Install OF system deps manually." >&2 - ofrasp_deps_run_fixups - echo - echo "=== Next: ./scripts/install_spine.sh ===" + echo "Install OF system deps manually, then:" >&2 + echo " ./scripts/install_ofrasp_spine.sh" >&2 ;; esac diff --git a/scripts/install_ofrasp_from_git.sh b/scripts/install_ofrasp_from_git.sh new file mode 100644 index 00000000000..26bb11a021b --- /dev/null +++ b/scripts/install_ofrasp_from_git.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# install_ofrasp_from_git.sh +# +# One-shot setup after cloning the ofRasp openFrameworks repo: +# 1) git submodule update --init --recursive (Project Generator, apothecary, …) +# 2) scripts/dev/download_libs.sh (prebuilt libs/ for this platform) +# 3) install_ofrasp_deps.sh — MSYS2: pacman; others: OS package hints +# 4) install_ofrasp_spine.sh — ofRasp addon forks (ofxFft, ofxLibTess2, …) +# +# Skip core OF steps (only ofRasp layer): --ofrasp-layer-only +# Fine-grained skips: --no-submodules --no-download-libs +# +# Usage (openFrameworks repo root): +# ./scripts/install_ofrasp_from_git.sh +# ./scripts/install_ofrasp_from_git.sh --ofrasp-layer-only +# ./scripts/install_ofrasp_from_git.sh --fixups-only +# ./scripts/install_ofrasp_from_git.sh --no-spine +# ./scripts/install_ofrasp_from_git.sh --spine-only [--full] +# +# Extra args for download_libs.sh (platform override, etc.): +# OFRASP_DOWNLOAD_LIBS_ARGS='-p osx' ./scripts/install_ofrasp_from_git.sh +# +# Alias: ./scripts/bootstrap_ofrasp.sh +# ----------------------------------------------------------------------------- + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +OF_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +cd "${OF_ROOT}" + +if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then + cat <<'EOF' +Usage: ./scripts/install_ofrasp_from_git.sh [options] + + (default) Submodules + download_libs + ofRasp deps + spine + --ofrasp-layer-only Only steps 3–4 (deps + spine); skip submodules + download_libs + --no-submodules Skip git submodule update + --no-download-libs Skip scripts/dev/download_libs.sh + --fixups-only Runs install_ofrasp_spine only via install_ofrasp_deps (skips duplicate spine step) + --no-spine Skip install_ofrasp_spine.sh + --spine-only Only install_ofrasp_spine.sh (extra args forwarded, e.g. --full) + +download_libs extras: set OFRASP_DOWNLOAD_LIBS_ARGS before running, e.g. + OFRASP_DOWNLOAD_LIBS_ARGS='-p linux64' ./scripts/install_ofrasp_from_git.sh + +Requires: bash, git. download_libs expects curl/wget tools per upstream OF. +See INSTALL_OFRASP.md and INSTALL_FROM_GITHUB.md. + +Same as: ./scripts/bootstrap_ofrasp.sh +EOF + exit 0 +fi + +if [[ "${1:-}" == "--spine-only" ]]; then + shift + exec bash "${SCRIPT_DIR}/install_ofrasp_spine.sh" "$@" +fi + +DO_SUBMODULES=1 +DO_DOWNLOAD_LIBS=1 +DEPS_ARGS=() +DO_SPINE=1 + +while [[ $# -gt 0 ]]; do + case "$1" in + --ofrasp-layer-only) + DO_SUBMODULES=0 + DO_DOWNLOAD_LIBS=0 + shift + ;; + --no-submodules) + DO_SUBMODULES=0 + shift + ;; + --no-download-libs) + DO_DOWNLOAD_LIBS=0 + shift + ;; + --fixups-only | -F) + DEPS_ARGS+=(--fixups-only) + DO_SPINE=0 + shift + ;; + --no-spine) + DO_SPINE=0 + shift + ;; + *) + echo "Unknown option: $1 (try --help)" >&2 + exit 1 + ;; + esac +done + +if [[ "${DO_SUBMODULES}" -eq 1 ]]; then + echo "=== openFrameworks: git submodules (init + update) ===" + git -C "${OF_ROOT}" submodule update --init --recursive + echo +fi + +if [[ "${DO_DOWNLOAD_LIBS}" -eq 1 ]]; then + echo "=== openFrameworks: download_libs (prebuilt libs/) ===" + # shellcheck disable=SC2086 + bash "${OF_ROOT}/scripts/dev/download_libs.sh" ${OFRASP_DOWNLOAD_LIBS_ARGS:-} + echo +fi + +echo "=== ofRasp: install_ofrasp_deps.sh ===" +bash "${SCRIPT_DIR}/install_ofrasp_deps.sh" "${DEPS_ARGS[@]}" + +if [[ "${DO_SPINE}" -eq 1 ]]; then + echo + echo "=== ofRasp: spine addons ===" + bash "${SCRIPT_DIR}/install_ofrasp_spine.sh" +fi + +echo +echo "=== install_ofrasp_from_git finished ===" +echo "Next: platform packages if any are still missing (see INSTALL_OFRASP.md), then build" +echo " with Makefile / VS / Xcode, or per-app CMake — docs/CMAKE_OFRASP.md" diff --git a/scripts/install_spine.sh b/scripts/install_ofrasp_spine.sh similarity index 75% rename from scripts/install_spine.sh rename to scripts/install_ofrasp_spine.sh index 6b968870be8..65ba47baa20 100644 --- a/scripts/install_spine.sh +++ b/scripts/install_ofrasp_spine.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # ----------------------------------------------------------------------------- -# install_spine.sh +# install_ofrasp_spine.sh # # Clone or update the ofRasp "spine" addons into /addons. # Default remote: https://github.com/ofrasp/.git @@ -9,12 +9,12 @@ # Works from: MSYS2 UCRT64, Linux, macOS, WSL (anywhere git works). # # Usage (from openFrameworks repo root): -# ./scripts/install_spine.sh -# ./scripts/install_spine.sh --full # full clone (no --depth) +# ./scripts/install_ofrasp_spine.sh +# ./scripts/install_ofrasp_spine.sh --full # full clone (no --depth) # # Override org or URLs: -# OFRASP_ORG=myfork ./scripts/install_spine.sh -# OFRASP_GIT_BASE=https://github.com/ofrasp ./scripts/install_spine.sh +# OFRASP_ORG=myfork ./scripts/install_ofrasp_spine.sh +# OFRASP_GIT_BASE=https://github.com/ofrasp ./scripts/install_ofrasp_spine.sh # # Add or remove repos by editing SPINE_REPOS below. # ----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ DO_PULL=1 usage() { cat <<'EOF' -Usage: ./scripts/install_spine.sh [--full] [--no-pull] +Usage: ./scripts/install_ofrasp_spine.sh [--full] [--no-pull] --full Full clone (omit --depth 1) --no-pull Skip git pull on existing clones @@ -66,9 +66,12 @@ done # GitHub repo name = folder name under addons/ (OF convention). SPINE_REPOS=( - ofxImGui - ofxFft + ofxCMake ofxEnTT + ofxEnTTKit + ofxFft + ofxImGui + ofxLibTess2 ) if [[ ${#DEPTH_ARG[@]} -eq 0 ]]; then @@ -104,6 +107,19 @@ for repo in "${SPINE_REPOS[@]}"; do continue fi + # Vendored copy shipped in the ofRasp tree (or a manual checkout): do not clone over it. + if [[ "${repo}" == "ofxLibTess2" ]] && [[ -d "${dest}/libtess2/Source" ]]; then + echo ">>> ${repo}: vendored in-tree (libtess2 present), skip clone" + continue + fi + + # Old skeleton without sources: move aside so we can clone the git addon. + if [[ "${repo}" == "ofxLibTess2" ]] && [[ -d "${dest}" ]] && [[ ! -d "${dest}/.git" ]]; then + backup="${dest}.pre_spine_$(date +%s)" + echo ">>> ${repo}: moving non-git folder aside -> ${backup}" + mv "${dest}" "${backup}" + fi + if [[ -e "${dest}" ]]; then echo "ERROR: ${dest} exists but is not a git repo; move it aside or remove it." >&2 exit 1 diff --git a/scripts/msys2/install_ofrasp_deps.sh b/scripts/msys2/install_ofrasp_deps.sh index 77062bc4e6c..fde6d66d837 100644 --- a/scripts/msys2/install_ofrasp_deps.sh +++ b/scripts/msys2/install_ofrasp_deps.sh @@ -9,7 +9,6 @@ # Direct usage (MSYS2 UCRT64 shell only): # ./scripts/msys2/install_ofrasp_deps.sh # -# See also: scripts/ofrasp/deps_common.sh (shared ofxFft + ofxLibTess2/libtess2) # ----------------------------------------------------------------------------- set -euo pipefail @@ -18,9 +17,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" OF_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" export OF_ROOT -# shellcheck source=scripts/ofrasp/deps_common.sh -source "${SCRIPT_DIR}/../ofrasp/deps_common.sh" - # --- sanity checks ----------------------------------------------------------- if [[ -z "${MINGW_PACKAGE_PREFIX:-}" ]]; then @@ -73,7 +69,5 @@ printf ' %s\n' "${full_pkgs[@]}" echo pacman -S --noconfirm --needed "${full_pkgs[@]}" -ofrasp_deps_run_fixups - echo -echo "=== Done. Next: ./scripts/install_spine.sh (from openFrameworks repo root). ===" +echo "=== Done. Next: ./scripts/install_ofrasp_spine.sh (ofxFft, ofxLibTess2, …) from repo root. ===" diff --git a/scripts/ofrasp/deps_common.sh b/scripts/ofrasp/deps_common.sh deleted file mode 100644 index c5f8c09af0c..00000000000 --- a/scripts/ofrasp/deps_common.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -# ----------------------------------------------------------------------------- -# deps_common.sh — sourced by install_ofrasp_deps.sh (do not run directly). -# -# Shared post-install steps for ofRasp on every OS: -# - addons/ofxFft (kissfft sources for ofOpenALSoundPlayer) -# - addons/ofxLibTess2/libtess2 (memononen/libtess2; list ofxLibTess2 in addons.make) -# -# Requires: OF_ROOT absolute path set by caller; git on PATH. -# ----------------------------------------------------------------------------- - -if [[ -z "${OF_ROOT:-}" ]]; then - echo "ERROR: deps_common.sh must be sourced after OF_ROOT is set." >&2 - return 1 2>/dev/null || exit 1 -fi - -ofrasp_deps_clone_ofxfft() { - local ofxfft_dir="${OF_ROOT}/addons/ofxFft" - if [[ ! -d "${ofxfft_dir}/libs/kiss" ]]; then - echo - echo "=== Cloning ofxFft into ${ofxfft_dir} ===" - rm -rf "${ofxfft_dir}" - git clone --depth 1 https://github.com/kylemcdonald/ofxFft.git "${ofxfft_dir}" - else - echo - echo "=== ofxFft already present at ${ofxfft_dir} (skipping) ===" - fi -} - -ofrasp_deps_vendor_tess2() { - local tess2_dir="${OF_ROOT}/addons/ofxLibTess2/libtess2" - if [[ ! -d "${tess2_dir}/Source" ]]; then - echo - echo "=== Vendoring libtess2 into ${tess2_dir} ===" - mkdir -p "$(dirname "${tess2_dir}")" - rm -rf "${tess2_dir}" - git clone --depth 1 https://github.com/memononen/libtess2.git "${tess2_dir}" - else - echo - echo "=== libtess2 already vendored at ${tess2_dir} (skipping) ===" - fi -} - -ofrasp_deps_run_fixups() { - ofrasp_deps_clone_ofxfft - ofrasp_deps_vendor_tess2 -}