Browse Source

JNI-81 Clean android build: Move common to downloads

JNI-88
Hussein Kasem 6 years ago
parent
commit
179fc860eb
  1. 8
      android/external/Makefile
  2. 88
      android/external/arm64-v8a/Makefile
  3. 87
      android/external/armeabi-v7a/Makefile
  4. 53
      android/external/common/Makefile
  5. 102
      android/external/downloads/Makefile
  6. 0
      android/external/downloads/gmp-6.1.2.tar.bz2.md5
  7. 0
      android/external/downloads/nettle-3.4.1.tar.gz.md5
  8. 0
      android/external/downloads/openssl-1.1.1b.tar.gz.md5
  9. 0
      android/external/downloads/ossp-uuid_1.6.2.orig.tar.gz.md5

8
android/external/Makefile

@ -23,7 +23,7 @@ endif
all: build
build: libiconv-1.15.tar.gz
build: downloads/downloads.stamp
$(MAKE) -C armeabi-v7a
$(MAKE) -C arm64-v8a
@ -32,11 +32,11 @@ clean:
$(MAKE) -C arm64-v8a clean
clean-all:
$(MAKE) -C common clean
$(MAKE) -C downloads clean
$(MAKE) -C armeabi-v7a clean-all
$(MAKE) -C arm64-v8a clean-all
libiconv-1.15.tar.gz:
$(MAKE) -C common
downloads/downloads.stamp:
$(MAKE) -C downloads
assets:

88
android/external/arm64-v8a/Makefile

