From 871860d53a7bb7c262e76bd99b56d86278547a0b Mon Sep 17 00:00:00 2001 From: David Gekeler Date: Sat, 24 May 2025 01:32:16 +0200 Subject: [PATCH] Add command line option to skip map download; switch to wget Signed-off-by: David Gekeler --- configure.sh | 34 +++++++++++++++++++++++++++++++++- docs/INSTALL.md | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.sh b/configure.sh index 79dab03e1..3160d6872 100755 --- a/configure.sh +++ b/configure.sh @@ -3,8 +3,31 @@ # Please run this script to configure the repository after cloning it. # +SKIP_MAP_DOWNLOAD=false + +############################# PROCESS OPTIONS ################################ + +TEMP=$(getopt -o s --long skip-map-download \ + -n 'configure' -- "$@") + +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$TEMP" + +while true; do + case "$1" in + -s | --skip-map-download ) SKIP_MAP_DOWNLOAD=true; shift ;; + * ) break ;; + esac +done + +# Shift the processed options away +shift $((OPTIND-1)) + set -euo pipefail +############################################################################### + echo "Configuring the repository for development." if [ ! -d 3party/boost/tools ]; then @@ -14,6 +37,15 @@ pushd 3party/boost/ ./bootstrap.sh ./b2 headers popd -curl -C - -L --parallel --parallel-immediate --parallel-max 2 https://cdn.comaps.app/maps/latest/World.mwm -o data/World.mwm https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -o data/WorldCoasts.mwm + +if [ "$SKIP_MAP_DOWNLOAD" = false ]; then + echo "Downloading world map..." + wget -N https://cdn.comaps.app/maps/latest/World.mwm -P ./data/ + wget -N https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -P ./data/ +else + echo "Skipping world map download..." +fi + bash ./tools/unix/generate_symbols.sh + echo "The repository is configured for development." diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 5f6a0cfb8..9e268e664 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -43,7 +43,7 @@ cd comaps Install required packages (Ubuntu/Debian): ```bash -sudo apt install qt6-base-dev qt6-declarative-dev libqt6svg6-dev optipng curl +sudo apt install qt6-base-dev qt6-declarative-dev libqt6svg6-dev optipng ``` Configure the repository (make sure you have a working C++ build environment):