Skip to content

Commit

Permalink
detect musl version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Sep 1, 2023
1 parent b879321 commit e6e73ba
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,13 @@ build_single_target() {
mac)
mingwver="$(HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_FROM_API=1 brew info --json=v2 --formula mingw-w64 | jq --raw-output '.formulae[] | select(.name == "mingw-w64") | .versions.stable')";;
linux)
[ -n "${mingwver}" ] || mingwver="$(dpkg --status mingw-w64-common || true)"
[ -n "${mingwver}" ] || mingwver="$(rpm --query mingw64-crt || true)"
[ -n "${mingwver}" ] || mingwver="$(pacman --query --info mingw-w64-crt || true)"
[ -n "${mingwver}" ] || mingwver="$(apk info --webpage mingw-w64-crt || true)"
[ -n "${mingwver}" ] && mingwver="$(printf '%s' "${mingwver}" | grep -a -E '(^Version|webpage:)' | grep -a -m 1 -o -E '[0-9.-]+')"
[ -n "${mingwver}" ] || mingwver="$(dpkg-query --showformat='${Version}' --show 'mingw-w64-common' || true)"
if [ -z "${mingwver}" ]; then
[ -n "${mingwver}" ] || mingwver="$(rpm --query mingw64-crt || true)"
[ -n "${mingwver}" ] || mingwver="$(pacman --query --info mingw-w64-crt || true)"
[ -n "${mingwver}" ] || mingwver="$(apk info --webpage mingw-w64-crt || true)"
[ -n "${mingwver}" ] && mingwver="$(printf '%s' "${mingwver}" | grep -a -E '(^Version|webpage:)' | grep -a -m 1 -o -E '[0-9][0-9.]*')"
fi
;;
esac
[ -n "${mingwver}" ] && mingwver="mingw-w64 ${mingwver}"
Expand All @@ -1008,8 +1010,12 @@ build_single_target() {

if [ "${_CRT}" = 'musl' ]; then
[ -n "${libcver}" ] || libcver="$(dpkg-query --showformat='${Version}' --show 'musl' || true)"
[ -n "${libcver}" ] || libcver="$(apk info --webpage musl || true)"
[ -n "${libcver}" ] && libcver="$(printf '%s' "${libcver}" | grep -a -E '(^Version|webpage:)' | grep -a -m 1 -o -E '[0-9.-]+')"
if [ -z "${libcver}" ]; then
[ -n "${libcver}" ] || libcver="$(rpm --query musl-devel || true)"
[ -n "${libcver}" ] || libcver="$(pacman --query --info musl || true)"
[ -n "${libcver}" ] || libcver="$(apk info --webpage musl || true)"
[ -n "${libcver}" ] && libcver="$(printf '%s' "${libcver}" | grep -a -E '(^Version|webpage:)' | grep -a -m 1 -o -E '[0-9][0-9.]*')"
fi
[ -n "${libcver}" ] && libcver="musl ${libcver}"
else
# FIXME: Debian-specific
Expand Down

0 comments on commit e6e73ba

Please sign in to comment.