couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Trivial Update of "Installing_on_Android" by MattAdams
Date Thu, 03 Feb 2011 02:08:12 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Installing_on_Android" page has been changed by MattAdams.
http://wiki.apache.org/couchdb/Installing_on_Android?action=diff&rev1=16&rev2=17

--------------------------------------------------

  CC=agcc \
  ./configure \
  --host=arm-eabi \
- --prefix=/sdcard/groupinform/couch \
+ --prefix=/sdcard/couch \
  --with-android=$ANDROID_SDK/sources \
  --with-android-curl=$(pwd)/../curl-7.20.0 \
  --with-erlang=$(pwd)/../otp_rel/usr/include \
@@ -236, +236 @@

  A lot of the code below was written simply to package things in a manner similar to Aaron's
original layout of [[http://couchdb-android.s3.amazonaws.com/couch-erl-1.0.tgz|couch-erl-1.0.tgz]].
 There is no need for a separate {{{dns-fix.tgz}}} or {{{fixup-1.0.tgz}}} with this package.
  
  {{{
- (to be updated)
- }}}
+ #!/bin/bash -x
+ # 
+ if [ -z "$1" ]; then
+     echo "Give me a release number bub!"
+     exit 1
+ fi
  
+ DATE=$(date +"%Y-%m-%d_%H-%M-%S")
+ RELEASE="release-$DATE"
+ 
+ mkdir -p $RELEASE/data/data/com.your.namespace/bin
+ 
+ ##
+ # Configure and package Erlang/OTP 
+ #
+ 
+ cp -Rdp otp_rel otp_rel.package
+ 
+ cd otp_rel.package
+ 
+ ./Install -cross -sasl /data/data/com.your.namespace/erlang
+ rm Install
+ 
+ rm -rf erts-5.7.5/include/* misc releases usr
+ 
+ cd lib
+ 
+ libs_to_keep="crypto-1.6.4 erts-5.7.5 inets-5.3 kernel-2.13.5 sasl-2.1.9 ssl-3.10.8 stdlib-1.16.5
xmerl-1.2.4"
+ 
+ mkdir backuplib
+ 
+ for i in $libs_to_keep
+ do
+     mv $i backuplib/
+ done
+ 
+ mv backuplib ../
+ rm -rf *
+ 
+ mv ../backuplib/* .
+ rmdir ../backuplib
+ 
+ # Remove vestigal files
+ rm -rf crypto-1.6.4/src/*.erl
+ rm -rf erts-5.7.5/src/*.erl
+ rm -rf inets-5.3/examples/* inets-5.3/src/*.erl
+ rm -rf kernel-2.13.5/examples/* kernel-2.13.5/include/* kernel-2.13.5/src/*.erl
+ rm -rf sasl-2.1.9/src/*.erl
+ rm -rf ssl-3.10.8/examples/certs ssl-3.10.8/examples/ebin ssl-3.10.8/examples/src ssl-3.10.8/include/*
ssl-3.10.8/pkix/*.erl ssl-3.10.8/src/*.erl
+ rm -rf stdlib-1.16.5/examples/* stdlib-1.16.5/include/* stdlib-1.16.5/src/*.erl
+ rm -rf xmerl-1.2.4/include xmerl-1.2.4/src 
+ 
+ cd ..
+ 
+ # Update path to Android sh -- replace with a nice patch at some point
+ for i in bin/erl bin/start bin/start_erl erts-5.7.5/bin/erl erts-5.7.5/bin/erl.src erts-5.7.5/bin/start
erts-5.7.5/bin/start_erl.src erts-5.7.5/bin/start.src lib/inets-5.3/priv/bin/runcgi.sh
+ do
+     sed -e "s;#!/bin/sh;#!/system/bin/sh;" $i > $i.new
+     mv $i.new $i
+     chmod 755 $i
+ done
+ 
+ chmod -x erts-5.7.5/bin/start_erl.src erts-5.7.5/bin/start.src
+ 
+ cd ..
+ 
+ ##
+ # Configure and package CouchDB
+ # 
+ 
+ cp -Rdp /sdcard sdcard.package
+ 
+ mv sdcard.package/couch/lib/couchdb/erlang/lib/couch-1.0.1 otp_rel.package/lib
+ mv sdcard.package/couch/lib/couchdb/bin/couchjs $RELEASE/data/data/com.your.namespace/bin
+ cp mozilla-central/js/src/libmozjs.so $RELEASE/data/data/com.your.namespace/bin
+ #cp mozilla-central/js/src/shell/js $RELEASE/data/data/com.your.namespace/bin
+ 
+ cd sdcard.package/couch
+ 
+ # Reflect updated locations and the Android environment
+ patch -p1 < ../../../sdcard.patch
+ 
+ cd ../../..
+ 
+ ##
+ # Finally move things into place
+ #
+ 
+ mv otp_rel.package $RELEASE/data/data/com.your.namespace/erlang
+ mv sdcard.package $RELEASE/sdcard
+ 
+ cd $RELEASE
+ 
+ ###
+ # 1) DNS fixes from apage43's couchdb-android.s3.amazonaws.com/dns-fix.tgz
+ # 2) Create couchjs_wrapper script (because we can't link to libmozjs.a and so need LD_LIBRARY_PATH
set)
+ # 2) Update #!/bin/sh in data/data/com.your.namespace/erlang/lib/couch-1.0.1/priv/couchspawnkillable
+ #
+ patch -p1 < ../release.patch
+ 
+ chmod +x data/data/com.your.namespace/bin/couchjs_wrapper
+ 
+ # Build ICU for whatever version of Android was compiled in ~/rdinc/software/android/sdk/sources
+ source $HOME/rdinc/software/android/scripts/env
+ 
+ agcc \
+ -shared \
+ -o data/data/com.your.namespace/couch_icu_driver.so ../couchdb/src/couchdb/priv/.libs/libcouch_icu_driver.a
\
+ -licuuc \
+ -licudata \
+ -licui18n \
+ -L$HOME/projects/couch/android-build/otp_rel/erts-5.7.5/bin \
+ -lbeam
+ 
+ ##
+ # Archive the release
+ #
+ tar -czf ../release-$1.tgz *
+ 
+ cd ..
+ }}}
+ 

Mime
View raw message