-
Notifications
You must be signed in to change notification settings - Fork 7
Tom #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TomKeel
wants to merge
2
commits into
clutter-project:master
Choose a base branch
from
TomKeel:tom
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tom #5
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,42 +16,114 @@ | |
|
||
set -ex | ||
|
||
# download Android NDK and create standalone toolchain | ||
if ! test -d android-ndk-r8c; then | ||
wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2 | ||
tar jxf android-ndk-r8c-linux-x86.tar.bz2 | ||
rm android-ndk-r8c-linux-x86.tar.bz2 | ||
pushd android-ndk-r8c | ||
./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=../toolchain | ||
popd | ||
# Which target architecture (arm or x86). | ||
ARCH=x86 | ||
|
||
# Which Android "API Level" to build for. | ||
API_LEVEL=14 | ||
|
||
# Which version of the Android NDK toolchain to use (e.g. 4.6). | ||
TOOLCHAIN_VERSION=4.6 | ||
|
||
# Where the Android NDK lives. | ||
NDK_NAME=android-ndk-r8d | ||
NDK_DIR=$HOME/$NDK_NAME | ||
|
||
# Where the Android SDK lives. | ||
SDK_NAME=android-sdk-linux | ||
SDK_DIR=$HOME/$SDK_NAME | ||
|
||
# Download the Android NDK if necessary. | ||
if ! test -d $NDK_DIR; then | ||
mkdir -p $NDK_DIR | ||
pushd $NDK_DIR/.. | ||
wget http://dl.google.com/android/ndk/$NDK_NAME-linux-x86.tar.bz2 \ | ||
&& tar jxf $NDK_NAME-linux-x86.tar.bz2 \ | ||
&& rm $NDK_NAME-linux-x86.tar.bz2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
popd | ||
fi | ||
|
||
JHB_PREFIX=$PWD/jhbuild/.local | ||
# Download the Android SDK if necessary. | ||
if ! test -d $SDK_DIR; then | ||
mkdir -p $SDK_DIR | ||
pushd $SDK_DIR/.. | ||
wget http://dl.google.com/android/android-sdk_r21-linux.tgz \ | ||
&& tar zxf android-sdk_r21-linux.tgz \ | ||
&& rm android-sdk_r21-linux.tgz | ||
popd | ||
fi | ||
|
||
# Update the Android SDK if necessary. | ||
#$SDK_DIR/tools/android update sdk -u --filter platform-tool,tool | ||
#$SDK_DIR/tools/android update sdk -u --filter android-$API_LEVEL | ||
|
||
# Toolchain name: the prefix of toolchain command names | ||
# Toolchain arg: passed to make-standalon-toolchain.sh | ||
# Toolchain dir: where we put the standalone toolchain | ||
case $ARCH in | ||
arm) | ||
export TOOLCHAIN_NAME=arm-linux-androideabi | ||
TOOLCHAIN_ARG=arm-linux-androideabi-$TOOLCHAIN_VERSION | ||
;; | ||
x86) | ||
export TOOLCHAIN_NAME=i686-linux-android | ||
TOOLCHAIN_ARG=x86-$TOOLCHAIN_VERSION | ||
;; | ||
esac | ||
TOOLCHAIN_DIR=$PWD/toolchain-$ARCH-$TOOLCHAIN_VERSION | ||
|
||
# Create the standalone toolchain. | ||
$NDK_DIR/build/tools/make-standalone-toolchain.sh \ | ||
--toolchain=$TOOLCHAIN_ARG \ | ||
--platform=android-$API_LEVEL \ | ||
--install-dir=$TOOLCHAIN_DIR | ||
|
||
# set up patched version of jhbuild | ||
# Set up patched version of jhbuild | ||
JHB_PREFIX=$PWD/jhbuild/.local | ||
if ! test -d jhbuild; then | ||
git clone git://git.gnome.org/jhbuild | ||
pushd jhbuild | ||
patch -p1 -i ../modulesets/patches/jhbuild/disable-clean-la-files.patch | ||
./autogen.sh --prefix=$JHB_PREFIX | ||
make install | ||
popd | ||
git clone git://git.gnome.org/jhbuild | ||
pushd jhbuild | ||
patch -p1 -i ../modulesets/patches/jhbuild/disable-clean-la-files.patch | ||
./autogen.sh --prefix=$JHB_PREFIX | ||
make install | ||
popd | ||
fi | ||
|
||
mkdir -p $JHB_PREFIX/share/aclocal | ||
cp /usr/share/aclocal/gtk-doc.m4 $JHB_PREFIX/share/aclocal/ | ||
|
||
source ./android-env.sh | ||
export PREFIX="$PWD/install-$ARCH-$API_LEVEL" | ||
|
||
# start the build | ||
$JHB_PREFIX/bin/jhbuild -f jhbuildrc-android build -q mx libsoup | ||
export CFLAGS= | ||
export CC=$TOOLCHAIN_NAME-gcc | ||
export CXX=$TOOLCHAIN_NAME-g++ | ||
|
||
# download Android SDK | ||
if ! test -d android-sdk-linux; then | ||
wget http://dl.google.com/android/android-sdk_r21-linux.tgz | ||
tar zxf android-sdk_r21-linux.tgz | ||
rm android-sdk_r21-linux.tgz | ||
fi | ||
export C_INCLUDE_PATH=$PREFIX/include | ||
export CPLUS_INCLUDE_PATH=$PREFIX/include | ||
|
||
export gl_cv_header_working_stdint_h=yes | ||
|
||
# remove other langauges | ||
export LINGUAS=C | ||
|
||
# avoid picking up system libraries | ||
export PKG_CONFIG_LIBDIR=/foo/bar | ||
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig | ||
|
||
export ac_cv_path_GLIB_COMPILE_RESOURCES=/usr/bin/glib-compile-resources | ||
export ac_cv_path_GLIB_COMPILE_SCHEMAS=/usr/bin/glib-compile-schemas | ||
export ac_cv_path_GLIB_GENMARSHAL=/usr/bin/glib-genmarshal | ||
|
||
export PATH="$TOOLCHAIN_DIR/bin:$NDK_DIR:$SDK_DIR/tools/:$SDK_DIR/platform-tools:$PATH" | ||
|
||
export NDK_MODULE_PATH=$PWD | ||
|
||
export PKG_CONFIG="pkg-config \ | ||
--define-variable=glib_genmarshal=/usr/bin/glib-genmarshal \ | ||
--define-variable=gobject_query=/usr/bin/gobject-query \ | ||
--define-variable=glib_mkenums=/usr/bin/glib-mkenums \ | ||
--define-variable=glib_compile_resources=/usr/bin/glib-compile-resources \ | ||
" | ||
|
||
android update sdk -u --filter platform-tool,tool | ||
android update sdk -u --filter android-14 | ||
# Do it. | ||
$JHB_PREFIX/bin/jhbuild -f jhbuildrc-android -m modulesets/clutter-android.modules ${*:-build glib} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
moduleset = os.environ['PWD'] + '/modulesets/clutter-android.modules' | ||
checkoutroot = os.environ['PWD'] + '/sources' | ||
prefix = os.environ['PWD'] + '/install' | ||
|
||
prefix = os.environ['PREFIX'] | ||
build_policy = 'updated' | ||
use_lib64 = False | ||
|
||
use_local_modulesets = True | ||
partial_build = False | ||
autogenargs = '--disable-shared --disable-gtk-doc --host=arm-linux-androideabi gl_cv_header_working_stdint_h=yes --disable-introspection ' | ||
autogenargs = '--disable-shared --disable-gtk-doc gl_cv_header_working_stdint_h=yes --disable-introspection --build=x86_64-unknown-linux-gnu --host=' + os.environ['TOOLCHAIN_NAME'] | ||
makeargs = '-j 4' | ||
|
||
|
||
os.environ['ac_cv_path_GLIB_COMPILE_RESOURCES']='/usr/bin/glib-compile-resources' | ||
os.environ['ac_cv_path_GLIB_COMPILE_SCHEMAS']='/usr/bin/glib-compile-schemas' | ||
os.environ['ac_cv_path_GLIB_GENMARSHAL']='/usr/bin/glib-genmarshal' | ||
|
||
os.environ['PATH'] += ':' + os.environ['PWD'] + '/toolchain/bin' | ||
os.environ['CC'] = 'arm-linux-androideabi-gcc' | ||
|
||
os.environ['PKG_CONFIG'] = 'pkg-config --define-variable=glib_genmarshal=/usr/bin/glib-genmarshal --define-variable=gobject_query=/usr/bin/gobject-query --define-variable=glib_mkenums=/usr/bin/glib-mkenums --define-variable=glib_compile_resources=/usr/bin/glib-compile-resources' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some people may not want the Android SDK installed in their home directory, so I think this should be configurable if you want to specify a different location for the SDK and NDK.