Skip to content

Commit ea0f8cc

Browse files
committed
Always use a shell script to build aria2
Finally take care of those unwieldily duplicated argument lists for aria2 configure by using a single shell script. I just got bit by Nettle not being disabled in one of the cases. Also I noticed that --without-libz was sometimes misspelled as --without-zlib. test
1 parent 2fbc2d1 commit ea0f8cc

File tree

7 files changed

+50
-22
lines changed

7 files changed

+50
-22
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ aria2/src/.libs
55
# Just add stuff that is particularly large or changes often (thus breaking the cache).
66
build*
77
Dockerfile*
8+
!build-aria.sh
9+

.github/workflows/codeql.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ jobs:
7777
export MAKEFLAGS="-j$(($(nproc) + 1))"
7878
git submodule update --init
7979
cd aria2
80-
autoreconf -i
81-
./configure --without-libxml2 --without-libexpat --without-sqlite3 --enable-libaria2 --without-zlib --without-libcares --enable-static=no ARIA2_STATIC=no --without-libssh2 --disable-metalink --disable-websocket --disable-nls --with-openssl
82-
make
80+
../build-aria.sh --enable-shared --disable-static
8381
cd ..
8482
qmake -config release
8583
make

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ RUN curl -LO https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-
5858
###############
5959
COPY aria2 /updater/aria2
6060
COPY .git/modules/aria2 /updater/.git/modules/aria2
61+
COPY build-aria.sh /updater/
6162
WORKDIR /updater/aria2
62-
RUN git clean -dXff
63-
RUN autoreconf -i && OPENSSL_LIBS='-L/openssl/lib64 -lssl -lcrypto -lpthread -ldl' OPENSSL_CFLAGS='-I /openssl/include' ./configure --without-libxml2 --without-libexpat --without-sqlite3 --enable-libaria2 --without-zlib --without-libcares --enable-static --disable-shared --without-libssh2 --disable-metalink --disable-websocket --disable-nls --with-openssl && make -j`nproc`
63+
RUN OPENSSL_LIBS='-L/openssl/lib64 -lssl -lcrypto -lpthread -ldl' OPENSSL_CFLAGS='-I /openssl/include' ../build-aria.sh --with-openssl
6464

6565
#################
6666
# Build updater #

Dockerfile.win

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ RUN curl -LO https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-
4848
###############
4949
COPY aria2 /updater/aria2
5050
COPY .git/modules/aria2 /updater/.git/modules/aria2
51+
COPY build-aria.sh /updater/
5152
WORKDIR /updater/aria2
5253
RUN git clean -dXff
53-
RUN autoreconf -i && ./configure --without-libxml2 --without-libexpat --without-sqlite3 --enable-libaria2 --without-libz --without-libcares --enable-static --disable-shared ARIA2_STATIC=yes --without-libssh2 --disable-metalink --disable-websocket --disable-nls --host i686-w64-mingw32 && make -j`nproc`
54+
RUN ../build-aria.sh ARIA2_STATIC=yes --host i686-w64-mingw32
5455

5556
#################
5657
# Build updater #

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ Note: Fluid has submodules of its own, but they are not used, so the above comma
1414
Before building the updater itself you need to build aria2 library
1515
```
1616
cd aria2
17-
autoreconf -i
18-
./configure --without-libxml2 --without-libexpat --without-sqlite3 --enable-libaria2 --without-zlib --without-libcares --enable-static --disable-shared --without-libssh2 --disable-metalink --disable-websocket --disable-nls --with-openssl
19-
make -j4
17+
../build-aria.sh
2018
cd ..
2119
```
2220

@@ -74,9 +72,11 @@ eval sudo make module-{$MODULES}-install_subtargets
7472
### Build aria2
7573
```
7674
brew install autoconf automake libtool pkg-config gettext
77-
# If building on M1, target x86 by running in Rosetta: arch -x86_64 ./mac-build-aria.sh
75+
cd aria2
76+
# If building on M1, target x86 by running in Rosetta: arch -x86_64 ../build-aria.sh
7877
# (the --target option to configure doesn't seem to have any effect)
79-
./mac-build-aria.sh
78+
../build-aria.sh
79+
cd ..
8080
```
8181

8282
### Build updater

build-aria.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
# Any command line arguments will be passed to aria2 configure.
4+
5+
set -e
6+
7+
if [ ! -f src/aria2api.cc ]; then
8+
echo 'Error: must build from root of aria2 tree'
9+
exit 1
10+
fi
11+
12+
case "$(uname)" in
13+
Darwin*)
14+
export MACOSX_DEPLOYMENT_TARGET=10.13 # To match Qt's target
15+
export AUTOPOINT=$(brew --prefix gettext)/bin/autopoint
16+
;;
17+
esac
18+
19+
num_processors=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)
20+
21+
set -x # echo commands
22+
23+
git clean -dXff
24+
autoreconf -i
25+
26+
# For crypto/TLS we use OpenSSL on Linux and the OS-provided one on others.
27+
./configure \
28+
--enable-static --disable-shared \
29+
--enable-libaria2 \
30+
--disable-metalink --disable-websocket --disable-nls \
31+
--without-libnettle --without-libgmp --without-libgcrypt --without-gnutls \
32+
--without-sqlite3 --without-libxml2 --without-libexpat --without-libcares --without-libz --without-libssh2 \
33+
"$@"
34+
35+
# Build only src/ to skip the gettext infrastructure targets which, at some point on Mac, complained about
36+
# gettext being newer than the version required in configure.ac
37+
cd src
38+
MAKEFLAGS="-j${num_processors} ${MAKEFLAGS}" make

mac-build-aria.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)