forked from P3TERX/Aria2-Pro-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aria2-gnu-linux-build.sh
executable file
·84 lines (73 loc) · 1.72 KB
/
aria2-gnu-linux-build.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
#!/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-build.sh
# Description: Aria2 Build on the target platforms
# 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="$(uname -m)"
OPENSSL_ARCH="linux-elf"
BUILD_DIR="/tmp"
ARIA2_CODE_DIR="$BUILD_DIR/aria2"
OUTPUT_DIR="$HOME/output"
PREFIX="$BUILD_DIR/aria2-build-libs"
ARIA2_PREFIX="/usr/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="gcc"
export CXX="g++"
export STRIP="strip"
export RANLIB="ranlib"
export AR="ar"
export LD="ld"
## DEPENDENCES ##
source $SCRIPT_DIR/dependences
## TOOLCHAIN ##
source $SCRIPT_DIR/snippet/target-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/target-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!"