← Back to team overview

ubuntu-phone team mailing list archive

Golang scope cross build

 

Hi

I tried to compile my golang scope following the directives given in
https://developer.ubuntu.com/en/scopes/tutorials/developing-scopes-go/ but
I've hit some issues.

First not all needed packages were installed with the apt-get install
command. I still needed:
bzr (for go install)
libaccounts-glib-dev:arm (for "launchpad.net/go-unityscopes/v2" to get
build properly)

I had to replace:

click chroot -a armhf -f ubuntu-sdk-15.04 -s vivid run CGO_ENABLED=1
GOARCH=arm GOARM=7
PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
GOPATH=/usr/share/gocode/:~/dev-go CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++ go build -ldflags
'-extld=arm-linux-gnueabihf-g++'

with:

click chroot -a armhf -f ubuntu-sdk-15.04 -s vivid run CGO_ENABLED=1
GOARCH=arm GOARM=7
PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
GOPATH=~/dev-go CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ go
build -ldflags '-extld=arm-linux-gnueabihf-g++'

The difference is GOPATH=~/dev-go iso GOPATH=/usr/share/gocode/:~/dev-go.
Otherwise it tries to install the dependencies in /usr/share/gocode (and
off course fail).

I also tried to use "launchpad.net/go-onlineaccounts/v1" in my go scope.
But this needs libsignon-glib-dev:armhf to be installed, but this results
in:

$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 -s vivid maint apt-get
install libsignon-glib-dev:armhf
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 libsignon-glib-dev:armhf : Depends: gir1.2-signon-1.0:armhf but it is not
going to be installed
                            Depends: signond-dev:armhf but it is not going
to be installed
E: Unable to correct problems, you have held broken packages.
Command returned 100: schroot -u root -c
source:click-ubuntu-sdk-15.04-armhf -- apt-get install
libsignon-glib-dev:armhf


I used the prebuild chroot from the ubuntu-sdk team ppa.

Follow ups