aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar DINH Viet Hoa <hoa@sprw.me>2013-01-11 01:08:18 -0800
committerGravatar DINH Viet Hoa <hoa@sprw.me>2013-01-11 01:08:18 -0800
commit739b68a69682d80d8247d4465eae7b182acc9da0 (patch)
tree34c33738bc0761d30c13f7f9b88fdf0d5c8cb4a9 /scripts
parentf83e0e9ba3da2b8887f849483506d5de8f1d2c54 (diff)
first commit
Diffstat (limited to 'scripts')
-rw-r--r--scripts/.DS_Storebin0 -> 6148 bytes
-rwxr-xr-xscripts/prepare-icu4c-macos.sh123
-rwxr-xr-xscripts/prepare-libetpan-macos.sh83
-rwxr-xr-xscripts/prepare.sh3
4 files changed, 209 insertions, 0 deletions
diff --git a/scripts/.DS_Store b/scripts/.DS_Store
new file mode 100644
index 00000000..5008ddfc
--- /dev/null
+++ b/scripts/.DS_Store
Binary files differ
diff --git a/scripts/prepare-icu4c-macos.sh b/scripts/prepare-icu4c-macos.sh
new file mode 100755
index 00000000..e9ab7d37
--- /dev/null
+++ b/scripts/prepare-icu4c-macos.sh
@@ -0,0 +1,123 @@
+#!/bin/sh
+
+versionfolder='50.1.1'
+version='50_1_1'
+url="http://download.icu-project.org/files/icu4c/$versionfolder/icu4c-$version-src.tgz"
+package_filename="icu4c-$version-src.tgz"
+arch="x86_64"
+sysrootpath="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"
+
+arch_flags=""
+for current_arch in $arch ; do
+ arch_flags="$arch_flags -arch $current_arch"
+done
+
+builddir="$HOME/MailCore-Builds/dependencies"
+BUILD_TIMESTAMP=`date +'%Y%m%d%H%M%S'`
+tempbuilddir="$builddir/workdir/$BUILD_TIMESTAMP"
+mkdir -p "$tempbuilddir"
+srcdir="$tempbuilddir/src"
+logdir="$tempbuilddir/log"
+resultdir="$builddir/builds"
+tmpdir="$tempbuilddir/tmp"
+
+if test -f "$resultdir/icu4c-$version.zip" ; then
+ echo install from cache
+ rm -rf ../Externals/icu4c
+ mkdir -p ../Externals/tmp
+ unzip -q "$resultdir/icu4c-$version.zip" -d ../Externals/tmp
+ mv "../Externals/tmp/icu4c-$version/icu4c" ../Externals
+ rm -rf ../Externals/tmp
+ exit 0
+fi
+
+mkdir -p "$resultdir"
+mkdir -p "$logdir"
+mkdir -p "$tmpdir"
+mkdir -p "$srcdir"
+
+pushd . >/dev/null
+
+echo get icu4c
+cd "$srcdir"
+if test -f "$builddir/downloads/$package_filename" ; then
+ cp "$builddir/downloads/$package_filename" .
+else
+ curl -O "$url"
+ if test x$? != x0 ; then
+ echo fetch of icu4c failed
+ exit 1
+ fi
+ mkdir -p "$builddir/downloads"
+ cp "$package_filename" "$builddir/downloads"
+fi
+
+tar xf "$package_filename"
+
+echo building icu4c
+cd "$srcdir/icu/source"
+for cur_arch in $arch ; do
+ cur_arch_flags="-arch $cur_arch"
+ echo building icu4c for $cur_arch
+ export CFLAGS="$cur_arch_flags -isysroot $sysrootpath -mfix-and-continue -mmacosx-version-min=10.7"
+ export CXXFLAGS="$cur_arch_flags -isysroot $sysrootpath -mfix-and-continue -mmacosx-version-min=10.7"
+ export LDLAGS="$cur_arch_flags -isysroot $sysrootpath -mfix-and-continue -mmacosx-version-min=10.7"
+ mkdir -p "$tmpdir/bin/icu4c-$cur_arch"
+ cd "$tmpdir/bin/icu4c-$cur_arch"
+ if test "x$cur_arch" = xx86_64 ; then
+ "$srcdir/icu/source/configure" --enable-static --disable-shared --with-data-packaging=archive >> "$logdir/icu4c-build.log"
+ else
+ "$srcdir/icu/source/configure" --host=$cur_arch-apple-darwin10.6.0 --enable-static --disable-shared --with-data-packaging=archive --with-cross-build=$tmpdir/crossbuild/icu4c-x86_64 >> "$logdir/icu4c-build.log"
+ fi
+ make >> "$logdir/icu4c-build.log"
+ make install "prefix=$tmpdir/bin/icu4c-$cur_arch" >> "$logdir/icu4c-build.log"
+ if test "x$cur_arch" = xx86_64 ; then
+ make install "prefix=$tmpdir/crossbuild/icu4c-$cur_arch" >> "$logdir/icu4c-build.log"
+ fi
+ if test x$? != x0 ; then
+ echo build of icu4c failed
+ exit 1
+ fi
+ #make distclean
+done
+
+mkdir -p "$tmpdir/bin/icu4c"
+cp -R "$tmpdir/bin/icu4c-x86_64/include" "$tmpdir/bin/icu4c"
+mkdir -p "$tmpdir/bin/icu4c/share/icu"
+cp "$tmpdir/bin/icu4c-x86_64/share/icu/$versionfolder/icudt50l.dat" "$tmpdir/bin/icu4c/share/icu"
+mkdir -p "$tmpdir/bin/icu4c/lib"
+cd "$tmpdir/bin"
+
+icui18n_paths=""
+icudata_paths=""
+icuuc_paths=""
+for cur_arch in $arch ; do
+ icui18n_paths="$icui18n_paths icu4c-$cur_arch/lib/libicui18n.a"
+ icudata_paths="$icudata_paths icu4c-$cur_arch/lib/libicudata.a"
+ icuuc_paths="$icuuc_paths icu4c-$cur_arch/lib/libicuuc.a"
+done
+lipo -create $icui18n_paths -output icu4c/lib/libicui18n.a
+lipo -create $icudata_paths -output icu4c/lib/libicudata.a
+lipo -create $icuuc_paths -output icu4c/lib/libicuuc.a
+
+cd "$tmpdir/bin"
+mkdir -p "icu4c-$version"
+mv icu4c "icu4c-$version"
+zip -qry "$resultdir/icu4c-$version.zip" "icu4c-$version"
+rm -f "$resultdir/icu4c-latest.zip"
+cd "$resultdir"
+ln -s "icu4c-$version.zip" "icu4c-latest.zip"
+
+echo build of icu4c-$version done
+
+popd
+
+rm -rf ../Externals/icu4c
+mkdir -p ../Externals/tmp
+unzip -q "$resultdir/icu4c-$version.zip" -d ../Externals/tmp
+mv "../Externals/tmp/icu4c-$version/icu4c" ../Externals
+rm -rf ../Externals/tmp
+
+echo cleaning
+rm -rf "$tempbuilddir"
+echo "$tempbuilddir"
diff --git a/scripts/prepare-libetpan-macos.sh b/scripts/prepare-libetpan-macos.sh
new file mode 100755
index 00000000..c6079c34
--- /dev/null
+++ b/scripts/prepare-libetpan-macos.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+arch="x86_64"
+sysrootpath="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"
+url="https://github.com/dinhviethoa/libetpan.git"
+
+arch_flags=""
+for current_arch in $arch ; do
+ arch_flags="$arch_flags -arch $current_arch"
+done
+
+builddir="$HOME/MailCore-Builds/dependencies"
+BUILD_TIMESTAMP=`date +'%Y%m%d%H%M%S'`
+tempbuilddir="$builddir/workdir/$BUILD_TIMESTAMP"
+mkdir -p "$tempbuilddir"
+srcdir="$tempbuilddir/src"
+logdir="$tempbuilddir/log"
+resultdir="$builddir/builds"
+tmpdir="$tempbuilddir/tmp"
+
+mkdir -p "$resultdir"
+mkdir -p "$logdir"
+mkdir -p "$tmpdir"
+mkdir -p "$srcdir"
+
+pushd . >/dev/null
+cd "$builddir/downloads"
+if test -d libetpan ; then
+ cd libetpan
+ git pull --rebase
+else
+ git clone $url
+ cd libetpan
+fi
+version=`git rev-parse HEAD | cut -c1-10`
+
+if test -f "$resultdir/libetpan-$version.zip" ; then
+ echo install from cache
+ popd >/dev/null
+ rm -rf ../Externals/libetpan
+ mkdir -p ../Externals/tmp
+ unzip -q "$resultdir/libetpan-$version.zip" -d ../Externals/tmp
+ mv "../Externals/tmp/libetpan-$version/libetpan" ../Externals
+ rm -rf ../Externals/tmp
+ exit 0
+fi
+popd >/dev/null
+
+pushd . >/dev/null
+
+cp -R "$builddir/downloads/libetpan" "$srcdir/libetpan"
+echo building libetpan
+cd "$srcdir/libetpan"
+./autogen.sh
+cd "$srcdir/libetpan/build-mac"
+./update.sh
+
+xcodebuild -target "static libetpan" -configuration Release SYMROOT="$tmpdir/bin" OBJROOT="$tmpdir/obj"
+echo finished
+
+cd "$tmpdir/bin"
+mkdir -p "libetpan-$version/libetpan"
+mkdir -p "libetpan-$version/libetpan/lib"
+mv Release/include "libetpan-$version/libetpan"
+mv Release/libetpan.a "libetpan-$version/libetpan/lib"
+zip -qry "$resultdir/libetpan-$version.zip" "libetpan-$version"
+rm -f "$resultdir/libetpan-latest.zip"
+cd "$resultdir"
+ln -s "libetpan-$version.zip" "libetpan-latest.zip"
+
+echo build of libetpan-$version done
+
+popd >/dev/null
+
+rm -rf ../Externals/libetpan
+mkdir -p ../Externals/tmp
+unzip -q "$resultdir/libetpan-$version.zip" -d ../Externals/tmp
+mv "../Externals/tmp/libetpan-$version/libetpan" ../Externals
+rm -rf ../Externals/tmp
+
+echo cleaning
+rm -rf "$tempbuilddir"
+echo "$tempbuilddir"
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
new file mode 100755
index 00000000..3e3cb9b1
--- /dev/null
+++ b/scripts/prepare.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+./prepare-icu4c-macos.sh
+./prepare-libetpan-macos.sh