Add build.sh to adguard-home
This commit is contained in:
parent
875a5cc55b
commit
3f4b2d2ab9
@ -28,8 +28,8 @@ src_configure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
emake bin/"$PN"
|
# emake bin/"$PN"
|
||||||
# CHANNEL=development SIGN=0 VERBOSE=1 ARCH=amd64 OS=linux ./scripts/make/build-release.sh
|
env CHANNEL=edge SIGN=0 VERBOSE=1 ARCH=amd64 OS=linux ${FILESDIR}/build.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
|
|||||||
4
net-misc/adguard-home/files/Makefile
Normal file
4
net-misc/adguard-home/files/Makefile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
GO=${GO:-go}
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
55
net-misc/adguard-home/files/build.sh
Normal file
55
net-misc/adguard-home/files/build.sh
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
go="${GO:-go}"
|
||||||
|
readonly go
|
||||||
|
|
||||||
|
|
||||||
|
bump_minor='/^v[0-9]+\.[0-9]+\.0$/ {
|
||||||
|
print($1 "." $2 + 1 ".0");
|
||||||
|
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
printf("invalid release version: \"%s\"\n", $0);
|
||||||
|
|
||||||
|
exit 1;
|
||||||
|
}'
|
||||||
|
readonly bump_minor
|
||||||
|
|
||||||
|
|
||||||
|
get_last_minor_zero() {
|
||||||
|
git tag\
|
||||||
|
| grep -e 'v[0-9]\+\.[0-9]\+\.0$'\
|
||||||
|
| sort -k 1.2,1nr -k 2,2nr -t '.'\
|
||||||
|
| head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
last_minor_zero="$( get_last_minor_zero )"
|
||||||
|
readonly last_minor_zero
|
||||||
|
num_commits_since_minor="$( git rev-list --count "${last_minor_zero}..HEAD" )"
|
||||||
|
readonly num_commits_since_minor
|
||||||
|
|
||||||
|
next_minor="$( echo "$last_minor_zero" | awk -F '.' "$bump_minor" )"
|
||||||
|
readonly next_minor
|
||||||
|
|
||||||
|
version="${next_minor}-a.${num_commits_since_minor}+$( git rev-parse --short HEAD )"
|
||||||
|
|
||||||
|
CGO_ENABLED='1'
|
||||||
|
GO111MODULE='on'
|
||||||
|
export CGO_ENABLED
|
||||||
|
export GO111MODULE
|
||||||
|
|
||||||
|
version_pkg='github.com/AdguardTeam/AdGuardHome/internal/version'
|
||||||
|
readonly version_pkg
|
||||||
|
|
||||||
|
ldflags="-s -w"
|
||||||
|
ldflags="${ldflags} -X ${version_pkg}.version=${version}"
|
||||||
|
ldflags="${ldflags} -X ${version_pkg}.channel=${channel}"
|
||||||
|
|
||||||
|
"$go" build\
|
||||||
|
--ldflags "$ldflags"\
|
||||||
|
--race=1\
|
||||||
|
--trimpath\
|
||||||
|
-o=AdGuardHome\
|
||||||
|
-v=1\
|
||||||
|
-x=1
|
||||||
Loading…
Reference in New Issue
Block a user