summaryrefslogtreecommitdiff
path: root/recipes/gobject-introspection.recipe
blob: ce8191aa1ebcb354fdd164480aa5d9ba20df136b (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
 # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import sys


class Recipe(recipe.Recipe):

    name = 'gobject-introspection'
    version = '1.46.0'
    stype = SourceType.TARBALL
    url = 'http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.46/gobject-introspection-%(version)s.tar.xz'
    licenses = [License.GPLv2Plus]
    autoreconf = True
    autoreconf_sh = 'gtkdocize && autoreconf -vfi'
    deps = ['glib']

    files_bins = ['g-ir-annotation-tool', 'g-ir-compiler', 'g-ir-doc-tool', 'g-ir-generate', 'g-ir-scanner']
    files_libs = ['libgirepository-1.0']
    files_typelibs = ['cairo-1.0',
        'DBus-1.0',
        'DBusGLib-1.0',
        'fontconfig-2.0',
        'freetype2-2.0',
        'Gio-2.0',
        'GIRepository-2.0',
        'GL-1.0',
        'GLib-2.0',
        'GModule-2.0',
        'GObject-2.0',
        'libxml2-2.0',
        'win32-1.0',
        'xfixes-4.0',
        'xft-2.0',
        'xrandr-1.3',
        'xlib-2.0']
    files_gi = [
        'lib/gobject-introspection/giscanner/__init__.py',
        'lib/gobject-introspection/giscanner/_giscanner%(pext)s',
        'lib/gobject-introspection/giscanner/annotationmain.py',
        'lib/gobject-introspection/giscanner/annotationparser.py',
        'lib/gobject-introspection/giscanner/ast.py',
        'lib/gobject-introspection/giscanner/cachestore.py',
        'lib/gobject-introspection/giscanner/codegen.py',
        'lib/gobject-introspection/giscanner/collections/__init__.py',
        'lib/gobject-introspection/giscanner/collections/counter.py',
        'lib/gobject-introspection/giscanner/collections/ordereddict.py',
        'lib/gobject-introspection/giscanner/docmain.py',
        'lib/gobject-introspection/giscanner/docwriter.py',
        'lib/gobject-introspection/giscanner/dumper.py',
        'lib/gobject-introspection/giscanner/gdumpparser.py',
        'lib/gobject-introspection/giscanner/girparser.py',
        'lib/gobject-introspection/giscanner/girwriter.py',
        'lib/gobject-introspection/giscanner/introspectablepass.py',
        'lib/gobject-introspection/giscanner/libtoolimporter.py',
        'lib/gobject-introspection/giscanner/maintransformer.py',
        'lib/gobject-introspection/giscanner/message.py',
        'lib/gobject-introspection/giscanner/scannermain.py',
        'lib/gobject-introspection/giscanner/sectionparser.py',
        'lib/gobject-introspection/giscanner/shlibs.py',
        'lib/gobject-introspection/giscanner/sourcescanner.py',
        'lib/gobject-introspection/giscanner/testcodegen.py',
        'lib/gobject-introspection/giscanner/transformer.py',
        'lib/gobject-introspection/giscanner/utils.py',
        'lib/gobject-introspection/giscanner/xmlwriter.py'
    ]
    files_devel = [
        'include/gobject-introspection-1.0',
        'lib/pkgconfig/gobject-introspection-1.0.pc',
        'lib/pkgconfig/gobject-introspection-no-export-1.0.pc',
        'share/gobject-introspection-1.0'
    ]

    def prepare(self):
        if self.config.variants.python3:
            # cerbero is python2 only, same as gobject-introspection,
            # make sure gobject-introspection is built against the same interpretter
            # as we are
            self.config_sh = "PYTHON=%s %s" %(sys.executable, self.config_sh)
        # on arch python2 needs to be specified as the interpreter
        # the full path needs to be specified, since shebangs are generated
        if self.config.target_distro == Distro.ARCH:
            self.config_sh = "PYTHON=/usr/bin/python2 %s" % self.config_sh
        # on OSX specify which architecture we want
        if self.config.target_platform in [Platform.DARWIN]:
            self.new_env['ARCHFLAGS'] = '-arch %s' % self.config.target_arch

    # TODO: catch the share/man stuff like man1/g-ir* ?
    def configure(self):
        if self.config.target_platform in [Platform.IOS, Platform.DARWIN]:
            if Architecture.is_arm(self.config.target_arch):
                arch = 'arm'
            elif self.config.target_arch == Architecture.X86:
                arch = 'i386'
            else:
                arch = self.config.target_arch
            makefileam = os.path.join (self.build_dir, 'Makefile-gir.am')
            replacements = {'glib-2.0/include/glibconfig.h':
                    'glib-2.0/include/%s/glibconfig.h' % arch}
            shell.replace(makefileam, replacements)
        super(Recipe, self).configure()