Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add qmake plugin. #566
Conversation
|
Hmm... main.py has apparently gotten complex. |
|
El 10/06/16 a las 17:15, Kyle Fazzari escribió:
|
elopio
reviewed
Jun 10, 2016
| @@ -0,0 +1,106 @@ | ||
| +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
| +# | ||
| +# Copyright (C) 2015 Canonical Ltd |
elopio
reviewed
Jun 10, 2016
| + | ||
| + - options: | ||
| + (list of strings) | ||
| + additional options to pass to the qmake invocation. |
elopio
reviewed
Jun 10, 2016
| + schema['build-properties'].append('options') | ||
| + | ||
| + # Inform Snapcraft of the properties associated with pulling. If these | ||
| + # change in the YAML Snapcraft will consider the pull step dirty. |
elopio
Jun 10, 2016
Member
I think you shouldn't duplicate the comment, just move the second statement right under the first.
elopio
reviewed
Jun 10, 2016
| + | ||
| + def _build_environment(self): | ||
| + env = os.environ.copy() | ||
| + env['QT_SELECT'] = self.options.qt_version |
sergiusens
Jun 15, 2016
Collaborator
yeah, this will play nicely with the upcoming build-environment keyword.
elopio
reviewed
Jun 10, 2016
| + | ||
| +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
| +# | ||
| +# Copyright (C) 2015 Canonical Ltd |
elopio
reviewed
Jun 10, 2016
| + '"string", but it was "{}"' | ||
| + .format(options_items_type)) | ||
| + | ||
| + # Check install-via property |
elopio
reviewed
Jun 10, 2016
| + os.makedirs(plugin.builddir) | ||
| + plugin.build() | ||
| + | ||
| + expected = {'QT_SELECT': 'qt5'} |
elopio
Jun 10, 2016
Member
no test for qt4? You can make one test, with two subTests:
https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests
kyrofa
Jun 11, 2016
Member
Ah ha! I was totally intending to do this and apparently forgot, thank you. Fixed.
|
I don't see a test for the unsupported qt version error. |
No, I'm getting that on master as well. |
Good catch, I added one.
Ah, thank you I forgot about actually adding them to demos tests-- done. We'll see if they work! Regarding the xvfb tests, I created a bug for you |
kyrofa
added some commits
Jun 13, 2016
|
testtools.matchers._impl.MismatchError: !=: |
|
Should be fixed now. We have a lot of tests that test |
|
File a bug so we leave only one. |
sergiusens
reviewed
Jun 14, 2016
| @@ -0,0 +1,59 @@ | ||
| +/**************************************************************************** | ||
| +** | ||
| +** Copyright (C) 2015 The Qt Company Ltd. |
|
Please update the branch |
Done. If I have to update the |
|
retest this please |
|
I just added support for a list of project files (Will Cooke needed it). Waiting to hear back regarding his testing. |
kyrofa
added some commits
Jun 15, 2016
kyrofa
reviewed
Jun 16, 2016
| + library_path = _get_library_paths( | ||
| + 'LIBRARY_PATH', root, arch_triplet, prepend='', sep=':') | ||
| + if library_path: | ||
| + env.append(library_path) |
kyrofa
Jun 16, 2016
Member
@sergiusens @elopio may I draw your attention here. qmake only seems to respect these flags instead of the gcc ones. I had to put them here because I didn't want to duplicate the _get_*_paths() logic in the plugin, and that logic is not public. Is this okay? Or should we make those functions part of the public API?
lpotter
commented
Jun 16, 2016
|
Is there support for specifying arguments for CONFIG ? I am needing to be able to do this with a couple of snaps I am working on. |
8none1
commented
Jun 17, 2016
|
Confirming that this qmake plugin has successfully built my project. Thanks! |
kyrofa
added some commits
Jun 24, 2016
kyrofa
reviewed
Jun 24, 2016
| + def _extra_config(self): | ||
| + extra_config = [] | ||
| + | ||
| + for root in [self.installdir, self.project.stage_dir]: |
kyrofa
Jun 24, 2016
Member
@sergiusens @elopio here's the side effect of moving this into the plugin: the plugin doesn't know whether or not it's a root part or a dependent part, so it needs to look in both installdir and stagedir for libs/includes. Do either of you see a downside to doing this?
sergiusens
Jun 24, 2016
Collaborator
should be mostly fine as this is what we do in the machinery already. Just need to make sure installdir is preferred over stagedir.
|
Alright, this is ready for another look. |
sergiusens
reviewed
Jun 24, 2016
| + | ||
| +def format_path_variable(envvar, paths, prepend, separator): | ||
| + if not paths: | ||
| + return '' |
sergiusens
Jun 24, 2016
Collaborator
So in the uses of format_path_variable I see you always check for path, so instead wouldn't it be better here to raise a ValueError?
kyrofa
Jun 24, 2016
Member
Ah, yeah good catch. Honestly though I don't think we need to check it at all here-- if the caller asked to format an environment variable out of the paths, they should probably know that the paths are good, otherwise there's nothing reasonable to return. If you want ValueError raised though, that's fine too.
sergiusens
Jun 24, 2016
Collaborator
El 24/06/16 a las 14:49, Kyle Fazzari escribió:
In snapcraft/internal/common.py
ubuntu-core#566 (comment):
os.path.join(root, 'usr', 'lib'),os.path.join(root, 'lib', arch_triplet),os.path.join(root, 'usr', 'lib', arch_triplet),- ]
- return [p for p in paths if os.path.exists(p)]
+def combine_paths(paths, prepend, separator):
- paths = ['{}{}'.format(prepend, p) for p in paths]
- return separator.join(paths)
+def format_path_variable(envvar, paths, prepend, separator):
- if not paths:
return ''Ah, yeah good catch. Honestly though I don't think we need to check it
at all here-- if the caller asked to format an environment variable out
of the paths, they should probably know that the paths are good,
otherwise there's nothing reasonable to return. If you want ValueError
raised though, that's fine too.
There's nothing wrong with raising a nice exception so the user of the
API can fix fast ;-)
|
ok @kyrofa, good stuff, just a comment on a check going on. |
Very good-- fixed. |
kyrofa commentedJun 10, 2016
This PR resolves LP: #1574774 with a new qmake plugin. It also adds a qt4 and qt5 demo to make use of it.