forked from pyinstaller/pyinstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-waf.sh
69 lines (53 loc) · 1.78 KB
/
update-waf.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
# -----------------------------------------------------------------------------
# Copyright (c) 2014-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
# -----------------------------------------------------------------------------
#
# Helper-script for updating waf
VERSION=2.0.20
ARCHNAME=waf-$VERSION.tar.bz2
URL=https://waf.io/$ARCHNAME
# Extensions to include
TOOLS=--tools=cfg_cross_gnu
# Core tools to add: use only those we actually use
# Currently unused optimization
#c_compilers=clang,gcc,icc,msvc,suncc,xlc,ar
#c_tools=compiler_c,ccroot,c_config,c_aliases,c_preproc,c_config,c_osx,c_tests
#CORETOOLS=--coretools=$c_tools,$c_compilers
KEYID=49B4C67C05277AAA
KEYURL=https://gitlab.com/ita1024/waf/raw/master/utils/pubkey.asc
# remember where we come from
BASEDIR=$(realpath $(dirname "$0"))
function cleanup () {
cd "$BASEDIR"
echo >&2 "Removing temporary directory '$WORKDIR'"
rm -rf "$WORKDIR"
}
WORKDIR=$(mktemp -d)
trap cleanup SIGINT SIGTERM SIGKILL EXIT
cd $WORKDIR
# If Thomas Nagy's key is not already present, add it
gpg --list-keys 2>/dev/null | grep -cq $KEYID
if [ $? -ne 0 ] ; then
echo "Adding Thomas Nagy's PGP key"
wget --no-verbose $KEYURL
gpg --import pubkey.asc
fi
echo "Downloading waf archive"
wget --no-verbose $URL
wget --no-verbose $URL.asc
echo
echo "Verifying archive signature"
gpg --verify $ARCHNAME.asc $ARCHNAME || exit 1
echo "Unpacking archive"
tar xjf $ARCHNAME
cd waf-$VERSION
echo "Building new waf file"
./waf-light $CORETOOLS $TOOLS
cp -v ./waf "$BASEDIR"