aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/messaging.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services/messaging.scm')
0 files changed, 0 insertions, 0 deletions
Unknown option '--%s'\n" "$OPT_NAME" >&2 exit 1 ;; esac shift continue fi # Process a non-'--' option OPT_NAME="${OPT%%=*}" OPT_VAL="${OPT#*=}" case "$OPT_NAME" in BROWSER_BINARY) BROWSER_BINARY="$OPT_VAL";; CLEAN_PROFILE) CLEAN_PROFILE="$OPT_VAL";; DRIVER) DRIVER="$OPT_VAL";; PYTHON) PYTHON="$OPT_VAL";; SRCDIR) SRCDIR="$OPT_VAL";; DESTDIR|DSTDIR) DESTDIR="$OPT_VAL";; UPDATE_URL) UPDATE_URL="$OPT_VAL";; HOST) TARGET_NAME="$OPT_VAL";; *) printf "Unknown variable '%s'\n" "$OPT_NAME" >&2 exit 1 ;; esac shift done # Check TARGET_NAME if [ "x$TARGET_NAME" = x ]; then printf 'Target not specified. Please use `--host=<browser-name>`.\n' >&2 exit 1 fi # Check and standardize target case "$TARGET_NAME" in mozilla | firefox | abrowser | icecat | librewolf | iceweasel | tor-browser) TARGET=mozilla ;; ungoogled-chromium | chromium | chrome | google-chrome | brave | iridium | \ bromite) TARGET=chromium printf "Tests won't yet run on a Chromium-based browser.\n" SOFT_FAILURES=y ;; *) printf 'Invalid target: %s\n' "$TARGET_NAME" >&2 exit 1 ;; esac # Autodetect srcdir if [ "x$SRCDIR" = x ]; then if which "$ARG0" >/dev/null 2>&1; then SRCDIR="$(which "$ARG0")" SRCDIR="$(dirname "$SRCDIR")" SRCDIR="$(realpath "$SRCDIR" || true)" fi if [ "x$SRCDIR" = x ]; then SRCDIR=.. if [ -f manifest.json ] && [ -f write_makefile.sh ]; then SRCDIR=. fi fi printf 'Guessing SRCDIR: %s\n' "$SRCDIR" fi # Check srcdir for FILE in manifest.json write_makefile.sh version; do if [ -f "$SRCDIR"/"$FILE" ]; then continue fi printf "Invalid source directory '%s': missing %s\n" "$SRCDIR" $FILE >&2 exit 1 done BROWSERPATH="$(realpath "$(which $TARGET_NAME)" 2>/dev/null || true)" # Guess browser binary (needed for Selenium) if [ "x$BROWSER_BINARY" = x ]; then if [ "x$TARGET_NAME" = xabrowser ]; then # Trisquel's path to Abrowser BROWSER_BINARY=/usr/lib/abrowser/abrowser elif [ "x$TARGET_NAME" = xlibrewolf ]; then # Debian's path to Librewolf BROWSER_BINARY=/usr/share/librewolf/librewolf elif [ "x$TARGET_NAME" = xiceweasel ]; then # Parabola's path to Iceweasel BROWSER_BINARY=/usr/lib/iceweasel/iceweasel elif [ "x$TARGET_NAME" = xicecat ]; then # Parabola's path to IceCat BROWSER_BINARY=/usr/lib/icecat/icecat fi if [ "x$BROWSER_BINARY" != x ]; then printf 'Guessing BROWSER_BINARY: %s\n' "$BROWSER_BINARY" elif [ "$TARGET" != "chromium" ]; then printf 'Cannot guess BROWSER_BINARY for %s.\n' "$TARGET_NAME" SOFT_FAILURES=y fi fi # Autodetect Selenium driver if [ "x$DRIVER" = x ]; then if [ "x$TARGET" = xmozilla ]; then DRIVER="$(which geckodriver 2>/dev/null || true)" if [ -n "$DRIVER" ]; then printf 'Guessing DRIVER: %s\n' "$DRIVER" else printf 'Cannot guess DRIVER for %s.\n' "$TARGET_NAME" fi fi fi # Autodetect clean profile directory for use in selenium tests if [ "x$CLEAN_PROFILE" = x ]; then if [ "x$TARGET" = xmozilla ]; then CLEAN_PROFILE="$SRCDIR"/test/default_profile/icecat_empty fi fi # Autodetect python if [ "x$TARGET" = xmozilla -a "x$PYTHON" = x ]; then PYTHON2_SKIPPED=n for PYTHON_GUESS in python3 python-3 python; do if [ "x$PYTHON" = x ]; then PYTHON="$(which $PYTHON_GUESS 2>/dev/null || true)" fi if [ -n "$PYTHON" ]; then if [ "$PYTHON_GUESS" = python ]; then if python --version 2>&1 | grep '^Python 2' >/dev/null; then PYTHON='' PYTHON2_SKIPPED=y fi fi fi if [ -n "$PYTHON" ]; then break fi done if [ -n "$PYTHON" ]; then printf 'Guessing PYTHON: %s\n' "$PYTHON" else printf 'Cannot guess PYTHON' if [ "$PYTHON2_SKIPPED" = y ]; then printf ' %s' \ '(skipped Python 2 executable in PATH; Python 3 is required)' fi printf '.\n' SOFT_FAILURES=y fi fi # Autodetect DESTDIR (no check needed) if [ "x$DESTDIR" = x ]; then if [ "x$TARGET" = xmozilla ]; then DESTDIR=/usr/share/mozilla/extensions/ elif test "x$TARGET_NAME" = xchromium -o \ "x$TARGET_NAME" = xungoogled-chromium; then DESTDIR=/usr/share/chromium/extensions fi if [ -n "$DESTDIR" ]; then printf 'Guessing DESTDIR: %s\n' "$DESTDIR" else printf 'Cannot guess DESTDIR.\n' SOFT_FAILURES=y fi fi # Write record.conf (LEAVE SRCDIR FIRST) printf '%s\n' "srcdir = $SRCDIR" > record.conf printf '%s\n' "default_target = $TARGET" >> record.conf printf '%s\n' "DESTDIR = $DESTDIR" >> record.conf printf '%s\n' "UPDATE_URL = $UPDATE_URL" >> record.conf printf '%s\n' "DRIVER = $DRIVER" >> record.conf printf '%s\n' "BROWSER_BINARY = $BROWSER_BINARY" >> record.conf printf '%s\n' "CLEAN_PROFILE = $CLEAN_PROFILE" >> record.conf printf '%s\n' "PYTHON = $PYTHON" >> record.conf # Prepare and run write_makefile.sh (as config.status) cp "$SRCDIR"/write_makefile.sh config.status ./config.status if [ "$SOFT_FAILURES" = "y" ]; then printf 'Some make rules may fail.\n' fi