Merge ~3v1n0/ubuntu-app-platform:master into ubuntu-app-platform:master

Proposed by Marco Trevisan (Treviño)
Status: Superseded
Proposed branch: ~3v1n0/ubuntu-app-platform:master
Merge into: ubuntu-app-platform:master
Diff against target: 287 lines (+2/-134)
2 files modified
dev/null (+0/-134)
snapcraft.yaml (+2/-0)
Reviewer Review Type Date Requested Status
Tim Peeters Needs Fixing
Review via email: mp+311634@code.launchpad.net

This proposal has been superseded by a proposal from 2016-11-28.

Commit message

snapcraft.yaml: load indicator-qt5 remote part

It adds proper support to app-indicators in classic space.

Description of the change

See https://github.com/3v1n0/indicators-examples-snaps for more infos or the part definition at https://github.com/3v1n0/appindicators-snapcraft-parts

Removed also the unneeded and outdated custom plugins (the x-qmake one specifically was pointing to the wrong location, thus causing indicator-qt5 not to compile).

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

Thanks for the MR, but can you separate adding of a dependency and removing the plugins into separate MRs to make it easier to review?

Perhaps a bug report describing the the outdated plugins is useful too.

review: Needs Fixing

Unmerged commits

2b06828... by Marco Trevisan (Treviño)

snapcraft.yaml: load indicator-qt5 remote part

It adds proper support to app-indicators in classic space

df906a2... by Marco Trevisan (Treviño)

plugins: remove unneeded custom plugins.

There's nothing to build here, while
qtbase isn't there anymore.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/parts/plugins/x-autotools.py b/parts/plugins/x-autotools.py
2deleted file mode 100644
3index 4cb33b3..0000000
4--- a/parts/plugins/x-autotools.py
5+++ /dev/null
6@@ -1,131 +0,0 @@
7-# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
8-#
9-# Copyright (C) 2015, 2016 Canonical Ltd
10-# Copyright (C) 2016 Harald Sitter <sitter@kde.org>
11-#
12-# This program is free software: you can redistribute it and/or modify
13-# it under the terms of the GNU General Public License version 3 as
14-# published by the Free Software Foundation.
15-#
16-# This program is distributed in the hope that it will be useful,
17-# but WITHOUT ANY WARRANTY; without even the implied warranty of
18-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19-# GNU General Public License for more details.
20-#
21-# You should have received a copy of the GNU General Public License
22-# along with this program. If not, see <http://www.gnu.org/licenses/>.
23-
24-"""The autotools plugin is used for autotools based parts.
25-
26-Autotools based projects are the ones that have the usual
27-`./configure && make && make install` instruction set.
28-
29-The plugin tries to build using ./configure first, if it is not there
30-it will run ./autogen and if autogen is not there it will run autoreconf.
31-
32-This plugin uses the common plugin keywords as well as those for "sources".
33-For more information check the 'plugins' topic for the former and the
34-'sources' topic for the latter.
35-
36-In addition, this plugin uses the following plugin-specific keywords:
37-
38- - configflags:
39- (list of strings)
40- configure flags to pass to the build such as those shown by running
41- './configure --help'
42- - install-via:
43- (enum, 'destdir' or 'prefix')
44- Whether to install via DESTDIR or by using --prefix (default is
45- 'destdir')
46-"""
47-
48-import os
49-import stat
50-
51-import snapcraft
52-
53-
54-class AutotoolsPlugin(snapcraft.BasePlugin):
55-
56- @classmethod
57- def schema(cls):
58- schema = super().schema()
59- schema['properties']['configflags'] = {
60- 'type': 'array',
61- 'minitems': 1,
62- 'uniqueItems': False,
63- 'items': {
64- 'type': 'string',
65- },
66- 'default': [],
67- }
68-
69- schema['properties']['install-via'] = {
70- 'enum': ['destdir', 'prefix'],
71- 'default': 'destdir',
72- }
73-
74- # Inform Snapcraft of the properties associated with building. If these
75- # change in the YAML Snapcraft will consider the build step dirty.
76- schema['build-properties'].extend(['configflags', 'install-via'])
77-
78- return schema
79-
80- def __init__(self, name, options, project):
81- super().__init__(name, options, project)
82- self.build_packages.extend([
83- 'autoconf',
84- 'automake',
85- 'autopoint',
86- 'libtool',
87- 'make',
88- ])
89-
90- if options.install_via == 'destdir':
91- self.install_via_destdir = True
92- elif options.install_via == 'prefix':
93- self.install_via_destdir = False
94- else:
95- raise RuntimeError('Unsupported installation method: "{}"'.format(
96- options.install_via))
97-
98- def build(self):
99- super().build()
100- if not os.path.exists(os.path.join(self.builddir, "configure")):
101- generated = False
102- scripts = ["autogen.sh", "bootstrap"]
103- for script in scripts:
104- path = os.path.join(self.builddir, script)
105- if not os.path.exists(path):
106- continue
107- # Make sure it's executable
108- if not os.access(path, os.X_OK):
109- os.chmod(path,
110- stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
111- stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP |
112- stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH)
113- self.run(['env', 'NOCONFIGURE=1', './{}'.format(script)])
114- generated = True
115- break
116- if not generated:
117- self.run(['autoreconf', '-i'])
118-
119- configure_command = ['./configure']
120- make_install_command = ['make', 'install']
121-
122- if self.install_via_destdir:
123- # Use an empty prefix since we'll install via DESTDIR
124- configure_command.append('--prefix=')
125- make_install_command.append('DESTDIR=' + self.installdir)
126- else:
127- configure_command.append('--prefix=' + self.installdir)
128-
129- self.run(configure_command + self.options.configflags)
130- self.run(['make', '-j{}'.format(self.parallel_build_count)])
131- self.run(make_install_command)
132-
133- def snap_fileset(self):
134- fileset = super().snap_fileset()
135- # Remove .la files which don't work when they are moved around
136- fileset.append('-**/*.la')
137- return fileset
138diff --git a/parts/plugins/x-qmake.py b/parts/plugins/x-qmake.py
139deleted file mode 100644
140index df766c0..0000000
141--- a/parts/plugins/x-qmake.py
142+++ /dev/null
143@@ -1,134 +0,0 @@
144-# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
145-#
146-# Copyright (C) 2016 Canonical Ltd
147-#
148-# This program is free software: you can redistribute it and/or modify
149-# it under the terms of the GNU General Public License version 3 as
150-# published by the Free Software Foundation.
151-#
152-# This program is distributed in the hope that it will be useful,
153-# but WITHOUT ANY WARRANTY; without even the implied warranty of
154-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155-# GNU General Public License for more details.
156-#
157-# You should have received a copy of the GNU General Public License
158-# along with this program. If not, see <http://www.gnu.org/licenses/>.
159-
160-"""The qmake plugin is useful for building qmake-based parts.
161-
162-These are projects that are built using .pro files.
163-
164-This plugin uses the common plugin keywords as well as those for "sources".
165-For more information check the 'plugins' topic for the former and the
166-'sources' topic for the latter.
167-
168-Additionally, this plugin uses the following plugin-specific keywords:
169-
170- - options:
171- (list of strings)
172- additional options to pass to the qmake invocation.
173- - qt-version:
174- (enum, 'qt4' or 'qt5')
175- Version of Qt to use with qmake.
176- - project-files:
177- (list of strings)
178- list of .pro files to pass to the qmake invocation.
179-"""
180-
181-import os
182-
183-import snapcraft
184-from snapcraft import common
185-
186-
187-class QmakePlugin(snapcraft.BasePlugin):
188-
189- @classmethod
190- def schema(cls):
191- schema = super().schema()
192- schema['properties']['options'] = {
193- 'type': 'array',
194- 'minitems': 1,
195- 'uniqueItems': True,
196- 'items': {
197- 'type': 'string',
198- },
199- 'default': [],
200- }
201- schema['properties']['qt-version'] = {
202- 'enum': ['qt4', 'qt5'],
203- }
204- schema['properties']['project-files'] = {
205- 'type': 'array',
206- 'minitems': 1,
207- 'uniqueItems': True,
208- 'items': {
209- 'type': 'string',
210- },
211- 'default': [],
212- }
213-
214- # Qt version must be specified
215- schema['required'].append('qt-version')
216-
217- # Inform Snapcraft of the properties associated with building and
218- # pulling so it can mark those steps dirty if they change in the YAML.
219- schema['build-properties'].append('options')
220- schema['pull-properties'].append('qt-version')
221-
222- return schema
223-
224- def __init__(self, name, options, project):
225- super().__init__(name, options, project)
226-
227- self.build_packages.append('make')
228-
229- def build(self):
230- super().build()
231-
232- env = self._build_environment()
233-
234- sources = []
235- if self.options.project_files:
236- sourcedir = self.sourcedir
237- source_subdir = getattr(self.options, 'source_subdir', None)
238- if source_subdir:
239- sourcedir = os.path.join(sourcedir, source_subdir)
240- sources = [os.path.join(sourcedir, project_file)
241- for project_file in self.options.project_files]
242-
243- self.run([ self.project.parts_dir + '/qtbase/build/bin/qmake'] + self._extra_config() + self.options.options +
244- sources, env=env)
245-
246- self.run(['make', '-j{}'.format(
247- self.parallel_build_count)], env=env)
248-
249- self.run(['make', 'install', 'INSTALL_ROOT=' + self.installdir],
250- env=env)
251-
252- def _extra_config(self):
253- extra_config = []
254-
255- for root in [self.installdir, self.project.stage_dir]:
256- paths = common.get_library_paths(root, self.project.arch_triplet)
257- for path in paths:
258- extra_config.append("LIBS+=\"-L{}\"".format(path))
259-
260- paths = common.get_include_paths(root, self.project.arch_triplet)
261- for path in paths:
262- extra_config.append("INCLUDEPATH+=\"{}\"".format(path))
263- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtbase/build/NAP/include'))
264- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtxmlpatterns/build/include'))
265- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtdeclarative/build/include'))
266- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qttools/build/include'))
267- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtmultimedia/build/include'))
268- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtsvg/build/include'))
269- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtgraphicaleffects/build/include'))
270- extra_config.append("INCLUDEPATH+=\"{}\"".format(self.project.parts_dir + '/qtpim/build/include'))
271- return extra_config
272-
273- def _build_environment(self):
274- env = os.environ.copy()
275- env['QT_SELECT'] = self.options.qt_version
276- env['QTDIR' ] = self.project.parts_dir + '/qtbase/build/'
277- return env
278diff --git a/snapcraft.yaml b/snapcraft.yaml
279index f548753..9d5f2ab 100644
280--- a/snapcraft.yaml
281+++ b/snapcraft.yaml
282@@ -106,3 +106,5 @@ parts:
283 - usr/share/webbrowser-app
284 - usr/share/X11
285
286+ after:
287+ - indicator-qt5

Subscribers

People subscribed via source and target branches