mirror of https://github.com/Xhofe/alist
build: cancel static link for glibc
parent
41a186b051
commit
f9533440c7
16
build.sh
16
build.sh
|
@ -51,16 +51,8 @@ BUILD() {
|
||||||
gitTag=$(git describe --long --tags --dirty --always)
|
gitTag=$(git describe --long --tags --dirty --always)
|
||||||
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
webTag=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||||
echo "build version: $gitTag"
|
echo "build version: $gitTag"
|
||||||
|
|
||||||
ldflags="\
|
ldflags="\
|
||||||
-w -s --extldflags '-static -fpic' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.GitAuthor=$gitAuthor' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.GitCommit=$gitCommit' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.GitTag=$gitTag' \
|
|
||||||
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
|
|
||||||
"
|
|
||||||
ldflagsDarwin="\
|
|
||||||
-w -s \
|
-w -s \
|
||||||
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
|
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
|
||||||
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
|
-X 'github.com/Xhofe/alist/conf.GoVersion=$goVersion' \
|
||||||
|
@ -70,11 +62,9 @@ BUILD() {
|
||||||
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
|
-X 'github.com/Xhofe/alist/conf.WebTag=$webTag' \
|
||||||
"
|
"
|
||||||
if [ "$1" == "release" ]; then
|
if [ "$1" == "release" ]; then
|
||||||
xgo -targets=linux/*,windows/* -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
||||||
xgo -targets=darwin/* -out "$appName" -ldflags="$ldflagsDarwin" -tags=jsoniter .
|
|
||||||
else
|
else
|
||||||
xgo -targets=linux/amd64,windows/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
xgo -targets=linux/amd64,windows/amd64,darwin/amd64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
|
||||||
xgo -targets=darwin/amd64 -out "$appName" -ldflags="$ldflagsDarwin" -tags=jsoniter .
|
|
||||||
fi
|
fi
|
||||||
mkdir -p "build"
|
mkdir -p "build"
|
||||||
mv alist-* build
|
mv alist-* build
|
||||||
|
|
Loading…
Reference in New Issue