Skip to content

Commit

Permalink
build: allow to build on FreeBSD (#22285)
Browse files Browse the repository at this point in the history
* fix(build): checksum failed on FreeBSD

* fix(build): avoid BSD make evaluate Makefile

This Makefile use GNU make functions which is not compatible with the BSD
make. In order to avoid BSD make to try evaluation the Makefile and because
the Makefile use GNU make functions renaming the from Makefile to GNUmakefile
does not change anything for GNU make users and expose a clear error
when someone try to evaluate with BSD make.

* fix(build): invalid shebang on FreeBSD
  • Loading branch information
gearnode committed Nov 24, 2021
1 parent edb21ab commit 5a1e375
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
File renamed without changes.
13 changes: 11 additions & 2 deletions scripts/fetch-ui-assets.sh
Expand Up @@ -27,8 +27,17 @@ curl -Ls https://github.com/influxdata/ui/releases/download/OSS-Master/sha256.tx
curl -L https://github.com/influxdata/ui/releases/download/OSS-Master/build.tar.gz --output build.tar.gz

# Verify the checksums match; exit if they don't.
echo "$(cat sha256.txt)" | sha256sum --check -- \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; }
case "$(uname -s)" in
FreeBSD | Darwin)
echo "$(cat sha256.txt)" | shasum --algorithm 256 --check \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; } ;;
Linux)
echo "$(cat sha256.txt)" | sha256sum --check -- \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; } ;;
*)
echo "The '$(uname -s)' operating system is not supported" >&2
exit 1
esac

# Extract the assets and clean up.
mkdir -p "$STATIC_DIR/data"
Expand Down
2 changes: 1 addition & 1 deletion scripts/pkg-config.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

tmpdir=$(mktemp -d)
trap "{ rm -rf ${tmpdir}; }" EXIT
Expand Down

0 comments on commit 5a1e375

Please sign in to comment.