[lxc-devel] [lxd-pkg-ubuntu/dpm-yakkety] link against go shared library packages

mwhudson on Github lxc-bot at linuxcontainers.org
Thu Sep 8 10:20:50 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 414 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160908/77103a2e/attachment.bin>
-------------- next part --------------
From edb6e07a41ad58b077c5a18ac3afe08c0e873a86 Mon Sep 17 00:00:00 2001
From: Michael Hudson-Doyle <michael.hudson at canonical.com>
Date: Thu, 8 Sep 2016 22:15:49 +1200
Subject: [PATCH] link against go shared library packages

---
 debian/changelog                   | 6 ++++++
 debian/control                     | 1 +
 debian/helpers/link-from-installed | 3 +++
 debian/rules                       | 9 +++++++++
 4 files changed, 19 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2b8877e..9390185 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+lxd (2.1-0ubuntu3) UNRELEASED; urgency=medium
+
+  * Link against go shared library packages. 
+
+ -- Michael Hudson-Doyle <michael.hudson at ubuntu.com>  Thu, 08 Sep 2016 22:19:39 +1200
+
 lxd (2.1-0ubuntu2) yakkety; urgency=medium
 
   * Properly handle purge. (LP: #1614621)
diff --git a/debian/control b/debian/control
index ffeeda3..fe94a8e 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Build-Depends: debhelper (>= 9),
                dh-golang,
                dh-systemd,
                golang-go,
+               golang-go-shared-dev,
                golang-go.crypto-dev,
                golang-context-dev,
                golang-github-coreos-go-systemd-dev,
diff --git a/debian/helpers/link-from-installed b/debian/helpers/link-from-installed
index d61b651..080417c 100755
--- a/debian/helpers/link-from-installed
+++ b/debian/helpers/link-from-installed
@@ -1,3 +1,6 @@
 #!/bin/sh
+if [ "x$USE_SHLIBS" = "xtrue" ]; then
+    exit 0
+fi
 mkdir -p ${GOPATH}/src/$(dirname $1)
 ln -sT /usr/share/gocode/src/$1 ${GOPATH}/src/$1
diff --git a/debian/rules b/debian/rules
index 712268d..3024030 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,6 +12,11 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 export DH_GOPKG := github.com/lxc/lxd
 export GOPATH := $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
 export USE_EMBEDDED := false
+export USE_SHLIBS := true
+
+ifeq ($(USE_SHLIBS), true)
+export DH_GOLANG_LINK_SHARED := 1
+endif
 
 %:
 	dh $@ --with systemd --buildsystem=golang --with=golang
@@ -34,7 +39,11 @@ override_dh_auto_configure:
 	mv ${GOPATH}/src/github.com/lxc/lxd ${GOPATH}/lxd.tmp
 
 	# Clean GOPATH.
+ifeq ($(USE_SHLIBS), true)
+	rm -Rf ${GOPATH}/src/srclibs
+else
 	rm -Rf ${GOPATH}/src
+endif
 
 ifeq ($(USE_EMBEDDED), true)
 	# If we get all dependencies from dist, just copy it onto GOPATH.


More information about the lxc-devel mailing list