-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild-mingw-deps
More file actions
executable file
·65 lines (54 loc) · 1.41 KB
/
Copy pathbuild-mingw-deps
File metadata and controls
executable file
·65 lines (54 loc) · 1.41 KB
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
#!/bin/bash
die()
{
echo "$@" >&2
exit 1
}
trap_func()
{
trap - ERR # don't run the trap again
die "Error in line $1 (return code $2)"
}
check_prerequisites()
{
for program in make wget tar autoconf automake x86_64-w64-mingw32-{gcc,ar}
do
command -v "$program" >/dev/null || die "Error: Must have \"$program\" installed"
done
}
main()
{
set -eE
trap 'trap_func $LINENO $?' ERR
check_prerequisites
local tmp_dir
if [ "$1" ]
then
[ -d "$1" ] || die "Error: Directory \"$1\" does not exit"
tmp_dir=$1
else
tmp_dir=$(mktemp -d "/tmp/build-mingw-deps.XXXXXXXXXX")
fi
local urls=(
https://github.com/radarsat1/liblo/archive/refs/tags/0.34.tar.gz # GPL-2.1-only
)
local archives=(liblo-0.34)
# shellcheck disable=SC2043 # loop intended to run once (can be extended for future deps)
for i in 0
do
local tarball=$tmp_dir/${archives[$i]}.tar.gz
[ -f "$tarball" ] || wget "${urls[$i]}" -O "$tarball"
tar -C "$tmp_dir/" -xf "$tarball"
# rm "$tarball"
done
[ -d "$tmp_dir/prefix" ] || mkdir "$tmp_dir/prefix"
(cd "$tmp_dir/liblo-0.34"
./autogen.sh --host=x86_64-w64-mingw32 \
--prefix="$tmp_dir/prefix" \
--disable-shared \
--enable-static \
--disable-doc
make
make install)
}
main "$@"