"Fossies" - the Fresh Open Source Software Archive

Member "navit-0.5.6/scripts/build_android.sh" (6 Mar 2021, 2890 Bytes) of package /linux/privat/navit-0.5.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "build_android.sh": 0.5.5_vs_0.5.6.

    1 #!/bin/bash
    2 # Build Navit for Android.
    3 #
    4 # This script is to be run from the root of the Navit source tree. It is used by CircleCI as well as for local builds,
    5 # in order to keep build environments as uniform as possible and CI test results meaningful.
    6 #
    7 # It will build Navit for all processor architectures specified in navit/android/build.gradle.
    8 #
    9 # When running this script locally, ensure all build dependencies are in place:
   10 # - Packages required: cmake gettext libsaxonb-java librsvg2-bin pkg-config libprotobuf-c-dev protobuf-c-compiler
   11 # - Android SDK installed
   12 # - Environment variable $ANDROID_HOME points to Android SDK install location
   13 # - Android NDK and CMake components installed via
   14 #     sdkmanager ndk-bundle "cmake;3.6.4111459"
   15 #   (later CMake versions from the SDK repository may also work)
   16 #
   17 # If any of the build steps fails, this script aborts with an error immediately.
   18 
   19 echo Set up environment
   20 set -e
   21 export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin
   22 export JVM_OPTS="-Xmx3200m"
   23 export GRADLE_OPTS='-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
   24 
   25 BUILD_PATH="android-builddir"
   26 
   27 [ -d $BUILD_PATH ] || mkdir -p $BUILD_PATH
   28 pushd $BUILD_PATH
   29 
   30 # processing xml is messed up a bit after the original introduction of gradle
   31 # so require a useless install of ant here even if using gradle/ninja
   32 
   33 echo Run CMake
   34 test -z "$PKG_CONFIG_LIBDIR" && export PKG_CONFIG_LIBDIR=""     # Force cmake below to run ignore build host libraries when using pkgconfig.
   35 # Note: If you want to compile against specific target libraries that are searched using pkgconfig, please run this script with variable PKG_CONFIG_LIBDIR set to the appropriate path
   36 cmake ../ -Dvehicle/gpsd_dbus:BOOL=FALSE -Dsvg2png_scaling:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_nav:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_flag:STRING=-1,24,32,64,96 -DXSL_PROCESSING=y -DXSLTS=android -DANDROID=y -DDISABLE_CXX=y || exit 1
   37 
   38 echo Process icons
   39 pushd navit/icons
   40 make || exit 32
   41 rm -rf ../../android/res/drawable-nodpi
   42 mkdir -p ../../android/res/drawable-nodpi
   43 cp ./*.png ../../android/res/drawable-nodpi
   44 pushd ../../android/res/drawable-nodpi
   45 rename -f 'y/A-Z/a-z/' ./*.png
   46 popd
   47 popd
   48 
   49 echo Process translations
   50 pushd po
   51 make || exit 64
   52 rm -rf ../android/res/raw
   53 mkdir -p ../android/res/raw
   54 cp ./*.mo ../android/res/raw
   55 pushd ../android/res/raw
   56 rename -f 'y/A-Z/a-z/' ./*.mo
   57 popd
   58 popd
   59 
   60 
   61 
   62 echo Process xml config files
   63 make navit_config_xml || exit 96
   64 rm -rf ./android/assets
   65 mkdir -p ./android/assets
   66 cp -R ./navit/config ./android/assets/
   67 
   68 #run gradle from root dir, not $BUILD_PATH
   69 popd
   70 
   71 echo Chmod permissions
   72 chmod a+x ./gradlew
   73 
   74 echo Download dependencies
   75 ./gradlew -v
   76 
   77 echo Build
   78 ./gradlew assembleDebug || exit 128
   79 
   80 echo Build finished.
   81 echo APK should be in "navit/android/build/outputs/apk" and can be installed with
   82 echo ./gradlew installDebug
   83