~cmiller/+junk/kodi-snap

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os

import snapcraft
from snapcraft.plugins import autotools

class FakeAutotoolsPlugin(autotools.AutotoolsPlugin):
    def build(self):

        print(self.installdir)
        assert self.installdir

        ## skip over parent class
        snapcraft.BasePlugin.build(self)

        configure_command = ['./configure']
        make_install_command = ['make', 'install']

        if self.install_via_destdir:
            # Use an empty prefix since we'll install via DESTDIR
            configure_command.append('--prefix=')
            make_install_command.append('DESTDIR=' + self.installdir)
        else:
            configure_command.append('--prefix=' + self.installdir)

        self.run(configure_command + self.options.configflags)
        self.run(['make', '-j{}'.format(self.project.parallel_build_count)])
        self.run(make_install_command)