Improved/fixed macOS support (#4153)

* Fix macOS notifications
* Change CFBundleIdentifier to match domain
* Distribute Stash.app
* Also build universal phasher binary
* Fix binary name in check_version.go
* Expose GOOS, working dir and home dir in systemStatus endpoint
* Disable setup in working directory when running Stash.app
* More Makefile improvements, remove unused scripts
* Improve READMEs and documentation
This commit is contained in:
DingDongSoLong4
2023-11-19 01:36:13 +02:00
committed by GitHub
parent 72779e618d
commit 4dd4c3c658
21 changed files with 345 additions and 381 deletions

View File

@@ -1,55 +0,0 @@
#!/bin/bash
COMPILER_CONTAINER="stashapp/compiler:7"
BUILD_DATE=`go run scripts/getDate.go`
GITHASH=`git rev-parse --short HEAD`
STASH_VERSION=`git describe --tags --exclude latest_develop`
SETENV="BUILD_DATE=\"$BUILD_DATE\" GITHASH=$GITHASH STASH_VERSION=\"$STASH_VERSION\""
SETUP="export CGO_ENABLED=1;"
WINDOWS="echo '=== Building Windows binary ==='; $SETENV make cross-compile-windows;"
DARWIN="echo '=== Building OSX binary ==='; $SETENV make cross-compile-macos-intel;"
DARWIN_ARM64="echo '=== Building OSX (arm64) binary ==='; $SETENV make cross-compile-macos-applesilicon;"
LINUX_AMD64="echo '=== Building Linux (amd64) binary ==='; $SETENV make cross-compile-linux;"
LINUX_ARM64v8="echo '=== Building Linux (armv8/arm64) binary ==='; $SETENV make cross-compile-linux-arm64v8;"
LINUX_ARM32v7="echo '=== Building Linux (armv7/armhf) binary ==='; $SETENV make cross-compile-linux-arm32v7;"
LINUX_ARM32v6="echo '=== Building Linux (armv6 | Raspberry Pi 1) binary ==='; $SETENV make cross-compile-pi;"
BUILD_COMPLETE="echo '=== Build complete ==='"
BUILD=`echo "$1" | cut -d - -f 1`
if [ "$BUILD" == "windows" ]
then
echo "Building Windows"
COMMAND="$SETUP $WINDOWS $BUILD_COMPLETE"
elif [ "$BUILD" == "darwin" ]
then
echo "Building Darwin(MacOSX)"
COMMAND="$SETUP $DARWIN $BUILD_COMPLETE"
elif [ "$BUILD" == "amd64" ]
then
echo "Building Linux AMD64"
COMMAND="$SETUP $LINUX_AMD64 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm64v8" ]
then
echo "Building Linux ARM64v8"
COMMAND="$SETUP $LINUX_ARM64v8 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm32v6" ]
then
echo "Building Linux ARM32v6"
COMMAND="$SETUP $LINUX_ARM32v6 $BUILD_COMPLETE"
elif [ "$BUILD" == "arm32v7" ]
then
echo "Building Linux ARM32v7"
COMMAND="$SETUP $LINUX_ARM32v7 $BUILD_COMPLETE"
else
echo "Building All"
COMMAND="$SETUP $WINDOWS $DARWIN $DARWIN_ARM64 $LINUX_AMD64 $LINUX_ARM64v8 $LINUX_ARM32v7 $LINUX_ARM32v6 $BUILD_COMPLETE"
fi
# Pull Latest Image
docker pull $COMPILER_CONTAINER
# Changed consistency to delegated since this is being used as a build tool. The binded volume shouldn't be changing during its run.
docker run --rm --mount type=bind,source="$(pwd)",target=/stash,consistency=delegated -w /stash $COMPILER_CONTAINER /bin/bash -c "$COMMAND"

View File

@@ -9,10 +9,10 @@
<key>CFBundleTypeIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.stashapp.stash</string>
<string>cc.stashapp.stash</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>
</plist>

View File

@@ -1,38 +0,0 @@
#!/bin/sh
# assumes cross-compile.sh has already been run successfully
uploadFile()
{
FILE=$1
BASENAME="$(basename "${FILE}")"
# get available server from gofile api
serverApi=$(curl -m 15 https://apiv2.gofile.io/getServer)
resp=$(echo "$serverApi" | cut -d "\"" -f 4)
# if no server is available abort
if [ $resp != "ok" ] ; then
echo "Upload of $BASENAME failed! Server not available."
echo
return
fi
server=$(echo "$serverApi" | cut -d "," -f 2 | cut -d "\"" -f 6)
# abort if it takes more than two minutes to upload
uploadedTo=$(curl -m 120 -F "email=stash@stashapp.cc" -F "file=@$FILE" "https://$server.gofile.io/uploadFile")
resp=$(echo "$uploadedTo" | cut -d "\"" -f 4)
if [ $resp = "ok" ] ; then
URL=$(echo "$uploadedTo"|cut -d "," -f 2 | cut -d "\"" -f 6)
echo "$BASENAME uploaded to url: \"https://gofile.io/d/$URL\""
fi
# print an extra newline
echo
}
uploadFile "dist/stash-osx"
uploadFile "dist/stash-win.exe"
uploadFile "dist/stash-linux"
echo "SHA1 Checksums"
cat CHECKSUMS_SHA1 | grep -v '\-pi\|\-arm'