builder: make zip + sig on win + minor changes

Pass command-line arguments to `build_project()` for use in the cmake
command.

Make `$PROJECT_ARGS` override `$CMAKE_BASE_ARGS` for the project.

Override `command()` to call `/bin/command` to avoid the bash builtin
which has undesirable behavior when overriding commands.

Override `gpg` to invoke either the `gpg` or the `gpg2` binary,
whichever is available, or print a warning that gpg is not available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2019-07-11 20:18:21 -04:00
parent 296255d492
commit 5802207829
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 24 additions and 3 deletions

View File

@ -457,7 +457,7 @@ builder() {
unpack_needed_dists $DOWNLOADED_DISTS
build_needed_dists $UNPACKED_DISTS
build_project
build_project "$@"
}
read_command_line() {
@ -2624,7 +2624,7 @@ build_project() {
cd "$BUILD_ROOT/project"
# FIXME: turn LTO back on when everything works
echo_eval_run cmake "'$CHECKOUT'" $REQUIRED_CMAKE_ARGS -DVBAM_STATIC=ON -DENABLE_LTO=OFF $PROJECT_ARGS $CMAKE_BASE_ARGS $@
echo_eval_run cmake "'$CHECKOUT'" $REQUIRED_CMAKE_ARGS -DVBAM_STATIC=ON -DENABLE_LTO=OFF $CMAKE_BASE_ARGS $PROJECT_ARGS $@
echo_run make -j$NUM_CPUS VERBOSE=1
if [ "$target_os" = mac ]; then
@ -2642,6 +2642,13 @@ build_project() {
$STRIP visualboyadvance-m
elif [ "$target_os" = windows ] && path_exists visualboyadvance-m.exe; then
$STRIP visualboyadvance-m.exe
zip=./visualboyadvance-m-Win-${target_bits:-$bits}bit.zip
rm -f $zip
zip -9 $zip ./visualboyadvance-m.exe
gpg --detach-sign -a $zip
fi
dist_post_build project
@ -2878,7 +2885,7 @@ ln() {
}
cygpath() {
if sh -c 'command -v cygpath' >/dev/null; then
if command -v cygpath >/dev/null; then
command cygpath "$@"
else
case "$1" in
@ -2891,6 +2898,20 @@ cygpath() {
fi
}
gpg() {
if command -v gpg >/dev/null; then
command gpg "$@"
elif command -v gpg2 >/dev/null; then
command gpg2 "$@"
else
warn 'GPG not available'
fi
}
command() {
/bin/command "$@"
}
fully_resolve_link() {
file=$1
# get initial part for non-absolute path, or blank for absolute