summaryrefslogtreecommitdiff
path: root/recipes/gobject-introspection.recipe
blob: f83c92145c55d34cc3c02146e44632be2e0a1e5c (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
 # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import sys


class Recipe(recipe.Recipe):

    name = 'gobject-introspection'
    version = '1.54.1'
    stype = SourceType.TARBALL
    maj_ver = '.'.join(version.split('.')[0:2])
    url = 'https://download.gnome.org/sources/{0}/{1}/{0}-{2}.tar.xz'.format(name, maj_ver, version)
    tarball_checksum = 'b88ded5e5f064ab58a93aadecd6d58db2ec9d970648534c63807d4f9a7bb877e'
    licenses = [License.GPLv2Plus]
    autoreconf = True
    autoreconf_sh = 'gtkdocize && autoreconf -vfi'
    configure_options = '--with-python=python3'
    deps = ['glib']
    patches = [name + '/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch']

    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):
        # 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/python3 %s" % self.config_sh

    # 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()