meson.build 3.63 KB
Newer Older
1
project('gnome-music',
Jean Felder's avatar
Jean Felder committed
2
    version: '3.33.2',
Marinus Schraal's avatar
Marinus Schraal committed
3
    meson_version: '>= 0.46.0'
4 5 6 7 8
)

# Importing modules
gnome = import('gnome')
i18n  = import('i18n')
9 10 11 12
python = import('python')

# Module objects
py_installation = python.find_installation('python3')
13 14

# Make sure Python is installed and found
15
if not py_installation.found()
16 17 18 19 20
    error('No valid python3 binary found')
endif

# Constants
PACKAGE_URL = 'https://wiki.gnome.org/Apps/Music'
21
PACKAGE_URL_BUG = 'https://gitlab.gnome.org/GNOME/gnome-music/issues'
22
PROJECT_RDNN_NAME = 'org.gnome.Music'
23

24 25 26 27 28 29 30 31 32 33
# NAME_SUFFIX is used in the about dialog
if get_option('profile') == 'development'
  PROFILE = 'Devel'
  NAME_SUFFIX = ' (Development Snapshot)'
else
  PROFILE = ''
  NAME_SUFFIX = ''
endif

APPLICATION_ID = 'org.gnome.Music@0@'.format(PROFILE)
34
PYTHON_DIR = py_installation.get_path('purelib')
35 36
PKGDATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), APPLICATION_ID)
PKGLIB_DIR = join_paths(get_option('prefix'), get_option('libdir'), APPLICATION_ID)
37 38

# Dependencies
39
dependency('goa-1.0')
40
dependency('gobject-introspection-1.0', version: '>= 1.35.0')
41
dependency('gtk+-3.0', version: '>= 3.24.7')
42
dependency('libdazzle-1.0', version: '>= 3.28.0')
43
dependency('libmediaart-2.0', version: '>= 1.9.1')
44
dependency('libsoup-2.4')
45
dependency('tracker-sparql-2.0', version: '>= 1.99.1')
46
dependency('pygobject-3.0', version: '>= 3.29.1')
47
dependency('py3cairo', version: '>= 1.14.0')
48
dependency('grilo-0.3', version: '>= 0.3.8')
49
dependency('grilo-plugins-0.3', version: '>= 0.3.8')
50 51 52 53 54 55 56 57 58 59 60

subproject('libgd',
    default_options: [
        'with-introspection=true',
        'with-main-view=true',
        'with-tagged-entry=true',
        'static=false',
        'pkgdatadir=' + PKGDATA_DIR,
        'pkglibdir=' + PKGLIB_DIR
    ])

Marinus Schraal's avatar
Marinus Schraal committed
61 62 63 64 65 66
subproject('gfm',
    default_options: [
        'pkgdatadir=' + PKGDATA_DIR,
        'pkglibdir=' + PKGLIB_DIR
    ])

67
subdir('data/ui')
68 69 70 71 72 73
subdir('data')
subdir('help')
subdir('po')

install_subdir(
    'gnomemusic',
74
    install_dir: py_installation.get_install_dir()
75 76 77 78
)

# Install the executable file
bin_config = configuration_data()
79
bin_config.set('application_id', APPLICATION_ID)
80 81 82 83
bin_config.set('rdnn_name', PROJECT_RDNN_NAME)
bin_config.set('pkgdatadir', PKGDATA_DIR)
bin_config.set('localedir', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
bin_config.set('pythondir', PYTHON_DIR)
84
bin_config.set('pyexecdir', py_installation.get_path('stdlib'))
85
bin_config.set('schemasdir', PKGDATA_DIR)
Marinus Schraal's avatar
Marinus Schraal committed
86
# Used for libgd/gfm
87
bin_config.set('pkglibdir', PKGLIB_DIR)
88
bin_config.set('gfmlibdir', '')
89 90 91 92 93 94 95 96 97 98 99 100

bin_config.set('local_build', 'False')

configure_file(
    input: 'gnome-music.in',
    output: 'gnome-music',
    configuration: bin_config,
    install_dir: get_option('bindir')
)

# Install the builddir executable
local_config = configuration_data()
101
local_config.set('application_id', APPLICATION_ID)
102 103 104 105 106 107
local_config.set('rdnn_name', PROJECT_RDNN_NAME)
local_config.set('pkgdatadir', join_paths(meson.build_root(), 'data'))
local_config.set('localedir', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
local_config.set('pythondir', meson.source_root())
local_config.set('pyexecdir', meson.source_root())
local_config.set('schemasdir', join_paths(meson.build_root(), 'data'))
Marinus Schraal's avatar
Marinus Schraal committed
108
# Used for libgd/gfm
109
local_config.set('pkglibdir', join_paths(meson.build_root(), 'subprojects', 'libgd', 'libgd'))
Marinus Schraal's avatar
Marinus Schraal committed
110
local_config.set('gfmlibdir', join_paths(meson.build_root(), 'subprojects', 'gfm'))
111 112 113 114 115 116 117 118 119 120

local_config.set('local_build', 'True')

configure_file(
    input: 'gnome-music.in',
    output: 'local-music',
    configuration: local_config
)

meson.add_postconf_script('meson_post_conf.py')
121
meson.add_install_script('meson_post_install.py')