Merge lp:~morphis/bluez/fix-snapcraft-source into lp:~bluetooth/bluez/snap-core-rolling

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 43
Merged at revision: 40
Proposed branch: lp:~morphis/bluez/fix-snapcraft-source
Merge into: lp:~bluetooth/bluez/snap-core-rolling
Diff against target: 123 lines (+52/-16)
2 files modified
parts/plugins/x-autotools.py (+45/-8)
snapcraft.yaml (+7/-8)
To merge this branch: bzr merge lp:~morphis/bluez/fix-snapcraft-source
Reviewer Review Type Date Requested Status
Scott Sweeny (community) Approve
Tony Espy Pending
Bluetooth Pending
Review via email: mp+291757@code.launchpad.net

Commit message

Fixes to get build working on launchpad

* Use same autotools plugin we use for network-manager
* Fetch source tarball over http as launchpad proxy can't deal with git://
* Adjust stage-packages/build-packages to be correct

Description of the change

See https://launchpad.net/~phablet-team/+snap/bluez for successful builds with this.

To post a comment you must log in.
Revision history for this message
Scott Sweeny (ssweeny) wrote :

snapcraft.yaml looks OK to me except for a deprecation warning about the icon definition. Instead of specifying it in the yaml file you put the icon file itself in setup/gui/[1]

[1] https://github.com/ubuntu-core/snapcraft/blob/master/docs/metadata.md#snap-icon

review: Needs Fixing
Revision history for this message
Scott Sweeny (ssweeny) wrote :

> snapcraft.yaml looks OK to me except for a deprecation warning about the icon
> definition. Instead of specifying it in the yaml file you put the icon file
> itself in setup/gui/[1]
>
> [1] https://github.com/ubuntu-core/snapcraft/blob/master/docs/metadata.md
> #snap-icon

... that should say "Instead of specifying it in the yaml file you *need to* put the icon file itself in setup/gui"

43. By Simon Fels

Move icon at the place it belongs to

Revision history for this message
Simon Fels (morphis) wrote :

@Scott: Fixed

Revision history for this message
Scott Sweeny (ssweeny) wrote :

This looks good now, and I've proposed my own branch on top of it.

https://code.launchpad.net/~ssweeny/bluez/snappy-interface/+merge/292304

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'parts/plugins/x-autotools.py'
2--- parts/plugins/x-autotools.py 2016-01-29 19:01:42 +0000
3+++ parts/plugins/x-autotools.py 2016-04-13 13:55:26 +0000
4@@ -55,6 +55,21 @@
5 'default': [],
6 }
7
8+ schema['properties']['install-via'] = {
9+ 'enum': ['destdir', 'prefix'],
10+ 'default': 'destdir',
11+ }
12+
13+ schema['properties']['patches-dir'] = {
14+ 'type': 'string',
15+ 'default': 'patches',
16+ }
17+
18+ schema['properties']['force-autogen'] = {
19+ 'type': 'boolean',
20+ 'default': 'true',
21+ }
22+
23 return schema
24
25 def __init__(self, name, options):
26@@ -65,16 +80,27 @@
27 'autopoint',
28 'libtool',
29 'make',
30+ 'quilt',
31 ])
32
33+ if options.install_via == 'destdir':
34+ self.install_via_destdir = True
35+ elif options.install_via == 'prefix':
36+ self.install_via_destdir = False
37+ else:
38+ raise RuntimeError('Unsupported installation method: "{}"'.format(
39+ options.install_via))
40+
41 def build(self):
42 super().build()
43
44- self.run(['pwd'])
45- os.environ['QUILT_PATCHES'] = '../../../patches'
46- self.run(['quilt', 'push', '-a'])
47-
48- if not os.path.exists(os.path.join(self.builddir, "configure")):
49+ patchdir = os.path.join(self.builddir, "../../..", self.options.patches_dir)
50+
51+ if os.path.exists(patchdir):
52+ os.environ['QUILT_PATCHES'] = patchdir
53+ self.run(['quilt', 'push', '-a'])
54+
55+ if not os.path.exists(os.path.join(self.builddir, "configure")) or self.options.force_autogen:
56 autogen_path = os.path.join(self.builddir, "autogen.sh")
57 if os.path.exists(autogen_path):
58 # Make sure it's executable
59@@ -88,6 +114,17 @@
60 else:
61 self.run(['autoreconf', '-i'])
62
63- self.run(['./configure', '--prefix='] + self.options.configflags)
64- self.run(['make'])
65- self.run(['make', 'install', 'DESTDIR=' + self.installdir])
66+ configure_command = ['./configure']
67+ make_install_command = ['make', 'install']
68+
69+ if self.install_via_destdir:
70+ # Use an empty prefix since we'll install via DESTDIR
71+ configure_command.append('--prefix=')
72+ make_install_command.append('DESTDIR=' + self.installdir)
73+ else:
74+ configure_command.append('--prefix=' + self.installdir)
75+
76+ self.run(configure_command + self.options.configflags)
77+ self.run(['make', '-j{}'.format(
78+ snapcraft.common.get_parallel_build_count())])
79+ self.run(make_install_command)
80
81=== modified file 'snapcraft.yaml'
82--- snapcraft.yaml 2016-02-04 20:19:04 +0000
83+++ snapcraft.yaml 2016-04-13 13:55:26 +0000
84@@ -32,16 +32,15 @@
85 apparmor: bluez.apparmor
86 seccomp: bluez.seccomp
87 obex-service:
88- type: migration-skill
89- security-policy:
90+ type: migration-skill
91+ security-policy:
92 apparmor: obex.apparmor
93 seccomp: obex.seccomp
94
95 parts:
96 bluez:
97 plugin: autotools
98- source: git://git.kernel.org/pub/scm/bluetooth/bluez.git
99- source-tag: "5.37"
100+ source: https://www.kernel.org/pub/linux/bluetooth/bluez-5.37.tar.xz
101 configflags:
102 - --prefix=/usr
103 - --libexec=/usr/lib/
104@@ -54,15 +53,15 @@
105 - --disable-systemd
106 - --disable-silent-rules
107 build-packages:
108+ - libglib2.0-dev
109+ - libdbus-1-dev
110 - libical-dev
111- - libreadline6-dev
112+ - libreadline6-dev
113 - libudev-dev
114 - pkg-config
115 - quilt
116 stage-packages:
117- - libglib2.0-dev
118- - libdbus-1-dev
119- - libical1a
120+ - libical1a
121 filesets:
122 libical1a:
123 - usr/lib/*/libical*

Subscribers

People subscribed via source and target branches

to all changes: