diff --git a/masher/Dockerfile b/masher/Dockerfile index a574cae..18f8e9c 100644 --- a/masher/Dockerfile +++ b/masher/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # However, I don’t think it makes sense to use older version, better to be able to advance as it releases outselves. RUN mkdir -p /usr/bin && \ cd /usr && \ - curl -sS -L https://github.com/google/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip | \ + curl -sS -L https://github.com/google/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip | \ bsdtar -xvf- --exclude=readme.txt && \ chmod 755 /usr/bin/protoc diff --git a/masher/mash.sh b/masher/mash.sh index f9622ec..5085908 100755 --- a/masher/mash.sh +++ b/masher/mash.sh @@ -27,6 +27,9 @@ while [[ "$#" -gt 0 ]]; do --darwin) DARWIN="true" ;; + --openbsd) + OPENBSD="true" + ;; --windows) WINDOWS="true" ;; @@ -84,7 +87,7 @@ if [[ $ESCAPE == "true" ]]; then exit 1 fi -case "${LINUX}${DARWIN}${WINDOWS}" in +case "${LINUX}${DARWIN}${OPENBSD}${WINDOWS}" in "") [[ $DEB == "" ]] && LINUX="true" ;; @@ -92,7 +95,7 @@ case "${LINUX}${DARWIN}${WINDOWS}" in TESTING="true" esac -[[ "${LINUX}${DARWIN}${WINDOWS}" == "" ]] && NOCOMPILE="true" +[[ "${LINUX}${DARWIN}${OPENBSD}${WINDOWS}" == "" ]] && NOCOMPILE="true" if which go > /dev/null 2>&1 ; then GO_VERSION="$(go version)" @@ -222,6 +225,13 @@ if [[ $DARWIN == "true" ]]; then GOOS=darwin GOARCH=amd64 go build -o "${OUT}/${PROJECT}" "${LDFLAGS}" || exit 1 fi +if [[ $OPENBSD == "true" ]]; then + OUT="bin/openbsd.x86_64" + echo Compiling ${OUT}/${PROJECT} + [ -d "$OUT" ] || mkdir -p $OUT || exit 1 + GOOS=openbsd GOARCH=amd64 go build -o "${OUT}/${PROJECT}" "${LDFLAGS}" || exit 1 +fi + if [[ $WINDOWS == "true" ]]; then OUT="bin/windows.x86_64" echo Compiling ${OUT}/${PROJECT}.exe diff --git a/masher/masher b/masher/masher index 0f7aa71..2c814a3 100755 --- a/masher/masher +++ b/masher/masher @@ -28,20 +28,25 @@ if [[ -n ${DOCKER_MACHINE_NAME} ]]; then RUNAS=1000 fi -LINUX="" DARWIN="" +LINUX="" +OPENBSD="" WINDOWS="" if [[ -n "${MASHALL}" ]]; then DARWIN="--darwin" LINUX="--linux" WINDOWS="--windows" + OPENBSD="--openbsd" else case ${OSTYPE} in + darwin*) + DARWIN="--darwin" + ;; linux*) LINUX="--linux" ;; - darwin*) - DARWIN="--darwin" + openbsd*) + OPENBSD="--openbsd" ;; cygwin*|msys*) WINDOWS="--windows" @@ -49,6 +54,7 @@ else *) #I don't know, just make them all DARWIN="--darwin" LINUX="--linux" + OPENSBD="--openbsd" WINDOWS="--windows" ;; esac @@ -66,24 +72,29 @@ while [[ $# -gt 0 ]]; do REGISTRY="$val" ;; + --darwin) + DARWINFLAG="--darwin" + ;; --linux) LINUXFLAG="--linux" ;; - --darwin) - DARWINFLAG="--darwin" + --openbsd) + OPENBSDFLAG="--openbsd" ;; --windows) WINDOWSFLAG="--windows" ;; --all) - LINUXFLAG="--linux" DARWINFLAG="--darwin" + LINUXFLAG="--linux" + OPENBSDFLAG="--openbsd" WINDOWSFLAG="--windows" ;; --pkgonly) - LINUXFLAG="--deb" DARWINFLAG="" + LINUXFLAG="--deb" + OPENBSDFLAG="" WINDOWSFLAG="" ;; @@ -93,6 +104,7 @@ while [[ $# -gt 0 ]]; do --proto) DARWIN="" LINUX="" + OPENBSD="" WINDOWS="" NODOCKER="true" PROTO="--proto" @@ -144,8 +156,9 @@ while [[ $# -gt 0 ]]; do done if [[ -n ${PROD} ]]; then - LINUXFLAG="--linux" DARWINFLAG="--darwin" + LINUXFLAG="--linux" + OPENBSDFLAG="--openbsd" WINDOWSFLAG="--windows" PROTO="--allprotos" TEST="--notest" @@ -182,9 +195,10 @@ if [[ -z $IMAGE ]]; then IMAGE="${IMAGE}:latest" fi -if [[ (-n "$LINUXFLAG") || (-n "$DARWINFLAG") || (-n "$WINDOWSFLAG") ]]; then +if [[ (-n "$DARWINFLAG") || (-n "$LINUXFLAG") || (-n "$OPENBSDFLAG") || (-n "$WINDOWSFLAG") ]]; then LINUX="$LINUXFLAG" DARWIN="$DARWINFLAG" + OPENBSD="$OPENBSDFLAG" WINDOWS="$WINDOWSFLAG" fi @@ -194,6 +208,7 @@ if [[ (-n "$PROD") && ( $BRANCH = "testing" ) ]]; then # if that works, then it will move up the branches, which will # then compile the additional binaries. DARWIN="" + OPENBSD="" WINDOWS="" fi @@ -237,6 +252,7 @@ if [[ -z ${ESCAPE} ]]; then NAME="${NAME}-" [[ ${DARWIN} != "" ]] && NAME="${NAME}d" [[ ${LINUX} != "" ]] && NAME="${NAME}l" + [[ ${OPENBSD} != "" ]] && NAME="${NAME}o" [[ ${WINDOWS} != "" ]] && NAME="${NAME}w" NAME=${NAME%-} fi @@ -259,7 +275,7 @@ fi TIMESTAMP=$(date -u +"%Y%m%d.%H%M%S") echo Using image: $IMAGE -echo /bin/mash.sh $ESCAPE $DARWIN $LINUX $WINDOWS $TEST $PROTO $BUILD $CACHE $PRIVATE $BUILD_VERSION --timestamp=$TIMESTAMP --id=$HASHID $@ +echo /bin/mash.sh $ESCAPE $DARWIN $LINUX $OPENBSD $WINDOWS $TEST $PROTO $BUILD $CACHE $PRIVATE $BUILD_VERSION --timestamp=$TIMESTAMP --id=$HASHID $@ DOCKER_VERSION="$(docker --version)" DOCKER_VERSION=${DOCKER_VERSION%%,*} @@ -359,7 +375,7 @@ ${EXEC} docker run ${FLAGS} --rm \ $LIBS \ --workdir "${SRCROOT}/${PRJPATH}" \ ${IMAGE} \ - /bin/mash.sh $ESCAPE $DARWIN $LINUX $WINDOWS $TEST $PROTO $BUILD $CACHE $PRIVATE $BUILD_VERSION --timestamp=$TIMESTAMP --id=$HASHID "$@" || exit 1 + /bin/mash.sh $ESCAPE $DARWIN $LINUX $OPENBSD $WINDOWS $TEST $PROTO $BUILD $CACHE $PRIVATE $BUILD_VERSION --timestamp=$TIMESTAMP --id=$HASHID "$@" || exit 1 if [[ $PROD == "true" ]]; then make push || exit 1