p≡p engine fork for my own dirty testing of stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.7 KiB

  1. #!/bin/sh
  2. # This file is under GNU General Public License 3.0
  3. # see LICENSE.txt
  4. set -e
  5. build_version=1
  6. ANDROID_PLATFORM=android-18
  7. libetpan_build_version=1
  8. archs="armeabi armeabi-v7a x86 x86_64"
  9. package_name=pEpEngine-android
  10. current_dir="`pwd`"
  11. if test "x$ANDROID_NDK" = x ; then
  12. echo should set ANDROID_NDK before running this script.
  13. exit 1
  14. fi
  15. if test "x$GPGME_INCLUDE_PATH" = x ; then
  16. echo should set GPGME_INCLUDE_PATH before running this script.
  17. exit 1
  18. fi
  19. if test "x$LIBETPAN_PATH" = x ; then
  20. echo should set LIBETPAN_PATH before running this script.
  21. exit 1
  22. fi
  23. libetpan_dir=$LIBETPAN_PATH
  24. function build {
  25. rm -rf "$current_dir/obj"
  26. cd "$current_dir/jni"
  27. $ANDROID_NDK/ndk-build V=1 TARGET_PLATFORM=$ANDROID_PLATFORM TARGET_ARCH_ABI=$TARGET_ARCH_ABI \
  28. LIBETPAN_PATH="$current_dir/third-party/libetpan-android-$libetpan_build_version"
  29. mkdir -p "$current_dir/$package_name-$build_version/libs/$TARGET_ARCH_ABI"
  30. cp "$current_dir/obj/local/$TARGET_ARCH_ABI/libpEpEngine.a" "$current_dir/$package_name-$build_version/libs/$TARGET_ARCH_ABI"
  31. rm -rf "$current_dir/obj"
  32. }
  33. mkdir -p "$current_dir/third-party"
  34. cd "$current_dir/third-party"
  35. unzip -qo "$libetpan_dir/libetpan-android-$libetpan_build_version.zip"
  36. # Copy public headers to include
  37. mkdir -p "$current_dir/$package_name-$build_version/include/pEp"
  38. cd "$current_dir/../src"
  39. cp *.h "$current_dir/$package_name-$build_version/include/pEp"
  40. # Generate asn.1
  41. cd "$current_dir/../asn.1"
  42. make generate
  43. # Generate asn.1
  44. cd "$current_dir/../sync"
  45. make
  46. # Start building.
  47. for arch in $archs ; do
  48. TARGET_ARCH_ABI=$arch
  49. build
  50. done
  51. rm -rf "$current_dir/third-party"
  52. cd "$current_dir"
  53. zip -qry "$package_name-$build_version.zip" "$package_name-$build_version"
  54. rm -rf "$package_name-$build_version"