-# ------------------------------------------------------------- packages
-
-# Needed to build rsync at all.
-REQUIRED=(
- build-essential # gcc, g++, make, libc headers
- gawk # rsync needs a modern awk for its code generators
- autoconf # ./configure is generated from configure.ac
- automake
- python3 # manpage + header generators, and the test suite
- cmake # the CMake build
- ninja-build # ...and its default generator
- git # version stamping (git-version.h)
- pkg-config
-)
-
-# Optional: each one switches on an rsync feature. Missing ones only mean
-# a smaller feature set, never a failed build.
-OPTIONAL=(
- acl libacl1-dev # --acls (helper tools also used by the tests)
- attr libattr1-dev # --xattrs (likewise)
- libxxhash-dev # xxhash checksums (becomes the default)
- libzstd-dev # zstd compression (becomes the default)
- liblz4-dev # lz4 compression
- libssl-dev # OpenSSL MD4/MD5
- zlib1g-dev # for cmake -DRSYNC_EXTERNAL_ZLIB=ON
- libpopt-dev # for ./configure --with-included-popt=no
-)
-
-# Development tooling: not needed to build rsync, but useful when working on
-# its shell scripts -- including this one, which shellcheck keeps honest.
-DEVTOOLS=(
- shellcheck
-)
-OPTIONAL+=("${DEVTOOLS[@]}")
-
-# The manpages need one of two python3 markdown libraries; upstream prefers
-# cmarkgfm. Pick whichever this release actually offers.
-MARKDOWN_PKG=""
-for p in python3-cmarkgfm python3-commonmark; do
- cand=$(apt-cache policy "$p" 2>/dev/null | awk '/Candidate:/{print $2}')
- if [ -n "$cand" ] && [ "$cand" != "(none)" ]; then
- MARKDOWN_PKG="$p"
- break
+# ------------------------------------------------------- rsync packages
+
+REQUIRED=()
+OPTIONAL=()
+
+if [ "$WANT_RSYNC" -eq 1 ]; then
+ case "$PM" in
+ apt)
+ # Needed to build rsync at all.
+ REQUIRED=(
+ build-essential # gcc, g++, make, libc headers
+ gawk # rsync needs a modern awk for its code generators
+ autoconf # ./configure is generated from configure.ac
+ automake
+ python3 # manpage + header generators, and the test suite
+ cmake # the CMake build
+ ninja-build # ...and its default generator
+ git # version stamping (git-version.h)
+ pkg-config
+ )
+
+ # Optional: each one switches on an rsync feature. Missing ones only
+ # mean a smaller feature set, never a failed build.
+ OPTIONAL=(
+ acl libacl1-dev # --acls (helper tools also used by the tests)
+ attr libattr1-dev # --xattrs (likewise)
+ libxxhash-dev # xxhash checksums (becomes the default)
+ libzstd-dev # zstd compression (becomes the default)
+ liblz4-dev # lz4 compression
+ libssl-dev # OpenSSL MD4/MD5
+ zlib1g-dev # for cmake -DRSYNC_EXTERNAL_ZLIB=ON
+ libpopt-dev # for ./configure --with-included-popt=no
+ )
+ ;;
+ pacman)
+ # Arch splits nothing out into -dev packages: the headers ship with
+ # the library, and base-devel covers the compiler toolchain.
+ REQUIRED=(
+ base-devel # gcc, make, and friends
+ gawk
+ autoconf
+ automake
+ python
+ cmake
+ ninja
+ git
+ pkgconf
+ )
+ OPTIONAL=(
+ acl # --acls
+ attr # --xattrs
+ xxhash # xxhash checksums (becomes the default)
+ zstd # zstd compression (becomes the default)
+ lz4 # lz4 compression
+ openssl # OpenSSL MD4/MD5
+ zlib # for cmake -DRSYNC_EXTERNAL_ZLIB=ON
+ popt # for ./configure --with-included-popt=no
+ )
+ ;;
+ esac
+
+ # Development tooling: not needed to build rsync, but useful when working
+ # on its shell scripts -- including this one, which shellcheck keeps honest.
+ #
+ # ffmpeg and adb are here for the same reason: they are common across the
+ # projects on these machines rather than specific to any one of them, so
+ # installing them once here means a per-project setup script only has to
+ # CHECK for them instead of carrying its own package-manager logic. What
+ # stays out of this script on purpose is anything project-shaped -- no
+ # virtualenvs, no per-repo Python packages, no test tooling. Those belong
+ # next to the repo that needs them (e.g. RAWcorder's setup-linux-tests.sh).
+ #
+ # ffmpeg ffmpeg + ffprobe, for building and probing test media
+ # adb reaches Android devices. AGI installs it too, but only
+ # on an --agi run, and it is worth having either way.
+ # python3-venv Debian and Ubuntu split venv and ensurepip out of python3,
+ # so `python3 -m venv` fails on a stock Ubuntu without it.
+ # Arch bundles both into `python`, so there is nothing to add.
+ OPTIONAL+=(shellcheck ffmpeg)
+ case "$PM" in
+ apt)
+ COMMON_PKG=$(pick_pkg python3-venv) && OPTIONAL+=("$COMMON_PKG")
+ COMMON_PKG=$(pick_pkg adb android-sdk-platform-tools) && OPTIONAL+=("$COMMON_PKG")
+ ;;
+ pacman)
+ COMMON_PKG=$(pick_pkg android-tools) && OPTIONAL+=("$COMMON_PKG")
+ ;;
+ esac
+
+ # The manpages need one of two python3 markdown libraries; upstream prefers
+ # cmarkgfm. Pick whichever this release actually offers.
+ case "$PM" in
+ apt) MARKDOWN_PKG=$(pick_pkg python3-cmarkgfm python3-commonmark) ;;
+ pacman) MARKDOWN_PKG=$(pick_pkg python-cmarkgfm python-commonmark) ;;
+ esac
+ if [ -n "$MARKDOWN_PKG" ]; then
+ OPTIONAL+=("$MARKDOWN_PKG")
+ fi
+
+ if [ "$MINIMAL" -eq 1 ]; then
+ OPTIONAL=()
+ fi
+fi
+
+# ------------------------------------------------------- AGI packages
+
+# AGI is a Java/SWT desktop app plus a set of Go binaries. The .deb declares
+# "Depends: openjdk-22-jre, libgtk-3-0, libwebkit2gtk-4.1-0", but Ubuntu has
+# never packaged openjdk-22 -- so pick a JRE that exists instead. The GUI's
+# class files are Java 19 bytecode, so anything from 21 up runs it; the launcher
+# itself only insists on 11. adb is not a hard dependency, but without it AGI
+# cannot see Android devices ("adb could not be found from ANDROID_HOME or PATH").
+AGI_DEPS=()
+AGI_JRE=""
+AGI_GTK=""
+AGI_WEBKIT=""
+AGI_ADB=""
+
+if [ "$WANT_AGI" -eq 1 ]; then
+ case "$PM" in
+ apt)
+ AGI_JRE=$(pick_pkg openjdk-21-jre openjdk-25-jre openjdk-24-jre \
+ openjdk-23-jre openjdk-22-jre openjdk-26-jre)
+ AGI_GTK=$(pick_pkg libgtk-3-0t64 libgtk-3-0)
+ AGI_WEBKIT=$(pick_pkg libwebkit2gtk-4.1-0)
+ AGI_ADB=$(pick_pkg adb android-sdk-platform-tools)
+ # curl fetches the release, binutils' ar rewrites the .deb's control
+ # member, ca-certificates lets curl trust github.com.
+ AGI_DEPS=(curl ca-certificates binutils xz-utils unzip)
+ ;;
+ pacman)
+ AGI_JRE=$(pick_pkg jre-openjdk jre21-openjdk)
+ AGI_GTK=$(pick_pkg gtk3)
+ AGI_WEBKIT=$(pick_pkg webkit2gtk-4.1)
+ AGI_ADB=$(pick_pkg android-tools)
+ AGI_DEPS=(curl unzip)
+ ;;
+ esac
+
+ for p in "$AGI_GTK" "$AGI_WEBKIT" "$AGI_ADB"; do
+ [ -n "$p" ] && AGI_DEPS+=("$p")
+ done
+
+ # A JRE already on the box is good enough if it is new enough to load the
+ # GUI's Java 19 class files. On apt we install one anyway: the .deb's
+ # rewritten Depends line has to name a package dpkg knows about.
+ JAVA_MAJOR=0
+ if command -v java >/dev/null 2>&1; then
+ JAVA_MAJOR=$(java -version 2>&1 \
+ | sed -n '1s/.*version "\([0-9]\{1,\}\).*/\1/p')
+ JAVA_MAJOR=${JAVA_MAJOR:-0}
+ fi
+ if [ -n "$AGI_JRE" ] && { [ "$PM" = apt ] || [ "$JAVA_MAJOR" -lt 19 ]; }; then
+ AGI_DEPS+=("$AGI_JRE")