Merge lp:~sergiusens/snapcraft/go-golang-go into lp:~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Merged
Approved by: John Lenton
Approved revision: 133
Merged at revision: 133
Proposed branch: lp:~sergiusens/snapcraft/go-golang-go
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 58 lines (+4/-29)
2 files modified
plugins/go.yaml (+2/-0)
snapcraft/plugins/go.py (+2/-29)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/go-golang-go
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+268138@code.launchpad.net

Commit message

go as build-deps instead of plugged

Description of the change

This is to make it feel more integrated, like gcc and g++. go is also a build tool so not need to partify it

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/go.yaml'
2--- plugins/go.yaml 2015-07-31 15:16:47 +0000
3+++ plugins/go.yaml 2015-08-14 20:14:13 +0000
4@@ -0,0 +1,2 @@
5+build-tools:
6+ - golang-go
7
8=== modified file 'snapcraft/plugins/go.py'
9--- snapcraft/plugins/go.py 2015-08-06 15:00:29 +0000
10+++ snapcraft/plugins/go.py 2015-08-14 20:14:13 +0000
11@@ -14,10 +14,7 @@
12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14
15-import os
16-
17 import snapcraft
18-from snapcraft.plugins import ubuntu
19
20
21 class GoPlugin(snapcraft.BasePlugin):
22@@ -25,34 +22,10 @@
23 def __init__(self, name, options):
24 super().__init__(name, options)
25
26- class UbuntuOptions:
27- packages = ['golang-go']
28- self.ubuntu = ubuntu.UbuntuPlugin(name, UbuntuOptions())
29-
30- # Prefix our files so they don't conflict with anything else,
31- # especially since we aren't even installing them into the snap.
32- # TODO: This can go away if/when we have proper dependency flattening.
33- self.ubuntu.installdir = os.path.join(self.installdir, 'go')
34-
35- def pull(self):
36- return self.ubuntu.pull()
37-
38- def build(self):
39- if not self.ubuntu.build():
40- return False
41- # on older Ubuntus (like trusty), the installed executable is golang-go
42- if os.path.exists(os.path.join(self.ubuntu.installdir, 'usr', 'bin', 'golang-go')):
43- try:
44- os.symlink('golang-go', os.path.join(self.ubuntu.installdir, 'usr', 'bin', 'go'))
45- except FileExistsError:
46- pass
47- return True
48-
49 def env(self, root):
50 # usr/lib/go/bin on newer Ubuntus, usr/bin on trusty
51- return self.ubuntu.env(root) + [
52- "PATH={0}/go/usr/lib/go/bin:{0}/go/usr/bin:$PATH".format(root),
53- "GOROOT={}/go/usr/lib/go".format(root),
54+ return [
55+ "GOPATH={}/go".format(root),
56 ]
57
58 def snap_files(self):

Subscribers

People subscribed via source and target branches