~larryprice/libertine/snapcraft-remove-empty-plugs

« back to all changes in this revision

Viewing changes to parts/plugins/x-libertine.py

  • Committer: Larry Price
  • Date: 2016-12-07 19:05:37 UTC
  • mfrom: (302.2.46 devel)
  • Revision ID: larry.price@canonical.com-20161207190537-46vubww9vcfx8l1x
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
 
2
#
 
3
# Copyright (C) 2016 Canonical Ltd
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
 
 
18
import snapcraft.plugins.cmake
 
19
import utils # local
 
20
 
 
21
class LibertinePlugin(snapcraft.plugins.cmake.CMakePlugin):
 
22
    def __init__(self, name, options, project):
 
23
        super().__init__(name, options, project)
 
24
 
 
25
        deps = utils.BuildDependsParser()
 
26
 
 
27
        with open('debian/control') as control:
 
28
            for line in control.readlines():
 
29
                deps.parse(line)
 
30
 
 
31
        self.build_packages.extend(deps.deps)
 
32
        self.options.configflags.extend(['-DCMAKE_INSTALL_PREFIX=/usr'])
 
33
 
 
34
    @classmethod
 
35
    def schema(cls):
 
36
        return super().schema()
 
37
 
 
38
    def enable_cross_compilation(self):
 
39
        return super().enable_cross_compilation()
 
40
 
 
41
    def build(self):
 
42
        super().build()
 
43
 
 
44
        # Fix all shebangs to use the in-snap python.
 
45
        utils.fix_shebangs(self.installdir + '/usr/bin')