aboutsummaryrefslogtreecommitdiff
blob: b076eaa39c45db8e78663ae17466c0a2fb97a684 (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
py_bins = [
    'ebuild',
    'egencache',
    'emerge',
    'emirrordist',
    'glsa-check',
    'gpkg-sign',
    'portageq',
    'quickpkg'
]

other_bins = [
    'emerge-webrsync'
]

py_sbins = [
    'archive-conf',
    'dispatch-conf',
    'emaint',
    'env-update',
    'fixpackages',
    'regenworld'
]

etc_update = 'etc-update'

if eprefix != ''
    etc_update = configure_file(
        input : etc_update,
        output : 'etc-update',
        command : hprefixify,
        capture : true
    )
endif

# It might seem sensible to use py.install_sources() to install the Python
# scripts, but it's really just a wrapper around install_data that forces the
# install_dir. Meson 1.2.0 and later also optimize to bytecode, but Gentoo does
# this in the ebuild.

install_data(
    py_bins,
    install_dir : system_wide ? get_option('bindir') : portage_bindir,
    install_mode : 'rwxr-xr-x',
)

install_data(
    other_bins,
    install_dir : get_option('bindir'),
    install_mode : 'rwxr-xr-x',
)

install_data(
    py_sbins,
    install_dir : system_wide ? get_option('sbindir') : portage_bindir,
    install_mode : 'rwxr-xr-x',
)

install_data(
    [etc_update],
    install_dir : system_wide ? get_option('sbindir') : get_option('bindir'),
    install_mode : 'rwxr-xr-x',
)

# Note that exclude_files is currently broken in meson-python, but it should
# work soon. Having duplicates here isn't that bad in the meantime.
# https://github.com/mesonbuild/meson-python/issues/317

install_subdir(
    '.',
    exclude_files : py_bins + other_bins + py_sbins + ['etc-update', 'meson.build'],
    install_dir : portage_bindir
)