Skip to content

Commit

Permalink
Support FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Apr 30, 2024
1 parent 101c73b commit f344d4f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ win_ungztar() {
set_os_specific_vars() {
local os=$(uname)
case "$os" in
Darwin|Linux)
Darwin|Linux|FreeBSD)
OS_HAS_TOOLS=tar
OS_UNGZTAR_CMD="run_verbose_errexit tar xmzvf"
OS_LOCAL_DIR=.local
Expand All @@ -160,8 +160,8 @@ set_os_specific_vars() {
show_machine_info() {
local os=$(uname)
case "$os" in
Linux)
echo "OS: Linux"
Linux|FreeBSD)
echo "OS: $os"
lscpu | grep "^Archi\|^CPU\|^Bogo\|^Hyper\|^Virtualiz"

echo "Memory:"
Expand Down Expand Up @@ -670,7 +670,7 @@ fetch_stack() {
local os=$(uname)
case "$os" in
Darwin) retry_cmd fetch_stack_osx $1 ;;
Linux) retry_cmd fetch_stack_linux $1 ;;
Linux|FreeBSD) retry_cmd fetch_stack_linux $1 ;;
MINGW*) retry_cmd fetch_stack_windows $1 ;;
*) die "Unknown OS [$os]" ;;
esac
Expand Down Expand Up @@ -910,6 +910,7 @@ ghcup_install() {
os=$(uname -s -m)
case "$os" in
"Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
"FreeBSD x86_64" | "FreeBSD amd64") GHCUP_ARCH=x86_64-portbld-freebsd ;;
"Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
"Darwin arm64") GHCUP_ARCH="aarch64-apple-darwin" ;;
*) echo "Unknown OS/Arch: $os"; exit 1;;
Expand Down Expand Up @@ -1670,7 +1671,7 @@ install_hlint() {
OS=osx;;
MINGW*|MSYS*)
OS=windows;;
Linux)
Linux|FreeBSD)
OS=linux;;
*) die "install_hlint: unknown os";;
esac
Expand Down Expand Up @@ -1798,7 +1799,7 @@ your .hlint.ignore file."
install_docspec() {
show_step "Installing docspec from $DOCSPEC_URL"
case "$(uname)" in
Linux)
Linux|FreeBSD)
OS=linux;;
*) die "install_docspec: unknown or unsupported os";;
esac
Expand Down Expand Up @@ -1964,7 +1965,7 @@ get_sys_time() {
# Do not use floating point values so that we can avoid using bc for
# computations.
#Linux | MINGW*) date +%s.%N ;;
Linux | MINGW*) date +%s ;;
Linux | FreeBSD | MINGW*) date +%s ;;
Darwin) date +%s ;;
*) die "Unknown OS [$os]" ;;
esac
Expand Down

0 comments on commit f344d4f

Please sign in to comment.