@ -90,8 +90,8 @@ showsetup:
#------------------------------------------------------------------------------#
# libiconv
libiconv.src.stamp: ../libiconv-1.15.tar.gz
tar xvfz ../libiconv-1.15.tar.gz
libiconv.src.stamp: ../downloads/libiconv-1.15.tar.gz
tar xvfz $<
mv libiconv-1.15 libiconv
touch $@
@ -125,6 +125,10 @@ libiconv-install: $(LOCAL)/lib/libiconv.a
#------------------------------------------------------------------------------#
# libetpan
libetpan.src.stamp: ../downloads/libetpan.tar.gz
mkdir -p libetpan
cd libetpan && tar xvfz ../$<
touch $@
libetpan/Makefile: libetpan.src.stamp | libiconv-install
cd libetpan/build-android; ICONV_PREFIX=$(LOCAL) bash ./build.sh
@ -139,8 +143,8 @@ libetpan-cleanzip:
#------------------------------------------------------------------------------#
# uuid
uuid.src.stamp: ../ossp-uuid_1.6.2.orig.tar.gz
tar xvfz ../ossp-uuid_1.6.2.orig.tar.gz
uuid.src.stamp: ../downloads/ossp-uuid_1.6.2.orig.tar.gz
tar xvf $<
mv uuid-1.6.2 uuid
touch $@
@ -187,13 +191,13 @@ uuid/jni/Android.mk: uuid.src.stamp
#------------------------------------------------------------------------------#
# Sequoia
sequoia-deps-build: gmp-install nettle-install openssl-install
sequoia-deps-build: openssl-install nettle-install
#------------------------------------------------------------------------------#
# OpenSSL
openssl.src.stamp: ../openssl-$(OPENSSL_VERSION).tar.gz
tar xvf ../openssl-$(OPENSSL_VERSION).tar.gz
openssl.src.stamp: ../downloads/openssl-$(OPENSSL_VERSION).tar.gz
tar xvf $<
mv openssl-$(OPENSSL_VERSION) openssl
touch $@
@ -227,8 +231,8 @@ openssl-install: $(LOCAL)/lib/libssl.so
#------------------------------------------------------------------------------#
# GMP
gmp.src.stamp: ../gmp-$(GMP_VERSION).tar.bz2
tar xvf ../gmp-$(GMP_VERSION).tar.bz2
gmp.src.stamp: ../downloads/gmp-$(GMP_VERSION).tar.bz2
tar xvf $<
mv gmp-$(GMP_VERSION) gmp
touch $@
@ -265,12 +269,12 @@ gmp-install: $(LOCAL)/lib/libgmp.so
#------------------------------------------------------------------------------#
# NETTLE
nettle.src.stamp: ../nettle-$(NETTLE_VERSION).tar.gz $(LOCAL)/lib/libgmp.so
tar xvf ../nettle-$(NETTLE_VERSION).tar.gz
nettle.src.stamp: ../downloads/nettle-$(NETTLE_VERSION).tar.gz $(LOCAL)/lib/libgmp.so
tar xvf $<
mv nettle-$(NETTLE_VERSION) nettle
touch $@
nettle-src: nettle.src.stamp
nettle-src: nettle.src.stamp gmp-install
nettle-clean:
rm -rf nettle
@ -284,18 +288,20 @@ nettle/Makefile: nettle.src.stamp
./configure \
--with-lib-path=$(LOCAL)/lib \
--with-include-path=$(LOCAL)/include \
--disable-static \
--disable-documentation \
--host=$(HOST) \
--prefix=$(LOCAL)
nettle/libnettle.so: nettle/Makefile
$(MAKE) -C nettle
$(LOCAL)/lib/libnettle.so: nettle/libnettle.so nettle/libhogweed.so
$(LOCAL)/lib/libnettle.so: nettle/libnettle.so
$(MAKE) -C nettle DESTDIR=$(DESTDIR) prefix=$(prefix) install
nettle-build: nettle/libnettle.so nettle/libhogweed.so
nettle-build: nettle/libnettle.so
nettle-install: $(LOCAL)/lib/libnettle.so $(LOCAL)/lib/libhogweed.so
nettle-install: $(LOCAL)/lib/libnettle.so
#------------------------------------------------------------------------------#
@ -303,6 +309,11 @@ nettle-install: $(LOCAL)/lib/libnettle.so $(LOCAL)/lib/libhogweed.so
CARGO_TARGET_DIR=$(EXTERNAL_ROOT)/build/$(APP_ABI)
sequoia.src.stamp: ../downloads/sequoia.tar.gz
mkdir -p sequoia
cd sequoia && tar xvf ../$<
touch $@
sequoia-ffi-clean:
rm -rf sequoia
rm -rf sequoia.src.stamp
@ -353,53 +364,6 @@ sequoia-ffi-install: sequoia-deps-build $(LOCAL)/lib/libsequoia_openpgp_ffi.so
# rm -rf $(ASSETS)/tests
#
#------------------------------------------------------------------------------#
# Clone update and archive external projects GIT repos
# Local clone is in external/$project.git while
# selected commit is archived in external/$project
define per_repo_targets
$(1).git.stamp:
git clone $(2) $(1).git
touch $(1).git.stamp
$(1).git_update: $(1).git.stamp
cd $(1).git; git pull
touch $(1).git.stamp
$(1).src.stamp: $(1).git.stamp
rm -rf $(1)
mkdir $(1)
(cd $(1).git; git archive --format=tar $(3)) | tar -C $(1) -x
touch $(1).src.stamp
$(1)-src: $(1).src.stamp
$(1)-clean:
rm -rf $(1)
rm -f $(1).src.stamp
EXTERNAL_LOCAL_GITS += $(1).git.stamp
EXTERNAL_LOCAL_GITS_UPDATE += $(1).git_update
EXTERNAL_SRCS += $(1)-src
EXTERNAL_SRCS_CLEAN += $(1)-clean
endef
define per_repo
$(call per_repo_targets,\
$(1),\
$(word 1,$(subst ?, ,$(2))),\
$(word 2,$(subst ?, ,$(2))))
endef
$(foreach repo, $(EXTERNAL_GIT_REPOS), $(eval $(call per_repo,\
$(word 1,$(subst |, ,$(repo))),\
$(word 2,$(subst |, ,$(repo))))))
git_clones: $(EXTERNAL_LOCAL_GITS)
git_update: $(EXTERNAL_LOCAL_GITS_UPDATE)
#------------------------------------------------------------------------------#
# clean

87
android/external/armeabi-v7a/Makefile

@ -90,12 +90,8 @@ showsetup:
#------------------------------------------------------------------------------#
# libiconv
libiconv-1.15.tar.gz:
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
touch $@
libiconv.src.stamp: ../libiconv-1.15.tar.gz
tar xvfz ../libiconv-1.15.tar.gz
libiconv.src.stamp: ../downloads/libiconv-1.15.tar.gz
tar xvf $<
mv libiconv-1.15 libiconv
touch $@
@ -129,6 +125,10 @@ libiconv-install: $(LOCAL)/lib/libiconv.a
#------------------------------------------------------------------------------#
# libetpan
libetpan.src.stamp: ../downloads/libetpan.tar.gz
mkdir -p sequoia
cd sequoia && tar xvf ../$<
touch $@
libetpan/Makefile: libetpan.src.stamp | libiconv-install
cd libetpan/build-android; ICONV_PREFIX=$(LOCAL) bash ./build.sh
@ -145,8 +145,8 @@ libetpan-cleanzip:
# using released package from debian. official ftp wasn't available today
uuid.src.stamp: ../ossp-uuid_1.6.2.orig.tar.gz
tar xvfz ../ossp-uuid_1.6.2.orig.tar.gz
uuid.src.stamp: ../downloads/ossp-uuid_1.6.2.orig.tar.gz
tar xvfz $<
mv uuid-1.6.2 uuid
touch $@
@ -196,13 +196,13 @@ OPENSSL_VERSION=1.1.1b
GMP_VERSION=6.1.2
NETTLE_VERSION=3.4.1
sequoia-deps-build: gmp-install nettle-install openssl-install
sequoia-deps-build: openssl-install nettle-install
#------------------------------------------------------------------------------#
# OpenSSL
openssl.src.stamp: ../openssl-$(OPENSSL_VERSION).tar.gz
tar xvf ../openssl-$(OPENSSL_VERSION).tar.gz
openssl.src.stamp: ../downloads/openssl-$(OPENSSL_VERSION).tar.gz
tar xvf $<
mv openssl-$(OPENSSL_VERSION) openssl
touch $@
@ -226,7 +226,7 @@ $(LOCAL)/lib/libssl.so: openssl/libssl.so
cp libcrypto.so $(LOCAL)/lib && \
cp libcrypto.a $(LOCAL)/lib && \
cp libssl.so $(LOCAL)/lib && \
cp libssl.a $(LOCAL)/lib
cp libssl.a $(LOCAL)/lib
ls -l $(LOCAL)/lib/libssl.so
openssl-build: openssl/libssl.so
@ -237,8 +237,8 @@ openssl-install: $(LOCAL)/lib/libssl.so
#------------------------------------------------------------------------------#
# GMP
gmp.src.stamp: ../gmp-$(GMP_VERSION).tar.bz2
tar xvf ../gmp-$(GMP_VERSION).tar.bz2
gmp.src.stamp: ../downloads/gmp-$(GMP_VERSION).tar.bz2
tar xvf $<
mv gmp-$(GMP_VERSION) gmp
touch $@
@ -272,8 +272,8 @@ gmp-install: $(LOCAL)/lib/libgmp.so
#------------------------------------------------------------------------------#
# NETTLE
nettle.src.stamp: ../nettle-$(NETTLE_VERSION).tar.gz $(LOCAL)/lib/libgmp.so
tar xvf ../nettle-$(NETTLE_VERSION).tar.gz
nettle.src.stamp: ../downloads/nettle-$(NETTLE_VERSION).tar.gz $(LOCAL)/lib/libgmp.so
tar xvf $<
mv nettle-$(NETTLE_VERSION) nettle
touch $@
@ -291,24 +291,31 @@ nettle/Makefile: nettle.src.stamp
./configure \
--with-lib-path=$(LOCAL)/lib \
--with-include-path=$(LOCAL)/include \
--disable-static \
--disable-documentation \
--host=$(HOST) \
--prefix=$(LOCAL)
nettle/libnettle.so: nettle/Makefile
$(MAKE) -C nettle
$(LOCAL)/lib/libnettle.so: nettle/libnettle.so nettle/libhogweed.so
$(LOCAL)/lib/libnettle.so: nettle/libnettle.so
$(MAKE) -C nettle DESTDIR=$(DESTDIR) prefix=$(prefix) install
nettle-build: nettle/libnettle.so nettle/libhogweed.so
nettle-build: nettle/libnettle.so
nettle-install: $(LOCAL)/lib/libnettle.so $(LOCAL)/lib/libhogweed.so
nettle-install: $(LOCAL)/lib/libnettle.so
#------------------------------------------------------------------------------#
# Sequoia-ffi
CARGO_TARGET_DIR=$(EXTERNAL_ROOT)/../build/$(APP_ABI)
sequoia.src.stamp: ../downloads/sequoia.tar.gz
mkdir -p sequoia
cd sequoia && tar xvf ../$<
touch $@
sequoia-ffi-clean:
rm -rf sequoia
rm -rf sequoia.src.stamp
@ -364,48 +371,6 @@ sequoia-ffi-install: sequoia-deps-build $(LOCAL)/lib/libsequoia_openpgp_ffi.so
# Local clone is in external/$project.git while
# selected commit is archived in external/$project
define per_repo_targets
$(1).git.stamp:
git clone $(2) $(1).git
touch $(1).git.stamp
$(1).git_update: $(1).git.stamp
cd $(1).git; git pull
touch $(1).git.stamp
$(1).src.stamp: $(1).git.stamp
rm -rf $(1)
mkdir $(1)
(cd $(1).git; git archive --format=tar $(3)) | tar -C $(1) -x
touch $(1).src.stamp
$(1)-src: $(1).src.stamp
$(1)-clean:
rm -rf $(1)
rm -f $(1).src.stamp
EXTERNAL_LOCAL_GITS += $(1).git.stamp
EXTERNAL_LOCAL_GITS_UPDATE += $(1).git_update
EXTERNAL_SRCS += $(1)-src
EXTERNAL_SRCS_CLEAN += $(1)-clean
endef
define per_repo
$(call per_repo_targets,\
$(1),\
$(word 1,$(subst ?, ,$(2))),\
$(word 2,$(subst ?, ,$(2))))
endef
$(foreach repo, $(EXTERNAL_GIT_REPOS), $(eval $(call per_repo,\
$(word 1,$(subst |, ,$(repo))),\
$(word 2,$(subst |, ,$(repo))))))
git_clones: $(EXTERNAL_LOCAL_GITS)
git_update: $(EXTERNAL_LOCAL_GITS_UPDATE)
#------------------------------------------------------------------------------#
# clean

53
android/external/common/Makefile

@ -1,53 +0,0 @@
# Copyright 2019, pEp Foundation
# This file is part of pEpJNIAdapter for Android - ARM64 v8a build
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include ../Makefile.conf
#------------------------------------------------------------------------------#
# Makefile to build deps for use with pEpEngine
# based on gnupg-for-android/external/Makefile
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Build parameters
all: download-iconv download-uuid download-sequoia-deps #build-etpan download sequoia
download-iconv: ../libiconv-1.15.tar.gz
download-uuid: ../ossp-uuid_1.6.2.orig.tar.gz
download-sequoia-deps: ../openssl-$(OPENSSL_VERSION).tar.gz ../gmp-$(GMP_VERSION).tar.bz2 ../nettle-$(NETTLE_VERSION).tar.gz
# Download source and patch it
../libiconv-1.15.tar.gz:
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz -P ../
../ossp-uuid_1.6.2.orig.tar.gz:
wget http://http.debian.net/debian/pool/main/o/ossp-uuid/ossp-uuid_1.6.2.orig.tar.gz -P ../
cd .. && md5sum -c ossp-uuid_1.6.2.orig.tar.gz.md5
../openssl-$(OPENSSL_VERSION).tar.gz:
wget -nc https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz -P ../
cd .. && md5sum -c openssl-$(OPENSSL_VERSION).tar.gz.md5
../gmp-$(GMP_VERSION).tar.bz2:
wget -nc https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2 -P ../
cd .. && md5sum -c gmp-$(GMP_VERSION).tar.bz2.md5
../nettle-$(NETTLE_VERSION).tar.gz:
wget -nc https://ftp.gnu.org/gnu/nettle/nettle-$(NETTLE_VERSION).tar.gz -P ../
cd .. && md5sum -c nettle-$(NETTLE_VERSION).tar.gz.md5
clean:
rm -rf ../libiconv-1.15.tar.gz
rm -rf ../ossp-uuid_1.6.2.orig.tar.gz
rm -rf ../openssl-$(OPENSSL_VERSION).tar.gz
rm -rf ../gmp-$(GMP_VERSION).tar.bz2
rm -rf ../nettle-$(NETTLE_VERSION).tar.gz
.PHONY: clean download-iconv download-uuid

