aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gray <dng@disroot.org>2020-11-10 14:45:38 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2020-11-11 18:32:00 +0000
commit31f6ecb9e47b0196c60c6d4f030d9583eecb453f (patch)
tree84b480a9695d5f34785b0443a15d195ca69d27e4
parent567823dca7dc1f8ce919efbe99762d2d5c020124 (diff)
downloadaports-31f6ecb9e47b0196c60c6d4f030d9583eecb453f.tar.gz
aports-31f6ecb9e47b0196c60c6d4f030d9583eecb453f.tar.bz2
aports-31f6ecb9e47b0196c60c6d4f030d9583eecb453f.tar.xz
testing/lxd: Static build lxd-{agent,p2c}
-rw-r--r--testing/lxd/APKBUILD22
1 files changed, 16 insertions, 6 deletions
diff --git a/testing/lxd/APKBUILD b/testing/lxd/APKBUILD
index cc40b1ab35..392f685a4e 100644
--- a/testing/lxd/APKBUILD
+++ b/testing/lxd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lxd
pkgver=4.7
-pkgrel=1
+pkgrel=2
pkgdesc="a container hypervisor and a new user experience for LXC"
url="https://linuxcontainers.org/lxd/"
arch="all !mips !mips64"
@@ -28,6 +28,7 @@ makedepends="
lxc-dev
gettext-dev
acl-dev
+ acl-static
tcl-dev
libuv-dev
eudev-dev
@@ -43,9 +44,17 @@ makedepends="
automake
patchelf
dqlite-dev
+ dqlite-static
sqlite-replication-dev
sqlite-dev
+ sqlite-static
raft-dev
+ raft-static
+ gettext-static
+ zlib-static
+ libuv-static
+ libseccomp-static
+ libcap-static
"
subpackages="
$pkgname-scripts:scripts:noarch
@@ -74,8 +83,9 @@ build() {
export CGO_LDFLAGS_ALLOW="-Wl,-wrap,pthread_create"
mkdir -p bin
- go build -v -tags "netgo" -o bin/ ./lxd-p2c/...
- go build -v -tags "agent" -o bin/ ./lxd-agent/...
+ go build -v -tags "netgo" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lintl -lraft -ldqlite -luv -lseccomp -lcap"' -o bin/ ./lxd-p2c/...
+ go build -v -tags "agent" -ldflags '-extldflags "-static -lm -ldl -lz -lpthread -lz -lintl -lraft -ldqlite -luv -lseccomp -lcap"' -o bin/ ./lxd-agent/...
+
for tool in fuidshift lxc lxc-to-lxd lxd lxd-benchmark; do
go build -v -tags "libsqlite3" -o bin/ ./$tool/...
done
@@ -88,9 +98,9 @@ package() {
done
install -Dm755 bin/$pkgname "$pkgdir"/usr/sbin/$pkgname
install -Dm755 bin/lxc "$pkgdir"/usr/bin/lxc
-
+
patchelf --set-rpath "/usr/lib/lxd" "$pkgdir/usr/sbin/lxd"
-
+
install -Dm755 "$srcdir"/lxd.initd \
"$pkgdir"/etc/init.d/lxd
install -Dm644 "$srcdir"/lxd.confd \
@@ -113,7 +123,7 @@ scripts() {
export GOPATH="$builddir/_dist"
cd $builddir
-
+
install -Dm755 scripts/empty-lxd.sh "$subpkgdir"/usr/bin/empty-lxd.sh
}