drone: update build flags
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nyyu 2022-07-14 09:51:09 +02:00
parent 5ffff2b392
commit 620aa6d349
7 changed files with 131 additions and 72 deletions

View file

@ -1,13 +1,13 @@
pkgbase = drone
pkgdesc = Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant
pkgver = 2.12.1
pkgrel = 1
pkgrel = 2
url = https://drone.io
arch = x86_64
license = Apache
license = custom
makedepends = go
makedepends = git
makedepends = gcc
options = !lto
backup = etc/drone/server
source = git+https://github.com/drone/drone.git#tag=v2.12.1
source = drone.service

View file

@ -1,37 +1,65 @@
# Maintainer: Sl@ny <webmaster [at] slany [dot] work>
pkgname=drone
pkgver=2.12.1
pkgrel=1
pkgrel=2
pkgdesc="Drone is a Continuous Delivery platform built on Docker, written in Go - Free enterprise variant"
arch=('x86_64')
url="https://drone.io"
license=('Apache')
makedepends=('go' 'git' 'gcc')
license=('custom')
makedepends=('go' 'git')
options=('!lto')
backup=('etc/drone/server')
source=(git+https://github.com/drone/drone.git#tag=v$pkgver
'drone.service'
'server.conf')
'drone.service'
'server.conf')
sha256sums=('SKIP'
'3cd219b1c5611b9ff4211d4837dff11228d9a491cd41d21f4c60af77c8c21d5c'
'2b8957cd6b9f9ee6e8d831f58b0ef3fac2170a56f6259884ec7d30c3ba38c73a')
'3cd219b1c5611b9ff4211d4837dff11228d9a491cd41d21f4c60af77c8c21d5c'
'2b8957cd6b9f9ee6e8d831f58b0ef3fac2170a56f6259884ec7d30c3ba38c73a')
prepare() {
cd "$pkgname"
mkdir build
go mod download
}
build() {
cd "$srcdir/$pkgname"
go build -a -v -trimpath -buildmode=pie -mod=readonly -tags "nolimit" -ldflags '-w -s' ./cmd/drone-server
cd "$pkgname"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
local COMMON_FLAGS=(
-trimpath
-buildmode=pie
-mod=readonly
-modcacherw
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
)
go build \
"${COMMON_FLAGS[@]}" \
-tags "nolimit" \
-o build \
./cmd/...
}
check() {
cd "$pkgname"
go test -v ./...
}
package() {
cd "$srcdir"
# binaries
install -Dm755 "$pkgname/$pkgname"-server "$pkgdir"/usr/bin/"$pkgname"-server
# license
install -Dm644 "$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# service
install -Dm644 drone.service "$pkgdir/usr/lib/systemd/system/drone.service"
# config
install -Dm644 server.conf "$pkgdir/etc/drone/server"
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" build/*
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE NOTICE
}