fixed setup option position when using narrow font
[rocksndiamonds.git] / build-projects / android / build-scripts / create_sdl.sh
1 #!/bin/bash
2
3 JNI_DIR="app/jni"
4
5 ANDROID_MK_SDL_IMAGE="$JNI_DIR/SDL2_image/Android.mk"
6 ANDROID_MK_SDL_MIXER="$JNI_DIR/SDL2_mixer/Android.mk"
7
8 SDL_BASE_URL="https://www.libsdl.org"
9 SDL_VERSIONS=`cat SDL_VERSIONS`
10
11 for i in $SDL_VERSIONS; do
12     SDL_SUBDIR=`echo $i | sed -e "s/-.*//"`
13     SDL_SUBURL=`echo $SDL_SUBDIR | tr -d '2'`
14
15     if [ -d "$JNI_DIR/$SDL_SUBDIR" ]; then
16         continue;
17     fi
18
19     if [ "$SDL_SUBURL" = "SDL" ]; then
20         SDL_RELEASE_DIR="release"
21     else
22         SDL_RELEASE_DIR="projects/$SDL_SUBURL/release"
23     fi
24
25     SDL_URL="$SDL_BASE_URL/$SDL_RELEASE_DIR/$i.tar.gz"
26
27     wget -O - "$SDL_URL" | (cd "$JNI_DIR" && tar xzf -)
28
29     if [ "$?" != "0" ]; then
30         echo "ERROR: Installing '$i' failed!"
31         exit 10
32     fi
33
34     mv "$JNI_DIR/$i" "$JNI_DIR/$SDL_SUBDIR"
35 done
36
37 if [ ! -f "$ANDROID_MK_SDL_IMAGE.dist" ]; then
38     cp -a "$ANDROID_MK_SDL_IMAGE" "$ANDROID_MK_SDL_IMAGE.dist"
39     cat "$ANDROID_MK_SDL_IMAGE.dist"                                    \
40         | sed -e "s/^SUPPORT_JPG ?= true/SUPPORT_JPG ?= false/" \
41         | sed -e "s/^SUPPORT_WEBP ?= true/SUPPORT_WEBP ?= false/"       \
42         > "$ANDROID_MK_SDL_IMAGE"
43 fi
44
45 if [ ! -f "$ANDROID_MK_SDL_MIXER.dist" ]; then
46     cp -a "$ANDROID_MK_SDL_MIXER" "$ANDROID_MK_SDL_MIXER.dist"
47     cat "$ANDROID_MK_SDL_MIXER.dist"                                    \
48         | sed -e "s/^SUPPORT_OGG ?= true/SUPPORT_OGG ?= false/" \
49         | sed -e "s/^SUPPORT_FLAC ?= true/SUPPORT_FLAC ?= false/"       \
50         | sed -e "s/^LOCAL_CFLAGS :=/LOCAL_CFLAGS := -DMUSIC_WAV/"      \
51         > "$ANDROID_MK_SDL_MIXER"
52 fi
53
54 exit 0