Skip to content

Commit

Permalink
setup-util-gawk: disable bottle and building on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Sep 16, 2024
1 parent c723ea2 commit e68e2e0
Showing 1 changed file with 22 additions and 51 deletions.
73 changes: 22 additions & 51 deletions commands/setup-util-gawk
Original file line number Diff line number Diff line change
Expand Up @@ -39,59 +39,30 @@ function setup_util_gawk() (
SCOOP='gawk' # WINDOWS
ZYPPER='gawk' # SUSE
)
function do_install {
# dependencies
setup-util-devel --quiet
source "$DOROTHY/sources/environment.sh"
# build from source
if ! is-mac; then
# bottles don't work as they require glib:
# https://github.com/bevry/dorothy/actions/runs/10879420970/job/30184086622#step:3:5587
# https://github.com/bevry/dorothy/actions/runs/10879420970/job/30184087583#step:3:4878
# setup-util-devel requires brew, so just skip compile on macos and fallback to brew
function do_install {
# dependencies
setup-util-devel --quiet
source "$DOROTHY/sources/environment.sh"

# build
./configure
make install
}
function do_uninstall {
# dependencies
setup-util-devel --quiet
source "$DOROTHY/sources/environment.sh"
# build
./configure
make install
}
function do_uninstall {
# dependencies
setup-util-devel --quiet
source "$DOROTHY/sources/environment.sh"

# build
./configure
make uninstall
}
local arch macos_release bottle_url=''
arch="$(get-arch)"
if is-mac; then
# fetch the bottle urls via: brew info --json gawk | jq -r ".[].bottle.stable.files"
macos_release="$(get-macos-release-name)"
if test "$arch" = 'a64'; then
if test "$macos_release" = 'sonoma'; then
bottle_url='https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:73d743d915e4c9841f9bdc289710ef4ea071ccf1f026542f1fcc8ba4a870e8f5'
elif test "$macos_release" = 'ventura'; then
bottle_url='https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:36265210141086740f625d2e672b6275a2247de4de1f1df9747ed51b409a5e24'
elif test "$macos_release" = 'monterey'; then
bottle_url='https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:24956ab7119678bf5168a66ace1b5e735cede929084ff756da14ab74a1c8f63a'
fi
elif test "$arch" = 'x64'; then
if test "$macos_release" = 'sonoma'; then
bottle_url='"https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:786aa0d52925e6816ece520d4ca45778862775249186e9bea85022dc96653c38'
elif test "$macos_release" = 'ventura'; then
bottle_url='https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:30185c073065bff4138f1512603315c789babcb83a3253a8155b670e4baa32c1'
elif test "$macos_release" = 'monterey'; then
bottle_url='https://ghcr.io/v2/homebrew/core/gawk/blobs/sha256:ee33b62eba04ca68cc6346b7fa51466696b9380f67e2a2bedaa367a1a154c9a4'
fi
fi
# add the bottle url as an option
if test -n "$bottle_url" && fetch --bearer-token='QQ==' --ok "$bottle_url"; then
options+=(
DOWNLOAD="$bottle_url"
DOWNLOAD_FILENAME='gawk'
DOWNLOAD_BEARER_TOKEN='QQ=='
DOWNLOAD_ARCHIVE_FORMAT='tar'
DOWNLOAD_ARCHIVE_GLOB='gawk/*/bin/gawk'
)
fi
fi
# DOWNLOAD source url if no bottle url
if test -z "$bottle_url"; then
# build
./configure
make uninstall
}
options+=(
# https://ftp.gnu.org/gnu/gawk/?C=M;O=D
DOWNLOAD="https://ftp.gnu.org/gnu/gawk/gawk-5.3.0.tar.xz"
Expand Down

0 comments on commit e68e2e0

Please sign in to comment.