-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
70 lines (54 loc) · 2.08 KB
/
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
#!/bin/bash
set -eu
MESSAGEBOT_DIR="$(pwd)"
BUILD_DIR="$MESSAGEBOT_DIR/build-linux"
if [[ ! -d "$BUILD_DIR" ]]; then
mkdir -p "$BUILD_DIR"
fi
cd "$BUILD_DIR" || exit
# OpenSSL
echo "Building openssl"
if [[ ! -f "openssl-1.1.1a.tar.gz" ]]; then
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz && tar -xzf openssl-1.1.1a.tar.gz
fi
cd openssl-1.1.1a
setarch i386 ./config -m32 no-shared no-tests && make
mkdir lib && cp ./*.a lib/
cd "$BUILD_DIR" || exit
# Zlib
echo "Building zlib"
if [[ ! -f "zlib1211.zip" ]]; then
wget http://zlib.net/zlib1211.zip && unzip -q zlib1211.zip
fi
cd zlib-1.2.11
CFLAGS=-m32 ./configure -static && make
mkdir include && mkdir lib && cp ./*.h include/ && cp libz.a lib
cd "$BUILD_DIR" || exit
# Libidn
echo "Building libidn"
if [[ ! -f "libidn2-2.0.5.tar.gz" ]]; then
wget https://ftp.gnu.org/gnu/libidn/libidn2-2.0.5.tar.gz && tar -xzf libidn2-2.0.5.tar.gz
fi
cd libidn2-2.0.5
CFLAGS=-m32 ./configure --disable-shared --enable-static --disable-doc && make
mkdir include && cp lib/*.h include/ && cp lib/.libs/libidn2.a lib
cd "$BUILD_DIR" || exit
# LibCurl
echo "Building libcurl"
if [[ ! -f "curl-7.62.0.zip" ]]; then
wget https://curl.haxx.se/download/curl-7.62.0.zip && unzip -q curl-7.62.0.zip
fi
cd curl-7.62.0
./configure --with-ssl="$BUILD_DIR/openssl-1.1.1a" --with-zlib="$BUILD_DIR/zlib-1.2.11" \
--with-libidn2="$BUILD_DIR/libidn2-2.0.5" --disable-shared --enable-static --disable-rtsp \
--disable-ldap --disable-ldaps --disable-manual --disable-libcurl-option --without-librtmp \
--without-libssh2 --without-nghttp2 --without-gssapi --host=i386-pc-linux-gnu CFLAGS=-m32 && make all ca-bundle
cd "$BUILD_DIR" || exit
# SourceMod
echo "Getting sourcemod"
if [[ ! -d "sourcemod-${SMBRANCH}" ]]; then
git clone https://github.com/alliedmodders/sourcemod --recursive --branch "$SMBRANCH" --single-branch "sourcemod-${SMBRANCH}"
fi
echo "Building messagebot"
cd "$MESSAGEBOT_DIR" || exit
make SMSDK="$BUILD_DIR/sourcemod-${SMBRANCH}" OPENSSL="$BUILD_DIR/openssl-1.1.1a" ZLIB="$BUILD_DIR/zlib-1.2.11" IDN="$BUILD_DIR/libidn2-2.0.5" CURL="$BUILD_DIR/curl-7.62.0"