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
=== modified file 'parts/plugins/x-autotools.py'
--- parts/plugins/x-autotools.py 2016-01-29 19:01:42 +0000
+++ parts/plugins/x-autotools.py 2016-04-13 13:55:26 +0000
@@ -55,6 +55,21 @@
55 'default': [],55 'default': [],
56 }56 }
5757
58 schema['properties']['install-via'] = {
59 'enum': ['destdir', 'prefix'],
60 'default': 'destdir',
61 }
62
63 schema['properties']['patches-dir'] = {
64 'type': 'string',
65 'default': 'patches',
66 }
67
68 schema['properties']['force-autogen'] = {
69 'type': 'boolean',
70 'default': 'true',
71 }
72
58 return schema73 return schema
5974
60 def __init__(self, name, options):75 def __init__(self, name, options):
@@ -65,16 +80,27 @@
65 'autopoint',80 'autopoint',
66 'libtool',81 'libtool',
67 'make',82 'make',
83 'quilt',
68 ])84 ])
6985
86 if options.install_via == 'destdir':
87 self.install_via_destdir = True
88 elif options.install_via == 'prefix':
89 self.install_via_destdir = False
90 else:
91 raise RuntimeError('Unsupported installation method: "{}"'.format(
92 options.install_via))
93
70 def build(self):94 def build(self):
71 super().build()95 super().build()
7296
73 self.run(['pwd'])97 patchdir = os.path.join(self.builddir, "../../..", self.options.patches_dir)
74 os.environ['QUILT_PATCHES'] = '../../../patches'98
75 self.run(['quilt', 'push', '-a'])99 if os.path.exists(patchdir):
76 100 os.environ['QUILT_PATCHES'] = patchdir
77 if not os.path.exists(os.path.join(self.builddir, "configure")):101 self.run(['quilt', 'push', '-a'])
102
103 if not os.path.exists(os.path.join(self.builddir, "configure")) or self.options.force_autogen:
78 autogen_path = os.path.join(self.builddir, "autogen.sh")104 autogen_path = os.path.join(self.builddir, "autogen.sh")
79 if os.path.exists(autogen_path):105 if os.path.exists(autogen_path):
80 # Make sure it's executable106 # Make sure it's executable
@@ -88,6 +114,17 @@
88 else:114 else:
89 self.run(['autoreconf', '-i'])115 self.run(['autoreconf', '-i'])
90116
91 self.run(['./configure', '--prefix='] + self.options.configflags)117 configure_command = ['./configure']
92 self.run(['make'])118 make_install_command = ['make', 'install']
93 self.run(['make', 'install', 'DESTDIR=' + self.installdir])119
120 if self.install_via_destdir:
121 # Use an empty prefix since we'll install via DESTDIR
122 configure_command.append('--prefix=')
123 make_install_command.append('DESTDIR=' + self.installdir)
124 else:
125 configure_command.append('--prefix=' + self.installdir)
126
127 self.run(configure_command + self.options.configflags)
128 self.run(['make', '-j{}'.format(
129 snapcraft.common.get_parallel_build_count())])
130 self.run(make_install_command)
94131
=== modified file 'snapcraft.yaml'
--- snapcraft.yaml 2016-02-04 20:19:04 +0000
+++ snapcraft.yaml 2016-04-13 13:55:26 +0000
@@ -32,16 +32,15 @@
32 apparmor: bluez.apparmor32 apparmor: bluez.apparmor
33 seccomp: bluez.seccomp33 seccomp: bluez.seccomp
34 obex-service:34 obex-service:
35 type: migration-skill 35 type: migration-skill
36 security-policy: 36 security-policy:
37 apparmor: obex.apparmor37 apparmor: obex.apparmor
38 seccomp: obex.seccomp38 seccomp: obex.seccomp
3939
40parts:40parts:
41 bluez:41 bluez:
42 plugin: autotools42 plugin: autotools
43 source: git://git.kernel.org/pub/scm/bluetooth/bluez.git43 source: https://www.kernel.org/pub/linux/bluetooth/bluez-5.37.tar.xz
44 source-tag: "5.37"
45 configflags:44 configflags:
46 - --prefix=/usr45 - --prefix=/usr
47 - --libexec=/usr/lib/46 - --libexec=/usr/lib/
@@ -54,15 +53,15 @@
54 - --disable-systemd53 - --disable-systemd
55 - --disable-silent-rules54 - --disable-silent-rules
56 build-packages:55 build-packages:
56 - libglib2.0-dev
57 - libdbus-1-dev
57 - libical-dev58 - libical-dev
58 - libreadline6-dev 59 - libreadline6-dev
59 - libudev-dev60 - libudev-dev
60 - pkg-config61 - pkg-config
61 - quilt62 - quilt
62 stage-packages:63 stage-packages:
63 - libglib2.0-dev64 - libical1a
64 - libdbus-1-dev
65 - libical1a
66 filesets:65 filesets:
67 libical1a:66 libical1a:
68 - usr/lib/*/libical*67 - usr/lib/*/libical*

Subscribers

People subscribed via source and target branches

to all changes: