From e995c6095432c4b76aafd5ef0cbcb2bbd5dcb834 Mon Sep 17 00:00:00 2001 From: IvanBorislavovDimitrov Date: Wed, 3 Jan 2024 12:18:28 +0200 Subject: [PATCH] Make statically linked binaries the default --- build.sh | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/build.sh b/build.sh index 1e80c0d..ca3febd 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ function build() { echo "building for $platform $arch" GOOS=$platform GOARCH=$arch go build \ -ldflags "-X main.Version=${version}" \ - -o ${plugin_name} + -o "${plugin_name}" } function buildstatic() { @@ -21,18 +21,18 @@ function buildstatic() { echo "building static for $platform $arch" CGO_ENABLED=0 GOOS=$platform GOARCH=$arch go build -a -tags netgo \ -ldflags "-w -extldflags \"-static\" -X main.Version=${version}" \ - -o ${plugin_name} + -o "${plugin_name}" } function movePluginsToBuildFolder() { local folder=$1 - mv $PLUGIN_NAME_WIN_32 $folder - mv $PLUGIN_NAME_WIN_64 $folder - mv $PLUGIN_NAME_LINUX_32 $folder - mv $PLUGIN_NAME_LINUX_64 $folder - mv $PLUGIN_NAME_LINUX_ARM64 $folder - mv $PLUGIN_NAME_OSX $folder - mv $PLUGIN_NAME_APPLE_ARM64 $folder + mv $PLUGIN_NAME_NON_STATIC_WIN_32 $folder + mv $PLUGIN_NAME_NON_STATIC_WIN_64 $folder + mv $PLUGIN_NAME_NON_STATIC_LINUX_32 $folder + mv $PLUGIN_NAME_NON_STATIC_LINUX_64 $folder + mv $PLUGIN_NAME_NON_STATIC_LINUX_ARM64 $folder + mv $PLUGIN_NAME_NON_STATIC_OSX $folder + mv $PLUGIN_NAME_NON_STATIC_APPLE_ARM64 $folder mv $PLUGIN_NAME_STATIC_WIN_32 $folder mv $PLUGIN_NAME_STATIC_WIN_64 $folder mv $PLUGIN_NAME_STATIC_LINUX_32 $folder @@ -53,38 +53,38 @@ script_dir="$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")" cd "${script_dir}" BUILD_FOLDER=build -PLUGIN_NAME_WIN_32=multiapps-plugin.win32.exe -PLUGIN_NAME_WIN_64=multiapps-plugin.win64.exe -PLUGIN_NAME_LINUX_32=multiapps-plugin.linux32 -PLUGIN_NAME_LINUX_64=multiapps-plugin.linux64 -PLUGIN_NAME_LINUX_ARM64=multiapps-plugin.linuxarm64 -PLUGIN_NAME_OSX=multiapps-plugin.osx -PLUGIN_NAME_APPLE_ARM64=multiapps-plugin.osxarm64 +PLUGIN_NAME_NON_STATIC_WIN_32=multiapps-plugin-non-static.win32.exe +PLUGIN_NAME_NON_STATIC_WIN_64=multiapps-plugin-non-static.win64.exe +PLUGIN_NAME_NON_STATIC_LINUX_32=multiapps-plugin-non-static.linux32 +PLUGIN_NAME_NON_STATIC_LINUX_64=multiapps-plugin-non-static.linux64 +PLUGIN_NAME_NON_STATIC_LINUX_ARM64=multiapps-plugin-non-static.linuxarm64 +PLUGIN_NAME_NON_STATIC_OSX=multiapps-plugin-non-static.osx +PLUGIN_NAME_NON_STATIC_APPLE_ARM64=multiapps-plugin-non-static.osxarm64 -PLUGIN_NAME_STATIC_WIN_32=multiapps-plugin-static.win32.exe -PLUGIN_NAME_STATIC_WIN_64=multiapps-plugin-static.win64.exe -PLUGIN_NAME_STATIC_LINUX_32=multiapps-plugin-static.linux32 -PLUGIN_NAME_STATIC_LINUX_64=multiapps-plugin-static.linux64 -PLUGIN_NAME_STATIC_LINUX_ARM64=multiapps-plugin-static.linuxarm64 -PLUGIN_NAME_STATIC_OSX=multiapps-plugin-static.osx -PLUGIN_NAME_STATIC_APPLE_ARM64=multiapps-plugin-static.osxarm64 +PLUGIN_NAME_STATIC_WIN_32=multiapps-plugin.win32.exe +PLUGIN_NAME_STATIC_WIN_64=multiapps-plugin.win64.exe +PLUGIN_NAME_STATIC_LINUX_32=multiapps-plugin.linux32 +PLUGIN_NAME_STATIC_LINUX_64=multiapps-plugin.linux64 +PLUGIN_NAME_STATIC_LINUX_ARM64=multiapps-plugin.linuxarm64 +PLUGIN_NAME_STATIC_OSX=multiapps-plugin.osx +PLUGIN_NAME_STATIC_APPLE_ARM64=multiapps-plugin.osxarm64 version=$(