From b1102a4ff2fd81eb4c7425739cd438b44a646b9a Mon Sep 17 00:00:00 2001
From: Oliver Behnke <oliver.behnke@aei.mpg.de>
Date: Fri, 20 Nov 2020 10:54:00 +0100
Subject: [PATCH] Speed up SDL download and remove Mercurial dependency

---
 build.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/build.sh b/build.sh
index 1f2bbd2..61d4fae 100755
--- a/build.sh
+++ b/build.sh
@@ -150,7 +150,7 @@ check_prerequisites()
     echo "Checking prerequisites..." | tee -a $LOGFILE
 
     # required toolchain
-    TOOLS="automake autoconf m4 cmake wget svn tar patch gcc g++ ld libtool libtoolize ar lex yacc pkg-config hg"
+    TOOLS="automake autoconf m4 cmake wget svn tar patch gcc g++ ld libtool libtoolize ar lex yacc pkg-config"
 
     MISSING=""
     for tool in $TOOLS; do
@@ -219,15 +219,14 @@ prepare_sdl()
     mkdir -p $ROOT/3rdparty/sdl >> $LOGFILE || failure
     mkdir -p $ROOT/build/sdl >> $LOGFILE || failure
 
-    cd $ROOT/3rdparty/sdl || failure
-    if [ -d .hg ]; then
-        echo "Updating SDL..." | tee -a $LOGFIL
-        # local changes (patches) are reverted, hence also updated
-        hg update --clean >> $LOGFILE 2>&1 || failure
-    else
-        echo "Retrieving SDL $SDL_VERSION (this may take a while)..." | tee -a $LOGFILE
-        hg clone -r release-$SDL_VERSION http://hg.libsdl.org/SDL . >> $LOGFILE 2>&1 || failure
-    fi
+    echo "Retrieving SDL $SDL_VERSION (this may take a while)..." | tee -a $LOGFILE
+    cd $ROOT/3rdparty || failure
+    wget https://www.libsdl.org/release/SDL2-$SDL_VERSION.tar.gz >> $LOGFILE 2>&1 || failure
+    tar -xzf SDL2-$SDL_VERSION.tar.gz >> $LOGFILE 2>&1 || failure
+    rm SDL2-$SDL_VERSION.tar.gz >> $LOGFILE 2>&1 || failure
+    # substitute old source tree
+    rm -rf sdl >> $LOGFILE 2>&1 || failure
+    mv SDL2-$SDL_VERSION sdl >> $LOGFILE 2>&1 || failure
 
     return 0
 }
-- 
GitLab