How do I build ubuntu-device-flash from source?

Asked by Luca Weiss

I tried building ubuntu-device-flash from source with the commands:

I download the file https://launchpad.net/ubuntu/+archive/primary/+files/goget-ubuntu-touch_0.34.orig.tar.gz and extract it

export GOPATH="/tmp/ubuntu-device-flash/build"
cd $/tmp/ubuntu-device-flash/goget-ubuntu-touch-0.34/ubuntu-device-flash

#download deps
go get -v -d

# Prepare executable
go build

Then I use the binary at /tmp/ubuntu-device-flash/goget-ubuntu-touch-0.34/ubuntu-device-flash but when I run it, I get the error message "Unknown command `ubuntu-device-flash'. Please specify one command of: core, personal, query or touch" no matter what I try to execute.

During building I get the output

go get: downloading dependencies...
github.com/jessevdk/go-flags (download)
Fetching https://launchpad.net/goget-ubuntu-touch/devices?go-get=1
Parsing meta tags from https://launchpad.net/goget-ubuntu-touch/devices?go-get=1 (status code 404)
launchpad.net/goget-ubuntu-touch (download)
Fetching https://launchpad.net/goget-ubuntu-touch/diskimage?go-get=1
Parsing meta tags from https://launchpad.net/goget-ubuntu-touch/diskimage?go-get=1 (status code 404)
Fetching https://launchpad.net/goget-ubuntu-touch/sysutils?go-get=1
Parsing meta tags from https://launchpad.net/goget-ubuntu-touch/sysutils?go-get=1 (status code 404)
Fetching https://launchpad.net/goget-ubuntu-touch/ubuntuimage?go-get=1
Parsing meta tags from https://launchpad.net/goget-ubuntu-touch/ubuntuimage?go-get=1 (status code 404)
github.com/cheggaaa/pb (download)
go build: building executable...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu goget-ubuntu-touch Edit question
Assignee:
No assignee Edit question
Solved by:
Mihai b
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Luca Weiss (z3ntu) said :
#2

I still have no answer. Thanks.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Normally you would use the following commands to build Ubuntu packages from source:

sudo apt-get install build-essentials
sudo apt-get build-dep goget-ubuntu-touch
apt-get source --compile goget-ubuntu-touch

Remark: the source always consists of two tarballs, the original source and the Debian/ubuntu add-ons, in this case probably goget-ubuntu-touch_0.34-0ubuntu1.diff.gz (a third file goget-ubuntu-touch_0.34-0ubuntu1.dsc is a description of the packages).

(I have never tried that with ubuntu-touch packages, but that should work for any package.)

Revision history for this message
Luca Weiss (z3ntu) said :
#4

I am actually trying to build the package for a non-debian based system (Arch Linux) so I can't use the normal debian tools for compiling...

Revision history for this message
Best Mihai b (themihai) said :
#5

  To make it work you should do the following:

go get -u launchpad.net/goget-ubuntu-touch/ubuntu-device-flash
cd $GOPATH/src/github.com/jessevdk/go-flags
git checkout e790d18a5622970eed9448823164da625077784d
go install $GOPATH/src/launchpad.net/goget-ubuntu-touch/ubuntu-device-flash

Now it should work. You've got that error because the flags parser has been updated with breaking changes since goget-ubuntu-touch. So above you checkout the closest version(by date/time) to the most recent goget-ubuntu-touch release. Hopefully Canonical will start vendoring the dependencies to avoid such issues. There is also the

Revision history for this message
Luca Weiss (z3ntu) said :
#6

Thanks Mihai b, that solved my question.