Commit 6b3f9c98 authored by Timothée Giet's avatar Timothée Giet

fix embedded build

parent c6bd6455
......@@ -345,20 +345,27 @@ add_custom_target(
DEPENDS ${MP3_FILES}
)
if(ANDROID)
set(GCOMPRIS_ASSETS_DIR ${GCOMPRIS_RCC_DIR}/../../../ CACHE INTERNAL "" FORCE)
else()
set(GCOMPRIS_ASSETS_DIR ${GCOMPRIS_RCC_DIR} CACHE INTERNAL "" FORCE)
endif()
# predownload assets (voices and images) and install them in the rcc folder
set(DOWNLOAD_ASSETS "" CACHE STRING "Download and packages images and voices. use a list like: words,en,fr,pt_BR to retrieve multiple files")
set(DOWNLOAD_ASSETS "" CACHE STRING "Download and packages images and voices. use a list like: words,en,fr,pt_BR,music to retrieve multiple files")
add_custom_command(
OUTPUT predownloadAssets
COMMAND python3 tools/download-assets.py ${DOWNLOAD_ASSETS} ${COMPRESSED_AUDIO} ${GCOMPRIS_RCC_DIR}
COMMAND python3 tools/download-assets.py ${DOWNLOAD_ASSETS} ${COMPRESSED_AUDIO} ${GCOMPRIS_ASSETS_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_command(
OUTPUT assetsFolders
COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2"
COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2/voices-${COMPRESSED_AUDIO}"
COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2/words"
)
OUTPUT assetsFolders
COMMAND cmake -E make_directory "${GCOMPRIS_ASSETS_DIR}/data2"
COMMAND cmake -E make_directory "${GCOMPRIS_ASSETS_DIR}/data2/voices-${COMPRESSED_AUDIO}"
COMMAND cmake -E make_directory "${GCOMPRIS_ASSETS_DIR}/data2/words"
COMMAND cmake -E make_directory "${GCOMPRIS_ASSETS_DIR}/data2/backgroundMusic"
)
# Install assets
add_custom_target(getAssets
DEPENDS assetsFolders predownloadAssets
......
......@@ -25,7 +25,7 @@
# Uncomment if this is not already done
# make getSvnTranslations
Qt5_BaseDIR=~/Qt5.4.2/5.4
Qt5_BaseDIR=~/Qt/5.12.6
export ANDROID_NDK_ROOT=$ANDROID_NDK
# The current version
......@@ -38,7 +38,7 @@ buildprefix=emb-$version
rm -f po/*@*
#
if [ ! -f gcompris.appdata.xml ]
if [ ! -f org.kde.gcompris.appdata.xml ]
then
echo "ERROR: Run me from the top level GCompris source dir"
exit 1
......@@ -53,7 +53,7 @@ download_assets=$1
# Param: ANDROID_ARCHITECTURE WITH_ACTIVATION_CODE DEMO_ONLY DOWNLOAD KIOSK_MODE DOWNLOAD_ASSETS
# DOWNLOAD_ASSETS: list of assets to bundle in the apk
# e.g: words,en,fr # This packages the large words rcc, the french and english voices
# e.g: words,en,fr,music # This packages the large words rcc, the french and english voices, and the music
f_cmake()
{
if [ $# != 6 ]
......@@ -71,17 +71,30 @@ f_cmake()
rm -rf CMakeFiles
fi
cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \
cmake -DCMAKE_TOOLCHAIN_FILE=~/ecm/share/ECM/toolchain/Android.cmake \
-DCMAKE_BUILD_TYPE=release \
-DANDROID_ARCHITECTURE=$1 \
-DQt5_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5 \
-DQt5Qml_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Qml \
-DQt5Network_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Network \
-DQt5Core_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Core \
-DQt5Quick_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Quick \
-DQt5Gui_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Gui \
-DQt5Multimedia_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Multimedia \
-DQt5Svg_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Svg \
-DQt5Widgets_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Widgets \
-DQt5Xml_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Xml \
-DQt5XmlPatterns_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5XmlPatterns \
-DQt5LinguistTools_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5LinguistTools \
-DQt5Sensors_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5Sensors \
-DQt5AndroidExtras_DIR=${Qt5_BaseDIR}/${QtTarget}/lib/cmake/Qt5AndroidExtras \
-Wno-dev \
-DQML_BOX2D_MODULE=submodule \
-DACTIVATION_MODE=$2 \
-DWITH_DEMO_ONLY=$3 \
-DWITH_DOWNLOAD=$4 \
-DWITH_KIOSK_MODE=$5 \
-DDOWNLOAD_ASSETS=$6 \
-DDOWNLOAD_ASSETS=$6 \
..
}
......@@ -100,5 +113,5 @@ make getAssets
make apk_release && make apk_signed && make apk_signed_aligned
# Remove extra apk
rm -f android/bin/*release-arm*
rm -f android/bin/*release-signed-arm*
rm -f android/*release-arm*
rm -f android/*release-signed-arm*
......@@ -27,11 +27,11 @@ def download_file(from_url, output_dir):
shutil.copyfileobj(response, out_file)
# argv[0]: program name
# argv[1]: assets to download (words, full for full rccs, locale to get correpsonding locale voices)
# argv[1]: assets to download (words, full for full rccs, music, locale to get corresponding locale voices)
# argv[2]: audio format (ogg, mp3, aac)
# argv[3]: output directory (rcc directory)
if len(sys.argv) != 4:
print("Usage: download-assets.py \"words,full,en,fr,pt_BR\" ogg/mp3/aac outputFolder")
print("Usage: download-assets.py \"words,full,music,en,fr,pt_BR\" ogg/mp3/aac outputFolder")
sys.exit(0)
"""Download the voices and words assets depending on the wanted audio format
......@@ -44,6 +44,7 @@ OUTPUT_FOLDER = sys.argv[3]+"/data2/"
ALL_LANGUAGES = [x.strip() for x in sys.argv[1].split(",") if len(x)]
DOWNLOAD_WORDS = "words" in ALL_LANGUAGES
DOWNLOAD_FULL = "full" in ALL_LANGUAGES
DOWNLOAD_MUSIC = "music" in ALL_LANGUAGES
if DOWNLOAD_WORDS:
ALL_LANGUAGES.remove("words")
download_file(DOWNLOAD_PATH+"words/words.rcc", OUTPUT_FOLDER+"words/")
......@@ -52,6 +53,10 @@ if DOWNLOAD_FULL:
ALL_LANGUAGES.remove("full")
download_file(DOWNLOAD_PATH+"full-"+AUDIO_FORMAT+".rcc", OUTPUT_FOLDER)
if DOWNLOAD_MUSIC:
ALL_LANGUAGES.remove("music")
download_file(DOWNLOAD_PATH+"backgroundMusic/backgroundMusic-"+AUDIO_FORMAT+".rcc", OUTPUT_FOLDER+"backgroundMusic/")
for lang in ALL_LANGUAGES:
lang_url = DOWNLOAD_PATH+"voices-"+AUDIO_FORMAT+"/voices-"+lang+".rcc"
download_file(lang_url, OUTPUT_FOLDER+"voices-"+AUDIO_FORMAT+"/")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment