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 0c8174f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 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 @@ -161,7 +161,7 @@ show_machine_info() {
local os=$(uname)
case "$os" in
Linux)
echo "OS: Linux"
echo "OS: $os"
lscpu | grep "^Archi\|^CPU\|^Bogo\|^Hyper\|^Virtualiz"

echo "Memory:"
Expand All @@ -179,6 +179,8 @@ show_machine_info() {
run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_period_us || true
run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us || true
run_verbose cat /sys/fs/cgroup/memory/memory.limit_in_bytes || true ;;
FreeBSD)
echo "OS: FreeBSD" ;;
Darwin)
echo "OS: MacOS" ;;
MINGW*)
Expand Down Expand Up @@ -910,6 +912,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 @@ -1964,7 +1967,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 0c8174f

Please sign in to comment.