102
android/external/downloads/Makefile

@ -0,0 +1,102 @@
# Copyright 2019, pEp Foundation
# This file is part of pEpJNIAdapter for Android - ARM64 v8a build
# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
include ../Makefile.conf
#------------------------------------------------------------------------------#
# Makefile to build deps for use with pEpEngine
# based on gnupg-for-android/external/Makefile
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Build parameters
all: download-iconv download-uuid download-sequoia-deps download-etpan download-sequoia downloads.stamp
downloads.stamp:
touch $@
download-iconv: libiconv-1.15.tar.gz
download-uuid: ossp-uuid_1.6.2.orig.tar.gz
download-sequoia-deps: openssl-$(OPENSSL_VERSION).tar.gz gmp-$(GMP_VERSION).tar.bz2 nettle-$(NETTLE_VERSION).tar.gz
download-etpan: libetpan.git.stamp
download-sequoia: sequoia.git.stamp
# Download source and patch it
libiconv-1.15.tar.gz:
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
ossp-uuid_1.6.2.orig.tar.gz:
wget http://http.debian.net/debian/pool/main/o/ossp-uuid/ossp-uuid_1.6.2.orig.tar.gz
md5sum -c ossp-uuid_1.6.2.orig.tar.gz.md5
openssl-$(OPENSSL_VERSION).tar.gz:
wget -nc https://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
md5sum -c openssl-$(OPENSSL_VERSION).tar.gz.md5
gmp-$(GMP_VERSION).tar.bz2:
wget -nc https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2
md5sum -c gmp-$(GMP_VERSION).tar.bz2.md5
nettle-$(NETTLE_VERSION).tar.gz:
wget -nc https://ftp.gnu.org/gnu/nettle/nettle-$(NETTLE_VERSION).tar.gz
md5sum -c nettle-$(NETTLE_VERSION).tar.gz.md5
#------------------------------------------------------------------------------#
# Clone update and archive external projects GIT repos
# Local clone is in external/$project.git while
# selected commit is archived in external/$project
define per_repo_targets
$(1).git.stamp:
git clone $(2) $(1).git
(cd $(1).git; git archive --format=tar $(3)) > $(1).tar.gz
touch $(1).git.stamp
$(1).git_update: $(1).git.stamp
cd $(1).git; git pull
rm -rf $(1).tar.gz
(cd $(1).git; git archive --format=tar $(3)) > $(1).tar.gz
touch $(1).git.stamp
$(1)-clean:
rm -rf $(1)
rm -f $(1).src.stamp
EXTERNAL_LOCAL_GITS += $(1).git.stamp
EXTERNAL_LOCAL_GITS_UPDATE += $(1).git_update
EXTERNAL_SRCS += $(1)-src
EXTERNAL_SRCS_CLEAN += $(1)-clean
endef
define per_repo
$(call per_repo_targets,\
$(1),\
$(word 1,$(subst ?, ,$(2))),\
$(word 2,$(subst ?, ,$(2))))
endef
$(foreach repo, $(EXTERNAL_GIT_REPOS), $(eval $(call per_repo,\
$(word 1,$(subst |, ,$(repo))),\
$(word 2,$(subst |, ,$(repo))))))
git_clones: $(EXTERNAL_LOCAL_GITS)
git_update: $(EXTERNAL_LOCAL_GITS_UPDATE)
clean:
rm -rf *.git
rm -rf *.stamp
rm -rf *.tar.gz
rm -rf *.tar.bz2
.PHONY: all clean download-iconv \
download-uuid download-etpan \
download-sequoia-deps download-sequoia

0
android/external/gmp-6.1.2.tar.bz2.md5 → android/external/downloads/gmp-6.1.2.tar.bz2.md5

0
android/external/nettle-3.4.1.tar.gz.md5 → android/external/downloads/nettle-3.4.1.tar.gz.md5

0
android/external/openssl-1.1.1b.tar.gz.md5 → android/external/downloads/openssl-1.1.1b.tar.gz.md5

0
android/external/ossp-uuid_1.6.2.orig.tar.gz.md5 → android/external/downloads/ossp-uuid_1.6.2.orig.tar.gz.md5

Loading…
Cancel
Save