aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorPo Lu2025-02-12 11:14:29 +0800
committerPo Lu2025-02-12 11:14:37 +0800
commitea3a937176fbf038a6f6f5cc7b47fb8cecdd894a (patch)
tree4388c1f02e1a6575dccc97ed4f8f5018921c0882 /admin
parent13608ad64d13145df88b86a8efa893be42244792 (diff)
downloademacs-ea3a937176fbf038a6f6f5cc7b47fb8cecdd894a.tar.gz
emacs-ea3a937176fbf038a6f6f5cc7b47fb8cecdd894a.zip
; Add a utility script for retrieving Android port dependencies
* admin/download-android-deps.sh: New file.
Diffstat (limited to 'admin')
-rw-r--r--admin/download-android-deps.sh133
1 files changed, 133 insertions, 0 deletions
diff --git a/admin/download-android-deps.sh b/admin/download-android-deps.sh
new file mode 100644
index 00000000000..e40392381d7
--- /dev/null
+++ b/admin/download-android-deps.sh
@@ -0,0 +1,133 @@
1#!/bin/sh
2
3# This script downloads and extracts dependencies from
4# https://sourceforge.net/projects/android-ports-for-gnu-emacs/ and
5# Android source code repositories for the convenience of packagers.
6#
7# See https://forum.f-droid.org/t/emacs-packaging/30424/12 for
8# context.
9
10set -e
11
12bits_64=no
13
14if [ "$1" == "64" ]; then
15 bits_64=yes
16fi
17
18ndk_path=
19
20mirror=${2-https://master.dl.sourceforge.net/project/android-ports-for-gnu-emacs}
21
22download_tarball ()
23{
24 echo "Downloading $mirror/$1"
25 curl -OL $mirror/$1
26 hash=`shasum $1 | cut -d " " -f 1`
27 if test "$hash" != "$3"; then
28 echo "Hash mismatch detected with archive $1:\
29 expected $3, but received $hash."
30 exit 1
31 fi
32 tar xfz $1 $2
33
34 if test ! -d "$2"; then
35 echo "\`$1' was extracted but without producing the directory \`$2'." >&2
36 exit 1
37 fi
38
39 ndk_path="$ndk_path $PWD/$2"
40}
41
42# 31e74492a49cde9e420e2c71f6d6de0f2b9d6fd3 cairo-1.16.0-emacs.tar.gz
43# 98de96764c64f31a6df23adec65425e1813f571b gdk-pixbuf-2.22.1-emacs.tar.gz
44# a407c568961d729bb2d0175a34e0d4ed4a269978 giflib-5.2.1-emacs.tar.gz
45# e63bc0a628cec770a3a5124c00873d4a44c8c1ac glib-2.33.14-emacs.tar.gz
46# 66518ea7905cdb42a22b6f003551ca3f73d249f0 gmp-6.3.0-emacs.tar.gz
47# 4e92fb479c96f1c0e9eb3577262f1ebe609a752e gnutls-3.8.5-emacs-armv7a.tar.gz
48# 0491c778a81e42490789db9b30a9b7c69b650618 gnutls-3.8.5-emacs.tar.gz
49# 22dc71d503ab2eb263dc8411de9da1db144520f5 harfbuzz-7.1.0-emacs.tar.gz
50# 590f6c6c06dfe19a8190f526b5b76de34b999a07 libcroco-0.6.13-emacs.tar.gz
51# 23508b52a8d9fc3f3750c0187e4141b0d06f79c9 libffi-3.4.5-emacs.tar.gz
52# b9398f30e882b140ec790a761663e829ba9bce31 libiconv-1.17-emacs.tar.gz
53# 5091fe6f8b368ea2dcc92e2fd003add7bbc63a0a libjpeg-turbo-3.0.2-emacs.tar.gz
54# 85e10d1d289d7fd4621cb9648533a0cc69f352a8 libpng-1.6.41-emacs.tar.gz
55# 8361966e19fe25ae987b08799f1442393ae6366b libselinux-3.6-emacs.tar.gz
56# fdc827211075d9b70a8ba6ceffa02eb48d6741e9 libtasn1-4.19.0-emacs.tar.gz
57# 73c3174f7b22d3cfedad9eb58db916199575eea4 libxml2-2.12.4-emacs.tar.gz
58# 94882f5494e5435f885d64b57e3e7b3ee5345a3b nettle-3.8-emacs.tar.gz
59# b4680fcfec66220a09618489584c8f3270cc16fd p11-kit-0.24.1-emacs.tar.gz
60# 89bb17b09d4381835b32291a65107dc33281e88b pango-1.38.1-emacs.tar.gz
61# 1c8f3b0cbad474da0ab09018c4ecf2119ac4a52d pixman-0.38.4-emacs.tar.gz
62# b687c8439d51634d921674dd009645e24873ca36 rsvg-2.40.21-emacs.tar.gz
63# eda251614598aacb06f5984a0a280833de456b29 tiff-4.5.1-emacs.tar.gz
64# c00d0ea9c6e848f5cce350cb3ed742024f2bdb8b tree-sitter-0.20.7-emacs.tar.gz
65
66download_tarball "giflib-5.2.1-emacs.tar.gz" "giflib-5.2.1" \
67 "a407c568961d729bb2d0175a34e0d4ed4a269978"
68download_tarball "libjpeg-turbo-3.0.2-emacs.tar.gz" "libjpeg-turbo-3.0.2" \
69 "5091fe6f8b368ea2dcc92e2fd003add7bbc63a0a"
70download_tarball "libpng-1.6.41-emacs.tar.gz" "libpng-1.6.41" \
71 "85e10d1d289d7fd4621cb9648533a0cc69f352a8"
72download_tarball "libxml2-2.12.4-emacs.tar.gz" "libxml2-2.12.4" \
73 "73c3174f7b22d3cfedad9eb58db916199575eea4"
74download_tarball "gmp-6.3.0-emacs.tar.gz" "gmp-6.3.0" \
75 "66518ea7905cdb42a22b6f003551ca3f73d249f0"
76download_tarball "nettle-3.8-emacs.tar.gz" "nettle-3.8" \
77 "94882f5494e5435f885d64b57e3e7b3ee5345a3b"
78
79if test "$bits_64" = "yes"; then
80 download_tarball "gnutls-3.8.5-emacs.tar.gz" "gnutls-3.8.5" \
81 "0491c778a81e42490789db9b30a9b7c69b650618"
82else
83 download_tarball "gnutls-3.8.5-emacs-armv7a.tar.gz" "gnutls-3.8.5-armv7a" \
84 "4e92fb479c96f1c0e9eb3577262f1ebe609a752e"
85fi
86
87download_tarball "p11-kit-0.24.1-emacs.tar.gz" "p11-kit-0.24.1" \
88 "b4680fcfec66220a09618489584c8f3270cc16fd"
89download_tarball "libtasn1-4.19.0-emacs.tar.gz" "libtasn1-4.19.0" \
90 "fdc827211075d9b70a8ba6ceffa02eb48d6741e9"
91download_tarball "libselinux-3.6-emacs.tar.gz" "libselinux-3.6" \
92 "8361966e19fe25ae987b08799f1442393ae6366b"
93download_tarball "tree-sitter-0.20.7-emacs.tar.gz" "tree-sitter-0.20.7" \
94 "c00d0ea9c6e848f5cce350cb3ed742024f2bdb8b"
95download_tarball "harfbuzz-7.1.0-emacs.tar.gz" "harfbuzz-7.1.0" \
96 "22dc71d503ab2eb263dc8411de9da1db144520f5"
97download_tarball "tiff-4.5.1-emacs.tar.gz" "tiff-4.5.1" \
98 "eda251614598aacb06f5984a0a280833de456b29"
99download_tarball "gdk-pixbuf-2.22.1-emacs.tar.gz" "gdk-pixbuf-2.22.1" \
100 "98de96764c64f31a6df23adec65425e1813f571b"
101download_tarball "glib-2.33.14-emacs.tar.gz" "glib-2.33.14" \
102 "e63bc0a628cec770a3a5124c00873d4a44c8c1ac"
103download_tarball "libcroco-0.6.13-emacs.tar.gz" "libcroco-0.6.13" \
104 "590f6c6c06dfe19a8190f526b5b76de34b999a07"
105download_tarball "rsvg-2.40.21-emacs.tar.gz" "librsvg-2.40.21" \
106 "b687c8439d51634d921674dd009645e24873ca36"
107download_tarball "cairo-1.16.0-emacs.tar.gz" "cairo-1.16.0" \
108 "31e74492a49cde9e420e2c71f6d6de0f2b9d6fd3"
109download_tarball "libiconv-1.17-emacs.tar.gz" "libiconv-1.17" \
110 "b9398f30e882b140ec790a761663e829ba9bce31"
111download_tarball "pango-1.38.1-emacs.tar.gz" "pango-1.38.1" \
112 "89bb17b09d4381835b32291a65107dc33281e88b"
113download_tarball "pixman-0.38.4-emacs.tar.gz" "pixman-0.38.4" \
114 "1c8f3b0cbad474da0ab09018c4ecf2119ac4a52d"
115download_tarball "libffi-3.4.5-emacs.tar.gz" "libffi-3.4.5" \
116 "23508b52a8d9fc3f3750c0187e4141b0d06f79c9"
117
118rm -rf sqlite
119git clone https://android.googlesource.com/platform/external/sqlite -b android-7.1.2_r39
120ndk_path="$ndk_path $PWD/sqlite/dist"
121rm -rf pcre
122git clone https://android.googlesource.com/platform/external/pcre -b android-7.1.2_r39
123ndk_path="$ndk_path $PWD/pcre"
124rm -rf libwebp
125git clone https://chromium.googlesource.com/webm/libwebp -b v1.5.0
126ndk_path="$ndk_path $PWD/libwebp"
127
128sed -e 's/NEON := c.neon/NEON := c/g' \
129 -e '/WEBP_CFLAGS *+=/s/-DHAVE_CPU_FEATURES_H//g' \
130 -e 's/USE_CPUFEATURES *.*=.*$/USE_CPUFEATURES := no/g' \
131 -i libwebp/Android.mk
132
133echo $ndk_path > search-path.txt