aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure40
1 files changed, 30 insertions, 10 deletions
diff --git a/configure b/configure
index 06a43eb..1c17462 100755
--- a/configure
+++ b/configure
@@ -15,6 +15,12 @@
set -e
+# Set BROWSERPATH appropriately
+set_browserpath () {
+ BROWSERPATH="${BINARY:-$(realpath "$1")}"
+}
+
+BINARY="$BROWSER_BIN"
BROWSERPATH=''
SRCDIR=''
TARGET=''
@@ -22,18 +28,23 @@ TARGET=''
# Parse command line options
while [ "x$1" != x ]; do
case "$1" in
- --srcdir=*) SRCDIR="$(echo "$1" | cut -c 10-)";;
- --srcdir) SRCDIR="$2"; shift;;
- "DESTDIR"=*) DESTDIR="$(echo "$1" | cut -c 9-)";;
- "UPDATE_URL"=*) UPDATE_URL="$(echo "$1" | cut -c 12-)";;
- --host=*) TARGET="$(echo "$1" | cut -c 8-)";;
- --host) TARGET="$2"; shift;;
+ --srcdir=*) SRCDIR="$(echo "$1" | cut -c 10-)";;
+ --srcdir) SRCDIR="$2"; shift;;
+ BROWSER_BIN=*) BINARY="$(echo "$1" | cut -c 13-)";;
+ DESTDIR=*) DESTDIR="$(echo "$1" | cut -c 9-)";;
+ PYTEST=*) PYTEST="$(echo "$1" | cut -c 8-)";;
+ PYTHON=*) PYTHON="$(echo "$1" | cut -c 8-)";;
+ TEST_PORT=*) TEST_PORT="$(echo "$1" | cut -c 11-)";;
+ TEST_PROFILE=*) TEST_PROFILE="$(echo "$1" | cut -c 14-)";;
+ UPDATE_URL=*) UPDATE_URL="$(echo "$1" | cut -c 12-)";;
+ --host=*) TARGET="$(echo "$1" | cut -c 8-)";;
+ --host) TARGET="$2"; shift;;
# browsers
chromium | chrome | google-chrome | mozilla |\
firefox | librewolf | icecat | iceweasel | abrowser |\
- iceweasel-uxp | tor-browser) TARGET=$1;;
- *) echo Ignoring option "'$1'";;
+ iceweasel-uxp | tor-browser) TARGET=$1;;
+ *) echo Ignoring option "'$1'";;
esac
shift
done
@@ -59,7 +70,7 @@ fi
if [ "x$TARGET" = x ]; then
echo Detecting target automatically.
if [ -h /etc/alternatives/x-www-browser ]; then
- BROWSERPATH="$(realpath /etc/alternatives/x-www-browser)"
+ set_browserpath /etc/alternatives/x-www-browser
TARGET="$(/etc/alternatives/x-www-browser --version 2> /dev/null |
tail -n 1 | awk '{ print $1 }' | tr [A-Z] [a-z])"
else
@@ -67,7 +78,7 @@ if [ "x$TARGET" = x ]; then
echo Some make rules may fail. >&2
fi
else
- BROWSERPATH="$(realpath "$(which $TARGET)")"
+ set_browserpath "$(which $TARGET)"
fi
# Check and standardize target
@@ -98,8 +109,17 @@ fi
echo srcdir = "$SRCDIR" > record.conf
echo default_target = "$TARGET" >> record.conf
echo DESTDIR = "$DESTDIR" >> record.conf
+echo PYTEST = "${PYTEST:-$(which pytest)}" >> record.conf
+echo PYTHON = "${PYTHON:-$(which python3)}" >> record.conf
echo UPDATE_URL = "$UPDATE_URL" >> record.conf
+# Write test/config.py (if testing is enabled)
+echo from .misc_constants import '*' > test/config.py
+echo default_firefox_binary = "'${BINARY:-/usr/lib/icecat/icecat}'" >> test/config.py
+echo default_clean_profile_dir = "'$TEST_PROFILE'" or \
+ default_clean_profile_dir >> test/config.py
+echo default_proxy_port = "${TEST_PORT:-1337}" >> test/config.py
+
# Prepare and run write_makefile.sh (as config.status)
if [ ! -e config.status ]; then