summaryrefslogtreecommitdiffstats
path: root/Necessitas_SDK/build_sdk.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Necessitas_SDK/build_sdk.sh')
-rwxr-xr-xNecessitas_SDK/build_sdk.sh772
1 files changed, 448 insertions, 324 deletions
diff --git a/Necessitas_SDK/build_sdk.sh b/Necessitas_SDK/build_sdk.sh
index 7f02fa8..8176055 100755
--- a/Necessitas_SDK/build_sdk.sh
+++ b/Necessitas_SDK/build_sdk.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
# Copyright (c) 2011, BogDan Vatra <bog_dan_ro@yahoo.com>
# Copyright (c) 2011, Ray Donnelly <mingw.android@gmail.com>
@@ -21,6 +21,11 @@
. sdk_vars.sh
+function help
+{
+ echo "Help"
+}
+
while getopts "h:c:" arg; do
case $arg in
h)
@@ -52,27 +57,32 @@ if [ "$OSTYPE" = "darwin9.0" -o "$OSTYPE" = "darwin10.0" ]; then
# On Mac OS X, user accounts don't have write perms for /var, same is true for Ubuntu.
sudo mkdir -p $TEMP_PATH
sudo chmod 777 $TEMP_PATH
- sudo mkdir -p $TEMP_PATH_PREFIX/www
- sudo chmod 777 $TEMP_PATH_PREFIX/www
+ sudo mkdir -p $TEMP_PATH/out
+ sudo chmod 777 $TEMP_PATH/out
STRIP="strip -S"
CPRL="cp -RL"
else
- mkdir -p $TEMP_PATH
+ mkdir -p $TEMP_PATH/out/necessitas
STRIP="strip -s"
CPRL="cp -rL"
fi
+. sdk_cleanup.sh
+
# Global just because 2 functions use them, only acceptable values for GDB_VER are 7.2 and 7.3
-#GDB_VER=7.3
-GDB_VER=7.2
+GDB_VER=7.3
+#GDB_VER=7.2
pushd $TEMP_PATH
-MINISTRO_REPO_PATH=$TEMP_PATH_PREFIX/www/necessitas/qt
-REPO_PATH=$TEMP_PATH_PREFIX/www/necessitas/sdk
-REPO_PATH_PACKAGES=$REPO_SRC_PATH/packages
-# TODO :: Ask BogDan what this was here for
-# cp -a $REPO_PATH_PACKAGES $TEMP_PATH_PREFIX/www/necessitas/sdk_src
+MINISTRO_REPO_PATH=$TEMP_PATH/out/necessitas/qt/$CHECKOUT_BRANCH
+REPO_PATH=$TEMP_PATH/out/necessitas/sdk
+if [ ! -d $TEMP_PATH/out/necessitas/sdk_src/org.kde.necessitas ]
+then
+ mkdir -p $TEMP_PATH/out/necessitas/sdk_src
+ cp -a $REPO_SRC_PATH/packages/* $TEMP_PATH/out/necessitas/sdk_src/
+fi
+REPO_PATH_PACKAGES=$TEMP_PATH/out/necessitas/sdk_src
STATIC_QT_PATH=""
SHARED_QT_PATH=""
SDK_TOOLS_PATH=""
@@ -104,7 +114,7 @@ else
JOBS=`sysctl -n hw.ncpu`
JOBS=`expr $JOBS + 2`
else
- HOST_CFG_OPTIONS=" -platform linux-g++ "
+ HOST_CFG_OPTIONS=" -platform linux-g++ -arch i386"
HOST_TAG=linux-x86
HOST_TAG_NDK=linux-x86
SHLIB_EXT=.so
@@ -119,6 +129,21 @@ function error_msg
exit 1
}
+function createArchive # params $1 folder, $2 archive name, $3 extra params
+{
+ if [ $EXTERNAL_7Z != "" ]
+ then
+ EXTRA_PARAMS=""
+ if [ $HOST_TAG = "windows" ]
+ then
+ EXTRA_PARAMS="-l"
+ fi
+ $EXTERNAL_7Z $EXTERNAL_7Z_PARAMS -mmt=$JOBS $EXTRA_PARAMS $3 $2 $1 || error_msg "Can't create archive $EXTERNAL_7Z $EXTERNAL_7Z_PARAMS -mmt=$JOBS $2 $1"
+ else
+ $SDK_TOOLS_PATH/archivegen $1 $2
+ fi
+}
+
function removeAndExit
{
rm -fr $1 && error_msg "Can't download $1"
@@ -164,7 +189,7 @@ function doMake
done
echo $2>all_done
else
- make -j$JOBS || error_msg $1
+ make -j$JOBS $4|| error_msg $1
echo $2>all_done
fi
}
@@ -213,20 +238,13 @@ function doSed
fi
}
-function downloadLighthouseSource
-{
- mkdir -p Android/Qt/$NECESSITAS_QT_VERSION_SHORT
- pushd Android/Qt/$NECESSITAS_QT_VERSION_SHORT
- if [ ! -d qt-src ]
- then
- git clone git://anongit.kde.org/android-qt.git qt-src|| error_msg "Can't clone android-qt"
- fi
+function cloneCheckoutKDEGitRepo #params $1 repo name, $2 branch
+{
pushd qt-src
- git checkout $CHECKOUT_BRANCH
+ git checkout $2
git pull
popd
- popd # Android/Qt/$NECESSITAS_QT_VERSION_SHORT
}
# $1 is either -d (debug build) or nothing.
@@ -234,53 +252,18 @@ function prepareHostQt
{
# download, compile & install qt, it is used to compile the installer
HOST_QT_CONFIG=$1
- if [ ! "$HOST_QT_VERSION" = "lighthouse" ]
+ if [ ! -d qt-src ]
then
-# if [ "$OSTYPE" = "msys" -o "$OSTYPE" = "darwin9.0" -o "$OSTYPE" = "darwin10.0" ]
- if [ "1" = "1" ]
- then
- if [ ! -d $HOST_QT_SRCDIR ]
- then
- git clone git://gitorious.org/~mingwandroid/qt/mingw-android-official-qt.git $HOST_QT_SRCDIR || error_msg "Can't clone mingw qt"
- pushd $HOST_QT_SRCDIR
- if [ "$HOST_QT_BRANCH" = "4.8" ] ; then
- # TODORMD :: Ask BogDan how to get it setup so "git checkout -b $HOST_QT_BRANCH" works for my 4.8 branch.
- git checkout -b 4.8 refs/remotes/origin/4.8
- else
- git checkout -b $HOST_QT_BRANCH
- fi
- popd
- fi
- else
- if [ "$OSTYPE" = "msys" ] ; then
- HOST_QT_SRC_ARCHIVE=$HOST_QT_VERSION_DL.zip
- downloadIfNotExists HOST_QT_SRC_ARCHIVE http://get.qt.nokia.com/qt/source/$HOST_QT_SRC_ARCHIVE
- if [ ! -d $HOST_QT_VERSION ]
- then
- unzip $HOST_QT_SRC_ARCHIVE || error_msg "Can't unzip $HOST_QT_SRC_ARCHIVE"
- fi
- else
- HOST_QT_SRC_ARCHIVE=$HOST_QT_VERSION_DL.tar.gz
- downloadIfNotExists HOST_QT_SRC_ARCHIVE http://get.qt.nokia.com/qt/source/$HOST_QT_SRC_ARCHIVE
- if [ ! -d $HOST_QT_VERSION ]
- then
- tar -xzvf $HOST_QT_SRC_ARCHIVE || error_msg "Can't untar $HOST_QT_SRC_ARCHIVE"
- fi
- fi
- fi
- else
- downloadLighthouseSource
+ git clone git://anongit.kde.org/android-qt.git qt-src|| error_msg "Can't clone ${1}"
+ pushd qt-src
+ git config --add remote.origin.fetch +refs/upstream/*:refs/remotes/upstream/*
+ git fetch
+ popd
fi
- #build qt statically, needed by Sdk installer
- if [ "$HOST_QT_VERSION" = "lighthouse" ] ; then
- HOST_QT_SRCDIR=lighthouse
- fi
- mkdir b-$HOST_QT_SRCDIR-st$HOST_QT_CONFIG
- pushd b-$HOST_QT_SRCDIR-st$HOST_QT_CONFIG
- OPTS_CFG=" -developer-build "
+ export QT_SRCDIR=$PWD/qt-src
+
if [ "$HOST_QT_CONFIG" = "-d" ] ; then
- STATIC_QT_PATH_DEBUG=$PWD
if [ "$OSTYPE" = "msys" ] ; then
OPTS_CFG=" -debug "
HOST_QT_CFG="CONFIG+=debug"
@@ -291,22 +274,23 @@ function prepareHostQt
fi
fi
else
- STATIC_QT_PATH=$PWD
- STATIC_QT_PATH_DEBUG=$PWD
- if [ "$OSTYPE" = "msys" -o "$OSTYPE" = "darwin9.0" -o "$OSTYPE" = "darwin10.0" ] ; then
- OPTS_CFG=" -release "
- HOST_QT_CFG="CONFIG+=release"
- fi
+ OPTS_CFG=" -release "
+ HOST_QT_CFG="CONFIG+=release QT+=network"
fi
+
+
# Even on Linux, static Qt 4.8 doesn't build!
+ mkdir static-build$HOST_QT_CONFIG
+ pushd static-build$HOST_QT_CONFIG
+ STATIC_QT_PATH=$PWD
if [ ! -f all_done ]
then
+ pushd $QT_SRCDIR
+ git checkout $HOST_QT_BRANCH
+ git pull
+ popd
rm -fr *
- if [ "$HOST_QT_VERSION" = "lighthouse" ] ; then
- ../Android/Qt/4762/qt-src/configure -fast -nomake examples -nomake demos -nomake tests -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -static -no-phonon -no-dbus -no-opengl -no-qt3support -no-xmlpatterns -no-svg -qt-sql-sqlite -plugin-sql-sqlite -confirm-license $HOST_CFG_OPTIONS $HOST_CFG_OPTIONS_STATIC $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
- else
- ../$HOST_QT_SRCDIR/configure -fast -nomake examples -nomake demos -nomake tests -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -static -no-phonon -no-dbus -no-opengl -no-qt3support -no-xmlpatterns -no-svg -qt-sql-sqlite -plugin-sql-sqlite -confirm-license $HOST_CFG_OPTIONS $HOST_CFG_OPTIONS_STATIC $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
- fi
+ $QT_SRCDIR/configure -fast -nomake examples -nomake demos -nomake tests -qt-zlib -no-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -static -no-webkit -no-phonon -no-dbus -no-opengl -no-qt3support -no-xmlpatterns -no-svg -confirm-license $HOST_CFG_OPTIONS $HOST_CFG_OPTIONS_STATIC $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
doMake "Can't compile static $HOST_QT_VERSION" "all done" ma-make
if [ "$OSTYPE" = "msys" ]; then
# Horrible; need to fix this properly.
@@ -318,17 +302,17 @@ function prepareHostQt
popd
#build qt shared, needed by QtCreator
- mkdir b-$HOST_QT_SRCDIR-sh$HOST_QT_CONFIG
- pushd b-$HOST_QT_SRCDIR-sh$HOST_QT_CONFIG
+ mkdir shared-build$HOST_QT_CONFIG
+ pushd shared-build$HOST_QT_CONFIG
SHARED_QT_PATH=$PWD
if [ ! -f all_done ]
then
+ pushd $QT_SRCDIR
+ git checkout $HOST_QT_BRANCH
+ git pull
+ popd
rm -fr *
- if [ "$HOST_QT_VERSION" = "lighthouse" ] ; then
- ../Android/Qt/4762/qt-src/configure -fast -nomake examples -nomake demos -nomake tests -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -shared -webkit -no-phonon -qt-sql-sqlite -plugin-sql-sqlite -no-qt3support -confirm-license $HOST_CFG_OPTIONS $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
- else
- ../$HOST_QT_SRCDIR/configure -fast -nomake examples -nomake demos -nomake tests -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -shared -webkit -no-phonon -qt-sql-sqlite -plugin-sql-sqlite -no-qt3support -confirm-license $HOST_CFG_OPTIONS $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
- fi
+ $QT_SRCDIR/configure $HOST_CFG_OPTIONS -fast -nomake examples -nomake demos -nomake tests -system-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -opensource -shared -webkit -no-phonon -qt-sql-sqlite -plugin-sql-sqlite -no-qt3support -confirm-license $HOST_CFG_OPTIONS $OPTS_CFG -host-little-endian --prefix=$PWD || error_msg "Can't configure $HOST_QT_VERSION"
doMake "Can't compile shared $HOST_QT_VERSION" "all done" ma-make
if [ "$OSTYPE" = "msys" ]; then
# Horrible; need to fix this properly.
@@ -338,23 +322,24 @@ function prepareHostQt
fi
fi
popd
+
}
function prepareSdkInstallerTools
{
# get installer source code
- SDK_TOOLS_PATH=$PWD/necessitas-installer-framework-$HOST_QT_BRANCH$HOST_QT_CONFIG/installerbuilder/bin
- if [ ! -d necessitas-installer-framework-$HOST_QT_BRANCH$HOST_QT_CONFIG ]
+ SDK_TOOLS_PATH=$PWD/necessitas-installer-framework/installerbuilder/bin
+ if [ ! -d necessitas-installer-framework ]
then
- git clone git://gitorious.org/~taipan/qt-labs/necessitas-installer-framework.git necessitas-installer-framework-$HOST_QT_BRANCH$HOST_QT_CONFIG || error_msg "Can't clone necessitas-installer-framework"
+ git clone git://gitorious.org/~taipan/qt-labs/necessitas-installer-framework.git necessitas-installer-framework || error_msg "Can't clone necessitas-installer-framework"
fi
- pushd necessitas-installer-framework-$HOST_QT_BRANCH$HOST_QT_CONFIG/installerbuilder
+ pushd necessitas-installer-framework/installerbuilder
git checkout $CHECKOUT_BRANCH
git pull
if [ ! -f all_done ]
then
- $STATIC_QT_PATH_DEBUG/bin/qmake CONFIG+=static $HOST_QT_CFG $HOST_QM_CFG_OPTIONS -r || error_msg "Can't configure necessitas-installer-framework"
+ $STATIC_QT_PATH/bin/qmake CONFIG+=static $HOST_QT_CFG $HOST_QM_CFG_OPTIONS -r || error_msg "Can't configure necessitas-installer-framework"
doMake "Can't compile necessitas-installer-framework" "all done" ma-make
fi
popd
@@ -380,8 +365,9 @@ function prepareNecessitasQtCreator
pushd $QTC_PATH
QTC_INST_PATH=$PWD/QtCreator$HOST_QT_CONFIG
if [ ! -f all_done ] ; then
- git checkout 2.3-necessitas
+ git checkout unstable
git pull
+ export UPDATEINFO_DISABLE=false
$SHARED_QT_PATH/bin/qmake $HOST_QT_CFG $HOST_QM_CFG_OPTIONS -r || error_msg "Can't configure android-qt-creator"
doMake "Can't compile $QTC_PATH" "all done" ma-make
fi
@@ -389,18 +375,18 @@ function prepareNecessitasQtCreator
export INSTALL_ROOT=$QTC_INST_PATH
make install
- #download and install sdk-updater-plugin
- export QTC_SOURCE=$PWD
- downloadIfNotExists research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz http://android-lighthouse.googlecode.com/files/research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz
- if [ ! -d research-sdk-updater-plugin-master-snapshot-20110524185306 ]
- then
- tar xvfz research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz
- fi
- pushd research-sdk-updater-plugin-master-snapshot-20110524185306
- $SHARED_QT_PATH/bin/qmake $HOST_QT_CFG $HOST_QM_CFG_OPTIONS -r || error_msg "Can't configure sdk-updater-plugin"
- doMake "Can't compile sdk-updater-plugin" "all done" ma-make
- make install
- popd
+# #download and install sdk-updater-plugin
+# export QTC_SOURCE=$PWD
+# downloadIfNotExists research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz http://android-lighthouse.googlecode.com/files/research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz
+# if [ ! -d research-sdk-updater-plugin-master-snapshot-20110524185306 ]
+# then
+# tar xvfz research-sdk-updater-plugin-master-snapshot-20110524185306-updated.tar.gz
+# fi
+# pushd research-sdk-updater-plugin-master-snapshot-20110524185306
+# $SHARED_QT_PATH/bin/qmake $HOST_QT_CFG $HOST_QM_CFG_OPTIONS -r || error_msg "Can't configure sdk-updater-plugin"
+# doMake "Can't compile sdk-updater-plugin" "all done" ma-make
+# make install
+# popd
mkdir -p $QTC_INST_PATH/Qt/imports
mkdir -p $QTC_INST_PATH/Qt/plugins
@@ -452,7 +438,7 @@ function prepareNecessitasQtCreator
find . -name "*$SHLIB_EXT" | xargs $STRIP
fi
popd
- $SDK_TOOLS_PATH/archivegen QtCreator$HOST_QT_CONFIG qtcreator-${HOST_TAG}${HOST_QT_CONFIG}.7z
+ createArchive QtCreator$HOST_QT_CONFIG qtcreator-${HOST_TAG}${HOST_QT_CONFIG}.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.tools.qtcreator/data
mv qtcreator-${HOST_TAG}${HOST_QT_CONFIG}.7z $REPO_PATH_PACKAGES/org.kde.necessitas.tools.qtcreator/data/qtcreator-${HOST_TAG}${HOST_QT_CONFIG}.7z
popd
@@ -566,7 +552,7 @@ function prepareNDKs
downloadIfNotExists android-ndk-${ANDROID_NDK_VERSION}-windows.zip http://dl.google.com/android/ndk/android-ndk-${ANDROID_NDK_VERSION}-windows.zip
rm -fr android-ndk-${ANDROID_NDK_VERSION}
unzip android-ndk-${ANDROID_NDK_VERSION}-windows.zip
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-windows.7z
+ createArchive android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-windows.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data
mv android-ndk-${ANDROID_NDK_VERSION}-windows.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_VERSION}-windows.7z
rm -fr android-ndk-${ANDROID_NDK_VERSION}
@@ -578,7 +564,7 @@ function prepareNDKs
downloadIfNotExists android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.tar.bz2 http://dl.google.com/android/ndk/android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.tar.bz2
rm -fr android-ndk-${ANDROID_NDK_VERSION}
tar xjvf android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.tar.bz2
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.7z
+ createArchive android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data
mv android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_VERSION}-darwin-x86.7z
rm -fr android-ndk-${ANDROID_NDK_VERSION}
@@ -590,67 +576,79 @@ function prepareNDKs
downloadIfNotExists android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2 http://dl.google.com/android/ndk/android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2
rm -fr android-ndk-${ANDROID_NDK_VERSION}
tar xjvf android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z
+ createArchive android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data
mv android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z
rm -fr android-ndk-${ANDROID_NDK_VERSION}
fi
- # mingw android NDKs are only r6 for now, not r6b.
- # repack mingw android windows NDK
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z ]
- then
- downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z
-# cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z .
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z
- mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
- mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- fi
-
- # repack mingw android mac NDK
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z ]
- then
- downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z
-# cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z .
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z
- mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
- mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- fi
-
- # repack mingw android linux-x86 NDK
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z ]
- then
- downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z
-# cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z .
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z
- mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
- mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z
- rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
- fi
-
- export ANDROID_NDK_HOST=$HOST_TAG_NDK
- if [ "$USE_MA_NDK" = "0" ]; then
- USED_ANDROID_NDK_VERSION=r6b
- else
- USED_ANDROID_NDK_VERSION=r6
- fi
-
- if [ $BUILD_ANDROID_GIT_NDK = 1 ]
- then
- export ANDROID_NDK_ROOT=$PWD/android-ndk-${ANDROID_NDK_VERSION}-git
- export ANDROID_NDK_FOLDER_NAME=android-ndk-${ANDROID_NDK_VERSION}-git
- else
- export ANDROID_NDK_ROOT=$PWD/android-ndk-${USED_ANDROID_NDK_VERSION}
- export ANDROID_NDK_FOLDER_NAME=android-ndk-${USED_ANDROID_NDK_VERSION}
- fi
+# TODO Ray should uncomment/review it when Linaro toolchain is ready
+# if [ $BUILD_ANDROID_GIT_NDK = 1 ]
+# then
+# downloadIfNotExists android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2 http://dl.google.com/android/ndk/android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2
+# rm -fr android-ndk-${ANDROID_NDK_VERSION}
+# tar xjvf android-ndk-${ANDROID_NDK_VERSION}-linux-x86.tar.bz2
+# $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_VERSION} android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z
+# mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data
+# mv android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_VERSION}-linux-x86.7z
+# rm -fr android-ndk-${ANDROID_NDK_VERSION}
+# fi
+#
+# # mingw android NDKs are only r6 for now, not r6b.
+# # repack mingw android windows NDK
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z ]
+# then
+# downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z
+# # cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z .
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-windows.7z
+# $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z
+# mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
+# mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-windows.7z
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# fi
+#
+# # repack mingw android mac NDK
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z ]
+# then
+# downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z
+# # cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z .
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-darwin-x86.7z
+# $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z
+# mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
+# mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-darwin-x86.7z
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# fi
+#
+# # repack mingw android linux-x86 NDK
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z ]
+# then
+# downloadIfNotExists android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z http://mingw-and-ndk.googlecode.com/files/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z
+# # cp $REPO_SRC_PATH/ndk-packages/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z .
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# 7za x android-ndk-${ANDROID_NDK_MAJOR_VERSION}-gdb-7.3.50.20110709-linux-x86.7z
+# $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_MAJOR_VERSION} android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z
+# mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data
+# mv android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.ma_${ANDROID_NDK_MAJOR_VERSION}/data/android-ndk-${ANDROID_NDK_MAJOR_VERSION}-ma-linux-x86.7z
+# rm -fr android-ndk-${ANDROID_NDK_MAJOR_VERSION}
+# fi
+#
+# export ANDROID_NDK_HOST=$HOST_TAG_NDK
+# if [ "$USE_MA_NDK" = "0" ]; then
+# ANDROID_NDK_VERSION=r6b
+# else
+# ANDROID_NDK_VERSION=r6
+# fi
+#
+# if [ $BUILD_ANDROID_GIT_NDK = 1 ]
+# then
+# export ANDROID_NDK_ROOT=$PWD/android-ndk-${ANDROID_NDK_VERSION}-git
+# export ANDROID_NDK_FOLDER_NAME=android-ndk-${ANDROID_NDK_VERSION}-git
+# else
+ export ANDROID_NDK_ROOT=$PWD/android-ndk-${ANDROID_NDK_VERSION}
+ export ANDROID_NDK_FOLDER_NAME=android-ndk-${ANDROID_NDK_VERSION}
+# fi
if [ ! -d $ANDROID_NDK_FOLDER_NAME ]; then
if [ "$USE_MA_NDK" = "0" ]; then
@@ -697,7 +695,7 @@ function prepareNDKs
popd
rm -fr android_git_ndk
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_VERSION}_git/data
- $SDK_TOOLS_PATH/archivegen android-ndk-${ANDROID_NDK_VERSION}-git $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_VERSION}_git/data/android-ndk-${ANDROID_NDK_VERSION}-git-${HOST_TAG_NDK}.7z
+ createArchive android-ndk-${ANDROID_NDK_VERSION}-git $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ndk.${ANDROID_NDK_VERSION}_git/data/android-ndk-${ANDROID_NDK_VERSION}-git-${HOST_TAG_NDK}.7z
fi
fi
@@ -880,14 +878,15 @@ function prepareGDB
OLDPATH=$PATH
export PATH=$install_dir/bin/:$PATH
if [ -z $GDB_TARG_HOST_TAG ] ; then
- CC=$CC32 CXX=$CXX32 CFLAGS="-O0 -g" $GDB_ROOT_PATH/configure --enable-initfini-array --enable-gdbserver=no --enable-tui=yes --with-sysroot=$TEMP_PATH/android-ndk-${USED_ANDROID_NDK_VERSION}/platforms/android-9/arch-arm --with-python=$install_dir --with-expat=yes --with-libexpat-prefix=$install_dir --prefix=$target_dir --target=arm-elf-linux --host=$HOST --build=$HOST --disable-nls
+ CC=$CC32 CXX=$CXX32 CFLAGS="-O0 -g" $GDB_ROOT_PATH/configure --enable-initfini-array --enable-gdbserver=no --enable-tui=yes --with-sysroot=$TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION}/platforms/android-9/arch-arm --with-python=$install_dir --with-expat=yes --with-libexpat-prefix=$install_dir --prefix=$target_dir --target=arm-elf-linux --host=$HOST --build=$HOST --disable-nls
else
CC=$CC32 CXX=$CXX32 $GDB_ROOT_PATH/configure --enable-initfini-array --enable-gdbserver=no --enable-tui=yes --with-python=$install_dir --with-expat=yes --with-libexpat-prefix=$install_dir --prefix=$target_dir --target=$HOST --host=$HOST --build=$HOST --disable-nls
fi
doMake "Can't compile android gdb $GDB_VER" "all done"
cp -a gdb/gdb$EXE_EXT $target_dir/
- cp -a gdb/gdbtui$EXE_EXT $target_dir/
-# $STRIP $target_dir/gdb$EXE_EXT .. Just while I fix native host GDB (can't debug the installer exe) and thumb-2 issues.
+# cp -a gdb/gdbtui$EXE_EXT $target_dir/
+ $STRIP $target_dir/gdb$EXE_EXT # .. Just while I fix native host GDB (can't debug the installer exe) and thumb-2 issues.
+# $STRIP $target_dir/gdbtui$EXE_EXT # .. Just while I fix native host GDB (can't debug the installer exe) and thumb-2 issues.
export PATH=$OLDPATH
popd
fi
@@ -902,7 +901,7 @@ function prepareGDB
find . -name tests | xargs rm -fr
popd
- $SDK_TOOLS_PATH/archivegen $GDB_FLDR_NAME $GDB_PKG_NAME.7z
+ createArchive $GDB_FLDR_NAME $GDB_PKG_NAME.7z
mkdir -p $package_path
mv $GDB_PKG_NAME.7z $package_path/
@@ -937,11 +936,11 @@ function prepareGDBServer
pushd gdb-src/build-gdbserver-$GDB_VER
mkdir android-sysroot
- $CPRL $TEMP_PATH/android-ndk-${USED_ANDROID_NDK_VERSION}/platforms/android-9/arch-arm/* android-sysroot/ || error_msg "Can't copy android sysroot"
+ $CPRL $TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION}/platforms/android-9/arch-arm/* android-sysroot/ || error_msg "Can't copy android sysroot"
rm -f android-sysroot/usr/lib/libthread_db*
rm -f android-sysroot/usr/include/thread_db.h
- TOOLCHAIN_PREFIX=$TEMP_PATH/android-ndk-${USED_ANDROID_NDK_VERSION}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$HOST_TAG_NDK/bin/arm-linux-androideabi
+ TOOLCHAIN_PREFIX=$TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$HOST_TAG_NDK/bin/arm-linux-androideabi
OLD_CC="$CC"
OLD_CFLAGS="$CFLAGS"
@@ -956,7 +955,7 @@ function prepareGDBServer
export LDFLAGS="-static -Wl,-z,nocopyreloc -Wl,--no-undefined $PWD/android-sysroot/usr/lib/crtbegin_static.o -lc -lm -lgcc -lc $PWD/android-sysroot/usr/lib/crtend_android.o"
fi
- LIBTHREAD_DB_DIR=$TEMP_PATH/android-ndk-${USED_ANDROID_NDK_VERSION}/sources/android/libthread_db/gdb-7.1.x
+ LIBTHREAD_DB_DIR=$TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION}/sources/android/libthread_db/gdb-7.1.x
cp $LIBTHREAD_DB_DIR/thread_db.h android-sysroot/usr/include/
$TOOLCHAIN_PREFIX-gcc$EXE_EXT --sysroot=$PWD/android-sysroot -o $PWD/android-sysroot/usr/lib/libthread_db.a -c $LIBTHREAD_DB_DIR/libthread_db.c || error_msg "Can't compile android threaddb"
$GDB_ROOT_PATH/gdb/gdbserver/configure --host=arm-eabi-linux --with-libthread-db=$PWD/android-sysroot/usr/lib/libthread_db.a || error_msg "Can't configure gdbserver"
@@ -973,7 +972,7 @@ function prepareGDBServer
cp gdbserver $PWD/gdbserver-$GDB_VER/gdbserver
fi
- $SDK_TOOLS_PATH/archivegen gdbserver-$GDB_VER gdbserver-$GDB_VER.7z
+ createArchive gdbserver-$GDB_VER gdbserver-$GDB_VER.7z
mkdir -p $package_path
mv gdbserver-$GDB_VER.7z $package_path/
@@ -982,22 +981,6 @@ function prepareGDBServer
popd #gdb-build
}
-function repackSDK
-{
- package_name=${4//-/_} # replace - with _
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z ]
- then
- downloadIfNotExists $1.zip http://dl.google.com/android/repository/$1.zip
- unzip $1.zip
- mkdir -p $3
- mv $1 $3/$4
- $SDK_TOOLS_PATH/archivegen $3 $2.7z
- mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data
- mv $2.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z
- rm -fr $3
- fi
-}
-
function prepareGDBVersion
{
GDB_VER=$1
@@ -1020,46 +1003,82 @@ function prepareGDBVersion
fi
}
+function repackSDK
+{
+ package_name=${4//-/_} # replace - with _
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z ]
+ then
+ downloadIfNotExists $1.zip http://dl.google.com/android/repository/$1.zip
+ rm -fr temp_repack
+ mkdir temp_repack
+ pushd temp_repack
+ unzip ../$1.zip
+ mv * temp_name
+ mkdir -p $3
+ mv temp_name $3/$4
+ createArchive $3 $2.7z
+ mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data
+ mv $2.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z
+ popd
+ rm -fr temp_repack
+ fi
+}
+
+function repackSDKPlatform-tools
+{
+ package_name=${4//-/_} # replace - with _
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z ]
+ then
+ downloadIfNotExists $1.zip http://dl.google.com/android/repository/$1.zip
+ rm -fr android-sdk
+ unzip $1.zip
+ mkdir -p $3
+ mv $4 $3/$4
+ createArchive $3 $2.7z
+ mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data
+ mv $2.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.$package_name/data/$2.7z
+ rm -fr $3
+ fi
+}
+
+
function prepareSDKs
{
echo "prepare SDKs"
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-linux_x86.7z ]
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-linux.7z ]
then
- downloadIfNotExists android-sdk_${ANDROID_SDK_VERSION}-linux_x86.tgz http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-linux_x86.tgz
- if [ ! -d android-sdk-linux_x86 ]
- then
- tar -xzvf android-sdk_${ANDROID_SDK_VERSION}-linux_x86.tgz
- fi
- $SDK_TOOLS_PATH/archivegen android-sdk-linux_x86 android-sdk_${ANDROID_SDK_VERSION}-linux_x86.7z
+ rm -fr android-sdk
+ downloadIfNotExists android-sdk_${ANDROID_SDK_VERSION}-linux.tgz http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-linux.tgz
+ tar -xzvf android-sdk_${ANDROID_SDK_VERSION}-linux.tgz
+ mv android-sdk-linux android-sdk
+ createArchive android-sdk android-sdk_${ANDROID_SDK_VERSION}-linux.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data
- mv android-sdk_${ANDROID_SDK_VERSION}-linux_x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-linux_x86.7z
- rm -fr android-sdk-linux_x86
+ mv android-sdk_${ANDROID_SDK_VERSION}-linux.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-linux.7z
+ rm -fr android-sdk
fi
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-mac_x86.7z ]
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-macosx.7z ]
then
- downloadIfNotExists android-sdk_${ANDROID_SDK_VERSION}-mac_x86.zip http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-mac_x86.zip
- if [ ! -d android-sdk-mac_x86 ]
- then
- unzip android-sdk_${ANDROID_SDK_VERSION}-mac_x86.zip
- fi
- $SDK_TOOLS_PATH/archivegen android-sdk-mac_x86 android-sdk_${ANDROID_SDK_VERSION}-mac_x86.7z
+ rm -fr android-sdk
+ downloadIfNotExists android-sdk_${ANDROID_SDK_VERSION}-macosx.zip http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-macosx.zip
+ unzip android-sdk_${ANDROID_SDK_VERSION}-macosx.zip
+ mv android-sdk-macosx android-sdk
+ createArchive android-sdk android-sdk_${ANDROID_SDK_VERSION}-macosx.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data
- mv android-sdk_${ANDROID_SDK_VERSION}-mac_x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-mac_x86.7z
- rm -fr android-sdk-mac_x86
+ mv android-sdk_${ANDROID_SDK_VERSION}-macosx.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-macosx.7z
+ rm -fr android-sdk
fi
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-windows.7z ]
then
+ rm -fr android-sdk
downloadIfNotExists android-sdk_${ANDROID_SDK_VERSION}-windows.zip http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-windows.zip
- if [ ! -d android-sdk-windows ]
- then
- unzip android-sdk_${ANDROID_SDK_VERSION}-windows.zip
- fi
- $SDK_TOOLS_PATH/archivegen android-sdk-windows android-sdk_${ANDROID_SDK_VERSION}-windows.7z
+ unzip android-sdk_${ANDROID_SDK_VERSION}-windows.zip
+ mv android-sdk-windows android-sdk
+ createArchive android-sdk android-sdk_${ANDROID_SDK_VERSION}-windows.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data
mv android-sdk_${ANDROID_SDK_VERSION}-windows.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-windows.7z
- rm -fr android-sdk-windows
+ rm -fr android-sdk
fi
if [ "$OSTYPE" = "msys" ]
@@ -1071,68 +1090,56 @@ function prepareSDKs
gcc -Wl,-subsystem,windows -Wno-write-strings android.cpp -static-libgcc -s -O2 -o android.exe
popd
mkdir -p android-sdk-windows/tools/
- cp android-various/android-sdk/android.exe android-sdk-windows/tools/
- $SDK_TOOLS_PATH/archivegen android-sdk-windows android-sdk-windows-tools-mingw-android.7z
+ cp android-various/android-sdk/android.exe android-sdk/tools/
+ createArchive android-sdk-windows android-sdk-windows-tools-mingw-android.7z
mv android-sdk-windows-tools-mingw-android.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.platform_tools/data/android-sdk-windows-tools-mingw-android.7z
rm -rf android-various
fi
fi
- # repack platform-tools
- repackSDK platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-linux platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-linux android-sdk-linux_x86 platform-tools
- repackSDK platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-macosx platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-macosx android-sdk-mac_x86 platform-tools
- # should we also include ant binary for windows ?
- repackSDK platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-windows platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-windows android-sdk-windows platform-tools
+ # repack platform-tools
+ repackSDKPlatform-tools platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-linux platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-linux android-sdk platform-tools
+ repackSDKPlatform-tools platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-macosx platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-macosx android-sdk platform-tools
+ repackSDKPlatform-tools platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-windows platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-windows android-sdk platform-tools
# repack api-4
- repackSDK android-${ANDROID_API_4_VERSION}-linux android-${ANDROID_API_4_VERSION}-linux android-sdk-linux_x86/platforms android-4
- repackSDK android-${ANDROID_API_4_VERSION}-macosx android-${ANDROID_API_4_VERSION}-macosx android-sdk-mac_x86/platforms android-4
- repackSDK android-${ANDROID_API_4_VERSION}-windows android-${ANDROID_API_4_VERSION}-windows android-sdk-windows/platforms android-4
+ repackSDK android-${ANDROID_API_4_VERSION}-linux android-${ANDROID_API_4_VERSION}-linux android-sdk/platforms android-4
+ repackSDK android-${ANDROID_API_4_VERSION}-macosx android-${ANDROID_API_4_VERSION}-macosx android-sdk/platforms android-4
+ repackSDK android-${ANDROID_API_4_VERSION}-windows android-${ANDROID_API_4_VERSION}-windows android-sdk/platforms android-4
# repack api-5
- repackSDK android-${ANDROID_API_5_VERSION}-linux android-${ANDROID_API_5_VERSION}-linux android-sdk-linux_x86/platforms android-5
- repackSDK android-${ANDROID_API_5_VERSION}-macosx android-${ANDROID_API_5_VERSION}-macosx android-sdk-mac_x86/platforms android-5
- repackSDK android-${ANDROID_API_5_VERSION}-windows android-${ANDROID_API_5_VERSION}-windows android-sdk-windows/platforms android-5
+ repackSDK android-${ANDROID_API_5_VERSION}-linux android-${ANDROID_API_5_VERSION}-linux android-sdk/platforms android-5
+ repackSDK android-${ANDROID_API_5_VERSION}-macosx android-${ANDROID_API_5_VERSION}-macosx android-sdk/platforms android-5
+ repackSDK android-${ANDROID_API_5_VERSION}-windows android-${ANDROID_API_5_VERSION}-windows android-sdk/platforms android-5
# repack api-6
- repackSDK android-${ANDROID_API_6_VERSION}-linux android-${ANDROID_API_6_VERSION}-linux android-sdk-linux_x86/platforms android-6
- repackSDK android-${ANDROID_API_6_VERSION}-macosx android-${ANDROID_API_6_VERSION}-macosx android-sdk-mac_x86/platforms android-6
- repackSDK android-${ANDROID_API_6_VERSION}-windows android-${ANDROID_API_6_VERSION}-windows android-sdk-windows/platforms android-6
+ repackSDK android-${ANDROID_API_6_VERSION}-linux android-${ANDROID_API_6_VERSION}-linux android-sdk/platforms android-6
+ repackSDK android-${ANDROID_API_6_VERSION}-macosx android-${ANDROID_API_6_VERSION}-macosx android-sdk/platforms android-6
+ repackSDK android-${ANDROID_API_6_VERSION}-windows android-${ANDROID_API_6_VERSION}-windows android-sdk/platforms android-6
# repack api-7
- repackSDK android-${ANDROID_API_7_VERSION}-linux android-${ANDROID_API_7_VERSION}-linux android-sdk-linux_x86/platforms android-7
- repackSDK android-${ANDROID_API_7_VERSION}-macosx android-${ANDROID_API_7_VERSION}-macosx android-sdk-mac_x86/platforms android-7
- repackSDK android-${ANDROID_API_7_VERSION}-windows android-${ANDROID_API_7_VERSION}-windows android-sdk-windows/platforms android-7
+ repackSDK android-${ANDROID_API_7_VERSION}-linux android-${ANDROID_API_7_VERSION} android-sdk/platforms android-7
# repack api-8
- repackSDK android-${ANDROID_API_8_VERSION}-linux android-${ANDROID_API_8_VERSION}-linux android-sdk-linux_x86/platforms android-8
- repackSDK android-${ANDROID_API_8_VERSION}-macosx android-${ANDROID_API_8_VERSION}-macosx android-sdk-mac_x86/platforms android-8
- repackSDK android-${ANDROID_API_8_VERSION}-windows android-${ANDROID_API_8_VERSION}-windows android-sdk-windows/platforms android-8
+ repackSDK android-${ANDROID_API_8_VERSION}-linux android-${ANDROID_API_8_VERSION} android-sdk/platforms android-8
# repack api-9
- repackSDK android-${ANDROID_API_9_VERSION}-linux android-${ANDROID_API_9_VERSION}-linux android-sdk-linux_x86/platforms android-9
- repackSDK android-${ANDROID_API_9_VERSION}-linux android-${ANDROID_API_9_VERSION}-macosx android-sdk-mac_x86/platforms android-9
- repackSDK android-${ANDROID_API_9_VERSION}-linux android-${ANDROID_API_9_VERSION}-windows android-sdk-windows/platforms android-9
+ repackSDK android-${ANDROID_API_9_VERSION}-linux android-${ANDROID_API_9_VERSION} android-sdk/platforms android-9
# repack api-10
- repackSDK android-${ANDROID_API_10_VERSION}-linux android-${ANDROID_API_10_VERSION}-linux android-sdk-linux_x86/platforms android-10
- repackSDK android-${ANDROID_API_10_VERSION}-linux android-${ANDROID_API_10_VERSION}-macosx android-sdk-mac_x86/platforms android-10
- repackSDK android-${ANDROID_API_10_VERSION}-linux android-${ANDROID_API_10_VERSION}-windows android-sdk-windows/platforms android-10
+ repackSDK android-${ANDROID_API_10_VERSION}-linux android-${ANDROID_API_10_VERSION} android-sdk/platforms android-10
# repack api-11
- repackSDK android-${ANDROID_API_11_VERSION}-linux android-${ANDROID_API_11_VERSION}-linux android-sdk-linux_x86/platforms android-11
- repackSDK android-${ANDROID_API_11_VERSION}-linux android-${ANDROID_API_11_VERSION}-macosx android-sdk-mac_x86/platforms android-11
- repackSDK android-${ANDROID_API_11_VERSION}-linux android-${ANDROID_API_11_VERSION}-windows android-sdk-windows/platforms android-11
+ repackSDK android-${ANDROID_API_11_VERSION}-linux android-${ANDROID_API_11_VERSION} android-sdk/platforms android-11
# repack api-12
- repackSDK android-${ANDROID_API_12_VERSION}-linux android-${ANDROID_API_12_VERSION}-linux android-sdk-linux_x86/platforms android-12
- repackSDK android-${ANDROID_API_12_VERSION}-linux android-${ANDROID_API_12_VERSION}-macosx android-sdk-mac_x86/platforms android-12
- repackSDK android-${ANDROID_API_12_VERSION}-linux android-${ANDROID_API_12_VERSION}-windows android-sdk-windows/platforms android-12
+ repackSDK android-${ANDROID_API_12_VERSION}-linux android-${ANDROID_API_12_VERSION} android-sdk/platforms android-12
# repack api-13
- repackSDK android-${ANDROID_API_13_VERSION}-linux android-${ANDROID_API_13_VERSION}-linux android-sdk-linux_x86/platforms android-13
- repackSDK android-${ANDROID_API_13_VERSION}-linux android-${ANDROID_API_13_VERSION}-macosx android-sdk-mac_x86/platforms android-13
- repackSDK android-${ANDROID_API_13_VERSION}-linux android-${ANDROID_API_13_VERSION}-windows android-sdk-windows/platforms android-13
+ repackSDK android-${ANDROID_API_13_VERSION}-linux android-${ANDROID_API_13_VERSION} android-sdk/platforms android-13
+
+ # repack api-14
+ repackSDK android-${ANDROID_API_14_VERSION} android-${ANDROID_API_14_VERSION} android-sdk/platforms android-14
}
function patchQtFiles
@@ -1148,7 +1155,7 @@ function patchQtFiles
cp -a $SHARED_QT_PATH/bin/*.dll ../qt-src/
fi
echo files_to_patch > qpatch.cmdline
- echo /data/data/eu.licentia.necessitas.ministro/files/qt >> qpatch.cmdline
+ echo /data/data/org.kde.necessitas.ministro/files/qt >> qpatch.cmdline
echo $PWD >> qpatch.cmdline
echo . >> qpatch.cmdline
# $QPATCH_PATH @qpatch.cmdline
@@ -1173,7 +1180,7 @@ function packSource
echo cp -rf $1 $TEMP_PATH/source_temp_path/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/
cp -rf $1 $TEMP_PATH/source_temp_path/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/
pushd $TEMP_PATH/source_temp_path
- $SDK_TOOLS_PATH/archivegen Android $1.7z
+ createArchive Android $1.7z
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.android.$package_name/data
mv $1.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.$package_name/data/$1.7z
popd
@@ -1191,75 +1198,100 @@ function packSource
rm -fr $TEMP_PATH/source_temp_path
}
-function compileNecessitasQt
+
+function compileNecessitasQt #params $1 architecture, $2 package path, $3 NDK_TARGET, $4 android architecture
{
package_name=${1//-/_} # replace - with _
- # Only android-ndk-r6/platforms/android-9/arch-$ARCH/usr/lib (yes both arm and x86) contains crtbegin_so.o, it's missing on
- # other platforms; this file also exists in android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/sysroot/usr/lib
- # but not in the x86 equivalent, so for now, build it all for 9).
- NDK_TARGET=9
- # NQT_INSTALL_DIR=/data/data/eu.licentia.necessitas.ministro/files/qt
+ NDK_TARGET=$3
+ ANDROID_ARCH=$1
+ if [ ! -z $4 ] ; then
+ ANDROID_ARCH=$4
+ fi
+ # NQT_INSTALL_DIR=/data/data/org.kde.necessitas.ministro/files/qt
NQT_INSTALL_DIR=$PWD/install
+
+ if [ "$OSTYPE" = "linux-gnu" ] ; then
+ if [ ! -d android-sdk-linux/platform-tools ]
+ then
+ rm -fr android-sdk-linux
+ 7z -y x $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.base/data/android-sdk-linux.7z
+ 7z -y x $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.platform_tools/data/platform-tools_${ANDROID_PLATFORM_TOOLS_VERSION}-linux.7z
+ 7z -y x $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.android_14/data/android-${ANDROID_API_14_VERSION}.7z
+ 7z -y x $REPO_PATH_PACKAGES/org.kde.necessitas.misc.sdk.android_8/data/android-${ANDROID_API_8_VERSION}.7z
+ fi
+ export ANDROID_SDK_TOOLS_PATH=$PWD/android-sdk/tools/
+ export ANDROID_SDK_PLATFORM_TOOLS_PATH=$PWD/android-sdk/platform-tools/
+ fi
+
if [ ! -f all_done ]
then
- pushd ../qt-src
- git checkout experimental
- git pull
- mkdir -p $NQT_INSTALL_DIR/src/android/cpp/
- # The examples need qtmain_android.cpp in the install dir.
- cp src/android/cpp/qtmain_android.cpp $NQT_INSTALL_DIR/src/android/cpp/
- popd
- ../qt-src/android/androidconfigbuild.sh -l $NDK_TARGET -c 1 -q 1 -n $TEMP_PATH/android-ndk-${USED_ANDROID_NDK_VERSION} -a $1 -k 0 -i $NQT_INSTALL_DIR || error_msg "Can't configure android-qt"
+ pushd ../qt-src
+ git checkout -f mkspecs
+ mkdir -p $NQT_INSTALL_DIR/src/android/cpp/
+ # The examples need qtmain_android.cpp in the install dir.
+ cp src/android/cpp/qtmain_android.cpp $NQT_INSTALL_DIR/src/android/cpp/
+ popd
+ ../qt-src/android/androidconfigbuild.sh -l $NDK_TARGET -c 1 -q 1 -n $TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION} -a $ANDROID_ARCH -k 0 -i $NQT_INSTALL_DIR || error_msg "Can't configure android-qt"
echo "all done">all_done
fi
- if [ $package_name = "armeabi_v7a" ]
+ rm -fr install
+ rm -fr Android
+ export INSTALL_ROOT=""
+ make QtJar
+ ../qt-src/android/androidconfigbuild.sh -l $NDK_TARGET -c 0 -q 0 -n $TEMP_PATH/android-ndk-${ANDROID_NDK_VERSION} -a $ANDROID_ARCH -b 0 -k 1 -i $NQT_INSTALL_DIR || error_msg "Can't install android-qt"
+
+ doSed $"s/= android-5/= android-${NDK_TARGET}/g" install/mkspecs/android-g++/qmake.conf
+ doSed $"s/= android-5/= android-${NDK_TARGET}/g" install/mkspecs/default/qmake.conf
+ if [ $ANDROID_ARCH = "armeabi-v7a" ]
then
- doSed $"s/= armeabi/= armeabi-v7a/g" mkspecs/android-g++/qmake.conf
- doSed $"s/= android-4/= android-$NDK_TARGET/g" install/mkspecs/android-g++/qmake.conf
+ doSed $"s/= armeabi/= armeabi-v7a/g" install/mkspecs/android-g++/qmake.conf
+ doSed $"s/= armeabi/= armeabi-v7a/g" install/mkspecs/default/qmake.conf
else
- doSed $"s/= armeabi-v7a/= armeabi/g" mkspecs/android-g++/qmake.conf
- doSed $"s/= android-4/= android-$NDK_TARGET/g" install/mkspecs/android-g++/qmake.conf
+ if [ $ANDROID_ARCH = "x86" ]
+ then
+ doSed $"s/= armeabi/= x86/g" install/mkspecs/android-g++/qmake.conf
+ doSed $"s/= armeabi/= x86/g" install/mkspecs/default/qmake.conf
+ fi
fi
- rm -fr install
- export INSTALL_ROOT=""
- make install
-# doMakeInstall "Failed to make-install Qt Android $package_name" make
mkdir -p $2/$1
cp -rf $NQT_INSTALL_DIR/bin $2/$1
- $SDK_TOOLS_PATH/archivegen Android qt-tools-${HOST_TAG}.7z
+ createArchive Android qt-tools-${HOST_TAG}.7z
rm -fr $2/$1/bin
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.$package_name/data
mv qt-tools-${HOST_TAG}.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.$package_name/data/qt-tools-${HOST_TAG}.7z
cp -rf $NQT_INSTALL_DIR/* $2/$1
cp -rf ../qt-src/lib/*.xml $2/$1/lib/
- $SDK_TOOLS_PATH/archivegen Android qt-framework.7z
+ cp -rf jar $2/$1/
+ rm -fr $2/$1/bin
+ createArchive Android qt-framework.7z
mv qt-framework.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.$package_name/data/qt-framework.7z
# Not sure why we're using a different qt-framework package for Windows.
cp $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.$package_name/data/qt-framework.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.$package_name/data/qt-framework-windows.7z
+ rm -fr ../install-$1
+ cp -a install ../install-$1
+ cp -rf jar ../install-$1/
# patchQtFiles
}
function prepareNecessitasQt
{
- downloadLighthouseSource
-
+ mkdir -p Android/Qt/$NECESSITAS_QT_VERSION_SHORT
pushd Android/Qt/$NECESSITAS_QT_VERSION_SHORT
- if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.x86/data/qt-tools-${HOST_TAG}.7z ]
+ if [ ! -d qt-src ]
then
- mkdir build-x86
- pushd build-x86
- compileNecessitasQt x86 Android/Qt/$NECESSITAS_QT_VERSION_SHORT
- popd #build-x86
+ git clone git://anongit.kde.org/android-qt.git qt-src|| error_msg "Can't clone ${1}"
fi
+ cloneCheckoutKDEGitRepo android-qt $CHECKOUT_BRANCH
+
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.armeabi/data/qt-tools-${HOST_TAG}.7z ]
then
mkdir build-armeabi
pushd build-armeabi
- compileNecessitasQt armeabi Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+ compileNecessitasQt armeabi Android/Qt/$NECESSITAS_QT_VERSION_SHORT 5
popd #build-armeabi
fi
@@ -1267,10 +1299,26 @@ function prepareNecessitasQt
then
mkdir build-armeabi-v7a
pushd build-armeabi-v7a
- compileNecessitasQt armeabi-v7a Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+ compileNecessitasQt armeabi-v7a Android/Qt/$NECESSITAS_QT_VERSION_SHORT 5
popd #build-armeabi-v7a
fi
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.armeabi_android_4/data/qt-tools-${HOST_TAG}.7z ]
+ then
+ mkdir build-armeabi-android-4
+ pushd build-armeabi-android-4
+ compileNecessitasQt armeabi-android-4 Android/Qt/$NECESSITAS_QT_VERSION_SHORT 4 armeabi
+ popd #build-armeabi
+ fi
+# Enable it when QtCreator is ready
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.x86/data/qt-tools-${HOST_TAG}.7z ]
+# then
+# mkdir build-x86
+# pushd build-x86
+# compileNecessitasQt x86 Android/Qt/$NECESSITAS_QT_VERSION_SHORT 9
+# popd #build-x86
+# fi
+
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qt.src/data/qt-src.7z ]
then
packSource qt-src
@@ -1281,15 +1329,13 @@ function prepareNecessitasQt
function compileNecessitasQtMobility
{
- export ANDROID_TARGET_ARCH=$1
if [ ! -f all_done ]
then
pushd ../qtmobility-src
git checkout $CHECKOUT_BRANCH
git pull
popd
-# ../qtmobility-src/configure -prefix $PWD/install -staticconfig android -qmake-exec $PWD/../build-$1/install/bin/qmake$EXE_EXT -modules "bearer location contacts multimedia versit messaging systeminfo serviceframework sensors gallery organizer feedback connectivity" || error_msg "Can't configure android-qtmobility"
- ../qtmobility-src/configure -prefix $PWD/install -staticconfig android -qmake-exec $TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install/bin/qmake$EXE_EXT -modules "bearer location contacts multimedia versit messaging systeminfo serviceframework sensors gallery organizer feedback connectivity" || error_msg "Can't configure android-qtmobility"
+ ../qtmobility-src/configure -prefix $PWD/install -staticconfig android -qmake-exec $TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install/bin/qmake$EXE_EXT -modules "bearer location contacts multimedia versit messaging systeminfo serviceframework sensors gallery organizer feedback connectivity" || error_msg "Can't configure android-qtmobility"
doMake "Can't compile android-qtmobility" "all done" ma-make
fi
package_name=${1//-/_} # replace - with _
@@ -1300,11 +1346,9 @@ function compileNecessitasQtMobility
mkdir -p $2/$1
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtmobility.$package_name/data
mv $PWD/install/* $2/$1
- cp -a $PWD/$TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/* $2/$1
- rm -fr $PWD/$TEMP_PATH
- $SDK_TOOLS_PATH/archivegen Android qtmobility.7z
+ createArchive Android qtmobility.7z
mv qtmobility.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtmobility.$package_name/data/qtmobility.7z
- cp -a $2/$1/* ../build-$1
+ cp -a $2/$1/* ../install-$1 # copy files to ministro repository
# pushd ../build-$1
# patchQtFiles
# popd
@@ -1339,6 +1383,22 @@ function prepareNecessitasQtMobility
popd #build-mobility-armeabi-v7a
fi
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtmobility.armeabi_android_4/data/qtmobility.7z ]
+ then
+ mkdir build-mobility-armeabi-android-4
+ pushd build-mobility-armeabi-android-4
+ compileNecessitasQtMobility armeabi-android-4 Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+ popd #build-mobility-armeabi-android-4
+ fi
+
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtmobility.x86/data/qtmobility.7z ]
+# then
+# mkdir build-mobility-x86
+# pushd build-mobility-x86
+# compileNecessitasQtMobility x86 Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+# popd #build-mobility-x86
+# fi
+
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtmobility.src/data/qtmobility-src.7z ]
then
packSource qtmobility-src
@@ -1348,8 +1408,7 @@ function prepareNecessitasQtMobility
function compileNecessitasQtWebkit
{
- export ANDROID_TARGET_ARCH=$1
- export SQLITE3SRCDIR=$TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/qt-src/src/3rdparty/sqlite
+ export SQLITE3SRCDIR=$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/qt-src/src/3rdparty/sqlite
if [ ! -f all_done ]
then
if [ "$OSTYPE" = "msys" ] ; then
@@ -1376,7 +1435,7 @@ function compileNecessitasQtWebkit
fi
export WEBKITOUTPUTDIR=$PWD
echo "doing perl"
- ../qtwebkit-src/WebKitTools/Scripts/build-webkit --qt --makeargs="-j$JOBS" --qmake=$TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install/bin/qmake$EXE_EXT --no-video --no-xslt || error_msg "Can't configure android-qtwebkit"
+ ../qtwebkit-src/Tools/Scripts/build-webkit --qt --makeargs="-j$JOBS" --qmake=$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install/bin/qmake$EXE_EXT --no-video --no-xslt || error_msg "Can't configure android-qtwebkit"
echo "all done">all_done
fi
package_name=${1//-/_} # replace - with _
@@ -1388,11 +1447,11 @@ function compileNecessitasQtWebkit
rm -fr $2
mkdir -p $2/$1
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtwebkit.$package_name/data
- mv $PWD/$TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/* $2/$1
+ mv $PWD/$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install/* $2/$1
pushd $2/$1
- qt_build_path=$TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1
+ qt_build_path=$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$1/install
qt_build_path=${qt_build_path//\//\\\/}
- sed_cmd="s/$qt_build_path/\/data\/data\/eu.licentia.necessitas.ministro\/files\/qt/g"
+ sed_cmd="s/$qt_build_path/\/data\/data\/org.kde.necessitas.ministro\/files\/qt/g"
if [ "$OSTYPE" = "darwin9.0" -o "$OSTYPE" = "darwin10.0" ]; then
find . -name *.pc | xargs sed -i '.bak' $sed_cmd
find . -name *.pc.bak | xargs rm -f
@@ -1401,9 +1460,9 @@ function compileNecessitasQtWebkit
fi
popd
rm -fr $PWD/$TEMP_PATH
- $SDK_TOOLS_PATH/archivegen Android qtwebkit.7z
+ createArchive Android qtwebkit.7z
mv qtwebkit.7z $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtwebkit.$package_name/data/qtwebkit.7z
- cp -a $2/$1/* ../build-$1/
+ cp -a $2/$1/* ../install-$1/
# pushd ../build-$1
# patchQtFiles
# popd
@@ -1438,6 +1497,22 @@ function prepareNecessitasQtWebkit
popd #build-webkit-armeabi-v7a
fi
+ if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtwebkit.armeabi_android_4/data/qtwebkit.7z ]
+ then
+ mkdir build-webkit-armeabi-android-4
+ pushd build-webkit-armeabi-android-4
+ compileNecessitasQtWebkit armeabi-android-4 Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+ popd #build-webkit-armeabi-android-4
+ fi
+
+# if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtwebkit.x86/data/qtwebkit.7z ]
+# then
+# mkdir build-webkit-x86
+# pushd build-webkit-x86
+# compileNecessitasQtWebkit x86 Android/Qt/$NECESSITAS_QT_VERSION_SHORT
+# popd #build-webkit-x86
+# fi
+#
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.android.qtwebkit.src/data/qtwebkit-src.7z ]
then
packSource qtwebkit-src
@@ -1457,9 +1532,9 @@ function prepareOpenJDK
if [ "$OSTYPE" = "msys" -o "$WINE" = "1" ] ; then
downloadIfNotExists oscg-openjdk6b21-1-windows-installer.exe http://oscg-downloads.s3.amazonaws.com/installers/oscg-openjdk6b21-1-windows-installer.exe
rm -rf openjdk6b21-windows
- oscg-openjdk6b21-1-windows-installer.exe --unattendedmodeui none --mode unattended --prefix `pwd`/openjdk6b21-windows
+ wine oscg-openjdk6b21-1-windows-installer.exe --unattendedmodeui none --mode unattended --prefix `pwd`/openjdk6b21-windows
pushd openjdk6b21-windows
- $SDK_TOOLS_PATH/archivegen openjdk-6.0.21 openjdk-windows.7z
+ createArchive openjdk-6.0.21 openjdk-windows.7z
mv openjdk-windows.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.openjdk/data/
popd
fi
@@ -1470,16 +1545,15 @@ function prepareOpenJDK
ar x openjdk-1.6.0-b21.i386.openscg.deb
tar xzf data.tar.gz
pushd opt
- $SDK_TOOLS_PATH/archivegen openjdk openjdk-linux-x86.7z
+ createArchive openjdk openjdk-linux-x86.7z
mv openjdk-linux-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.openjdk/data/
popd
- tar
fi
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.openjdk/data/openjdk-darwin-x86.7z ] ; then
downloadIfNotExists oscg-openjdk6b16-5a-osx-installer.zip http://oscg-downloads.s3.amazonaws.com/installers/oscg-openjdk6b16-5a-osx-installer.zip
unzip -o oscg-openjdk6b16-5a-osx-installer.zip
- $SDK_TOOLS_PATH/archivegen oscg-openjdk6b16-5a-osx-installer.app openjdk-darwin-x86.7z
+ createArchive oscg-openjdk6b16-5a-osx-installer.app openjdk-darwin-x86.7z
mv openjdk-darwin-x86.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.openjdk/data/
fi
@@ -1488,13 +1562,16 @@ function prepareOpenJDK
function prepareAnt
{
+ mkdir ant
+ pushd ant
if [ ! -f $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ant/data/ant.7z ] ; then
mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ant/data
downloadIfNotExists apache-ant-1.8.2-bin.tar.bz2 http://mirror.ox.ac.uk/sites/rsync.apache.org//ant/binaries/apache-ant-1.8.2-bin.tar.bz2
tar xjvf apache-ant-1.8.2-bin.tar.bz2
- $SDK_TOOLS_PATH/archivegen apache-ant-1.8.2 ant.7z
+ createArchive apache-ant-1.8.2 ant.7z
mv ant.7z $REPO_PATH_PACKAGES/org.kde.necessitas.misc.ant/data/
fi
+ popd
}
function patchPackages
@@ -1536,6 +1613,7 @@ function setPackagesVariables
patchPackages "@@NECESSITAS_QT_VERSION_SHORT@@" $NECESSITAS_QT_VERSION_SHORT
patchPackages "@@NECESSITAS_QTWEBKIT_VERSION@@" $NECESSITAS_QTWEBKIT_VERSION
patchPackages "@@NECESSITAS_QTMOBILITY_VERSION@@" $NECESSITAS_QTMOBILITY_VERSION
+ patchPackages "@@REPOSITORY@@" $CHECKOUT_BRANCH
patchPackages "@@TEMP_PATH@@" $TEMP_PATH
patchPackage "@@NECESSITAS_QT_CREATOR_VERSION@@" $NECESSITAS_QT_CREATOR_VERSION "org.kde.necessitas.tools.qtcreator"
@@ -1554,13 +1632,40 @@ function setPackagesVariables
patchPackage "@@ANDROID_API_11_VERSION@@" $ANDROID_API_11_VERSION "org.kde.necessitas.misc.sdk.android_11"
patchPackage "@@ANDROID_API_12_VERSION@@" $ANDROID_API_12_VERSION "org.kde.necessitas.misc.sdk.android_12"
patchPackage "@@ANDROID_API_13_VERSION@@" $ANDROID_API_13_VERSION "org.kde.necessitas.misc.sdk.android_13"
+ patchPackage "@@ANDROID_API_14_VERSION@@" $ANDROID_API_14_VERSION "org.kde.necessitas.misc.sdk.android_14"
patchPackage "@@ANDROID_PLATFORM_TOOLS_VERSION@@" $ANDROID_PLATFORM_TOOLS_VERSION "org.kde.necessitas.misc.sdk.platform_tools"
patchPackage "@@ANDROID_SDK_VERSION@@" $ANDROID_SDK_VERSION "org.kde.necessitas.misc.sdk.base"
+
+ patchPackage "@@NECESSITAS_QTMOBILITY_ARMEABI_INSTALL_PATH@@" "$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-mobility-armeabi"
+ patchPackage "@@NECESSITAS_QTMOBILITY_ARMEABI_ANDROID_4_INSTALL_PATH@@" "$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-mobility-armeabi-android-4"
+ patchPackage "@@NECESSITAS_QTMOBILITY_ARMEABI-V7A_INSTALL_PATH@@" "$TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-mobility-armeabi-v7a"
+ patchPackage "@@NECESSITAS_QTWEBKIT_ARMEABI_INSTALL_PATH@@" "/data/data/org.kde.necessitas.ministro/files/qt"
+ patchPackage "@@NECESSITAS_QTWEBKIT_ARMEABI_ANDROID_4_INSTALL_PATH@@" "/data/data/org.kde.necessitas.ministro/files/qt"
+ patchPackage "@@NECESSITAS_QTWEBKIT_ARMEABI-V7A_INSTALL_PATH@@" "/data/data/org.kde.necessitas.ministro/files/qt"
+
}
function prepareSDKBinary
{
$SDK_TOOLS_PATH/binarycreator -v -t $SDK_TOOLS_PATH/installerbase$EXE_EXT -c $REPO_SRC_PATH/config -p $REPO_PATH_PACKAGES -n $REPO_SRC_PATH/necessitas-sdk-installer$HOST_QT_CONFIG$EXE_EXT org.kde.necessitas
+ mkdir sdkmaintenance
+ pushd sdkmaintenance
+ rm -fr *.7z
+ if [ "$OSTYPE" = "msys" ] ; then
+ mkdir temp
+ cp -a $REPO_SRC_PATH/necessitas-sdk-installer$HOST_QT_CONFIG$EXE_EXT temp/SDKMaintenanceToolBase.exe
+ createArchive temp sdkmaintenance-windows.7z
+ else
+ cp -a $REPO_SRC_PATH/necessitas-sdk-installer$HOST_QT_CONFIG$EXE_EXT .tempSDKMaintenanceTool
+ if [ "$OSTYPE" = "linux-gnu" ] ; then
+ createArchive . sdkmaintenance-linux-x86.7z
+ else
+ createArchive . sdkmaintenance-darwin-x86.7z
+ fi
+ fi
+ mkdir -p $REPO_PATH_PACKAGES/org.kde.necessitas.tools.sdkmaintenance/data/
+ cp -f *.7z $REPO_PATH_PACKAGES/org.kde.necessitas.tools.sdkmaintenance/data/
+ popd
}
function prepareSDKRepository
@@ -1571,37 +1676,50 @@ function prepareSDKRepository
function prepareMinistroRepository
{
+ rm -fr $MINISTRO_REPO_PATH
pushd $REPO_SRC_PATH/ministrorepogen
if [ ! -f all_done ]
then
$STATIC_QT_PATH/bin/qmake CONFIG+=static -r || error_msg "Can't configure ministrorepogen"
doMake "Can't compile ministrorepogen" "all done" ma-make
+ if [ "$OSTYPE" = "msys" ] ; then
+ cp $REPO_SRC_PATH/ministrorepogen/release/ministrorepogen$EXE_EXT $REPO_SRC_PATH/ministrorepogen/ministrorepogen$EXE_EXT
+ fi
fi
popd
- for architecture in armeabi armeabi-v7a
+ for platfromArchitecture in armeabi armeabi-v7a armeabi-android-4
do
- rm -fr $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION
- mkdir -p $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION
- pushd $TEMP_PATH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/build-$architecture || error_msg "Can't prepare ministro repo, Android Qt not built?"
+ pushd $TEMP_PATH/$CHECKOUT_BRANCH/Android/Qt/$NECESSITAS_QT_VERSION_SHORT/install-$platfromArchitecture || error_msg "Can't prepare ministro repo, Android Qt not built?"
+ architecture=$platfromArchitecture;
+ repoVersion=$MINISTRO_VERSION-$platfromArchitecture
+ if [ $architecture = "armeabi-android-4" ] ; then
+ architecture="armeabi"
+ fi
+ MINISTRO_OBJECTS_PATH=$MINISTRO_REPO_PATH/android/$architecture/objects/$repoVersion
+ rm -fr $MINISTRO_OBJECTS_PATH
+ mkdir -p $MINISTRO_OBJECTS_PATH
rm -fr Android
for lib in `find . -name *.so`
do
libDirname=`dirname $lib`
- mkdir -p $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION/$libDirname
- cp $lib $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION/$libDirname/
- $ANDROID_STRIP_BINARY --strip-unneeded $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION/$lib
+ mkdir -p $MINISTRO_OBJECTS_PATH/$libDirname
+ cp $lib $MINISTRO_OBJECTS_PATH/$libDirname/
+ $ANDROID_STRIP_BINARY --strip-unneeded $MINISTRO_OBJECTS_PATH/$lib
+ done
+
+ for jar in `find . -name *.jar`
+ do
+ jarDirname=`dirname $jar`
+ mkdir -p $MINISTRO_OBJECTS_PATH/$jarDirname
+ cp $jar $MINISTRO_OBJECTS_PATH/$jarDirname/
done
for qmldirfile in `find . -name qmldir`
do
qmldirfileDirname=`dirname $qmldirfile`
- cp $qmldirfile $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION/$qmldirfileDirname/
+ cp $qmldirfile $MINISTRO_OBJECTS_PATH/$qmldirfileDirname/
done
-
- if [ "$OSTYPE" = "msys" ] ; then
- cp $REPO_SRC_PATH/ministrorepogen/release/ministrorepogen$EXE_EXT $REPO_SRC_PATH/ministrorepogen/ministrorepogen$EXE_EXT
- fi
- $REPO_SRC_PATH/ministrorepogen/ministrorepogen$EXE_EXT $ANDROID_READELF_BINARY $MINISTRO_REPO_PATH/android/$architecture/objects/$MINISTRO_VERSION $MINISTRO_VERSION $architecture $REPO_SRC_PATH/ministrorepogen/rules.xml $MINISTRO_REPO_PATH
+ $REPO_SRC_PATH/ministrorepogen/ministrorepogen$EXE_EXT $ANDROID_READELF_BINARY $MINISTRO_OBJECTS_PATH $MINISTRO_VERSION $architecture $REPO_SRC_PATH/ministrorepogen/rules-$platfromArchitecture.xml $MINISTRO_REPO_PATH $repoVersion $CHECKOUT_BRANCH
popd
done
}
@@ -1618,7 +1736,7 @@ function packforWindows
rm -fr Android_old
find -name *.so.4* | xargs rm -fr
find -name *.so.1* | xargs rm -fr
- $SDK_TOOLS_PATH/archivegen Android $1/$2-windows.7z
+ createArchive Android $1/$2-windows.7z -l
popd
rm -fr $TEMP_PATH/packforWindows
}
@@ -1682,15 +1800,17 @@ if [ "$OSTYPE" = "msys" ] ; then
fi
prepareHostQt
prepareSdkInstallerTools
-prepareOpenJDK
-prepareAnt
prepareNDKs
-prepareGDBVersion head $HOST_TAG
-prepareGDBVersion head
prepareSDKs
+# prepareOpenJDK
+prepareAnt
prepareNecessitasQtCreator
+# prepareGDBVersion head $HOST_TAG
+prepareGDBVersion 7.3
+# prepareGDBVersion head
+mkdir $CHECKOUT_BRANCH
+pushd $CHECKOUT_BRANCH
prepareNecessitasQt
-
# TODO :: Fix webkit build in Windows (-no-video fails) and Mac OS X (debug-and-release config incorrectly used and fails)
# git clone often fails for webkit
# Webkit is broken currently.
@@ -1700,7 +1820,9 @@ if [ "$OSTYPE" != "msys" ] ; then
prepareNecessitasQtMobility # if [[ `gcc --version` =~ .*llvm.* ]]; => syntax error near `=~'
fi
-prepareWindowsPackages
+popd
+
+#prepareWindowsPackages
setPackagesVariables
prepareSDKBinary
@@ -1712,6 +1834,8 @@ if [ "$MAKE_DEBUG_HOST_APPS" = "1" ] ; then
prepareSDKBinary
fi
+removeUnusedPackages
+
prepareSDKRepository
prepareMinistroRepository