Skip to content

Commit

Permalink
Merge pull request #2776 from jimklimov/fix-appveyor
Browse files Browse the repository at this point in the history
Fix Appveyor CI builds
  • Loading branch information
jimklimov authored Jan 20, 2025
2 parents 8f95466 + 6212bc0 commit a2077e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ install:
- cmd: |
REM Do not give pacman cause for complaints:
C:\msys64\usr\bin\bash -lc "mkdir -p /var/cache/pacman/pkg; ls -la /"
REM FIXME: Since Jan 2025, normal update below fails with the message:
REM installing mingw-w64-i686-gdb (16.1-1) breaks dependency
REM 'mingw-w64-i686-gdb=15.2' required by mingw-w64-i686-gdb-multiarch
REM Currently we sweep it away by removing the conflicting package:
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -R mingw-w64-i686-gdb-multiarch || true"
- cmd: |
REM Core update (in case any core packages are outdated):
C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -Syuu"
Expand Down
21 changes: 16 additions & 5 deletions scripts/Windows/build-mingw-prereqs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Copyright (C) 2022-2023 by Jim Klimov <[email protected]>
# Licensed same as NUT
# Copyright (C) 2022-2025 by Jim Klimov <[email protected]>
# Licensed GPLv2+, same as NUT
#
# Helper automating the nuances from NUT::scripts/Windows/README.adoc
# to provide prerequisites needed in semi-native or cross-builds.
Expand All @@ -12,9 +12,18 @@
# TODO: Support `make uninstall` attempts for older versions?..

prepareEnv() {
[ -n "${MAKE-}" ] || MAKE="make -j 8"
[ -n "${MAKE-}" ] || {
(command -v gmake) 2>/dev/null >/dev/null \
&& MAKE="gmake" \
|| MAKE="make"
}
export MAKE

[ -n "${MAKEFLAGS-}" ] || {
MAKEFLAGS="-j 8"
export MAKEFLAGS
}

if [ -z "${SUDO-}" ] ; then
SUDO=" " # avoid reeval
if (command -v sudo) ; then SUDO="sudo" ; fi
Expand Down Expand Up @@ -47,7 +56,7 @@ prepareEnv() {

# Assumes Ubuntu/Debian with mingw prepared, per README
HOST_FLAG="--host=$ARCH"
PREFIX="/usr/$ARCH"
PREFIX="/usr/$ARCH"

export ARCH PREFIX

Expand Down Expand Up @@ -86,14 +95,16 @@ provide_netsnmp() (
# Quickly install if prebuilt
if [ -d "${WSDIR}/${DEP_DIRNAME}/.inst" ]; then (
cd "${WSDIR}/${DEP_DIRNAME}/.inst" || exit
(command -v rsync) && $SUDO rsync -avPHK ./ / && exit
(command -v rsync) && $SUDO rsync -cavPHK ./ / && exit
$SUDO cp -pr ./ / && exit
exit 1
) && return 0
fi

# no stashed .inst; any Makefile at least?
if [ -s "${WSDIR}/${DEP_DIRNAME}/Makefile" ]; then ( cd "${WSDIR}/${DEP_DIRNAME}" && $SUDO $MAKE install ) && return ; fi

# Not pre-built, fall through
fi

# (Re-)make and install from scratch
Expand Down

0 comments on commit a2077e8

Please sign in to comment.