forked from P3TERX/Aria2-Pro-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aria2-gnu-linux-cross-build-arm64.sh
executable file
·85 lines (74 loc) · 1.8 KB
/
aria2-gnu-linux-cross-build-arm64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env bash
#
# Copyright (c) 2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Aria2-Pro-Core
# File name: aria2-gnu-linux-cross-build-arm64.sh
# Description: Aria2 ard64 platform cross build
# System Required: Debian & Ubuntu & Fedora & Arch Linux
# Version: 1.6
#
set -e
[ $EUID != 0 ] && SUDO=sudo
$SUDO echo
SCRIPT_DIR=$(dirname $(readlink -f $0))
## CONFIG ##
ARCH="arm64"
HOST="aarch64-linux-gnu"
OPENSSL_ARCH="linux-aarch64"
BUILD_DIR="/tmp"
ARIA2_CODE_DIR="$BUILD_DIR/aria2"
OUTPUT_DIR="$HOME/output"
PREFIX="$BUILD_DIR/aria2-cross-build-libs-$ARCH"
ARIA2_PREFIX="$HOME/aria2-local"
export CURL_CA_BUNDLE="/etc/ssl/certs/ca-certificates.crt"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export LD_LIBRARY_PATH="$PREFIX/lib"
export CC="$HOST-gcc"
export CXX="$HOST-g++"
export STRIP="$HOST-strip"
export RANLIB="$HOST-ranlib"
export AR="$HOST-ar"
export LD="$HOST-ld"
## DEPENDENCES ##
source $SCRIPT_DIR/dependences
## TOOLCHAIN ##
source $SCRIPT_DIR/snippet/cross-toolchain
TOOLCHAIN() {
if [ -x "$(command -v apt-get)" ]; then
DEBIAN_INSTALL
elif [ -x "$(command -v dnf)" ]; then
FEDORA_INSTALL
elif [ -x "$(command -v pacman)" ]; then
ARCH_INSTALL
else
echo -e "This operating system is not supported !"
exit 1
fi
}
## BUILD ##
source $SCRIPT_DIR/snippet/cross-build
## ARIA2 COEDE ##
source $SCRIPT_DIR/snippet/aria2-code
## ARIA2 BIN ##
source $SCRIPT_DIR/snippet/aria2-bin
## CLEAN ##
source $SCRIPT_DIR/snippet/clean
## BUILD PROCESS ##
TOOLCHAIN
ZLIB_BUILD
EXPAT_BUILD
C_ARES_BUILD
OPENSSL_BUILD
SQLITE3_BUILD
LIBSSH2_BUILD
#JEMALLOC_BUILD
ARIA2_BUILD
#ARIA2_BIN
ARIA2_PACKAGE
#ARIA2_INSTALL
CLEANUP_ALL
echo "finished!"