-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#! /bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
if [[ "${1:-}" == "" ]]; then | ||
echo "Usage: $0 <version>" | ||
exit 2 | ||
fi | ||
|
||
version="$1" | ||
|
||
build_dir="$(mktemp -d -t zsyncmake-build-XXXXXX)" | ||
|
||
cleanup () { | ||
if [ -d "$build_dir" ]; then | ||
rm -rf "$build_dir" | ||
fi | ||
} | ||
trap cleanup EXIT | ||
|
||
pushd "$build_dir" | ||
|
||
wget http://zsync.moria.org.uk/download/zsync-"$version".tar.bz2 -q | ||
tar xf zsync-*.tar.bz2 | ||
|
||
cd zsync-*/ | ||
|
||
find . -type f -exec sed -i -e 's|off_t|size_t|g' {} \; | ||
|
||
./configure CFLAGS=-no-pie LDFLAGS=-static --prefix=/usr --build=$(arch)-unknown-linux-gnu | ||
|
||
if [[ "${GITHUB_ACTIONS:-}" != "" ]]; then | ||
jobs="$(nproc)" | ||
else | ||
jobs="$(nproc --ignore=1)" | ||
fi | ||
|
||
make -j"$jobs" install |