"Fossies" - the Fresh Open Source Software Archive

Member "gdrive-2.1.1/_release/build-all.sh" (28 May 2021, 1062 Bytes) of package /linux/misc/gdrive-2.1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.


    1 #!/bin/bash
    2 
    3 APP_NAME="gdrive"
    4 PLATFORMS="darwin/386 darwin/amd64 darwin/arm darwin/arm64 dragonfly/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/ppc64 linux/ppc64le linux/mips64 linux/mips64le linux/rpi netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 openbsd/arm plan9/386 plan9/amd64 solaris/amd64 windows/386 windows/amd64"
    5 
    6 BIN_PATH="_release/bin"
    7 
    8 # Initialize bin dir
    9 mkdir -p $BIN_PATH
   10 rm $BIN_PATH/* 2> /dev/null
   11 
   12 # Build binary for each platform
   13 for PLATFORM in $PLATFORMS; do
   14     GOOS=${PLATFORM%/*}
   15     GOARCH=${PLATFORM#*/}
   16     BIN_NAME="${APP_NAME}-${GOOS/darwin/osx}-${GOARCH/amd64/x64}"
   17 
   18     if [ $GOOS == "windows" ]; then
   19         BIN_NAME="${BIN_NAME}.exe"
   20     fi
   21 
   22     # Raspberrypi seems to need arm5 binaries
   23     if [ $GOARCH == "rpi" ]; then
   24         export GOARM=5
   25         GOARCH="arm"
   26     else
   27         unset GOARM
   28     fi
   29 
   30     export GOOS=$GOOS
   31     export GOARCH=$GOARCH
   32 
   33     echo "Building $BIN_NAME"
   34     go build -ldflags '-w -s' -o ${BIN_PATH}/${BIN_NAME}
   35 done
   36 
   37 echo "All done"