Meson simplification (#27)
* meson: simplify pkg-config generation
* meson: simplify version configuring
Most of these variables do not need to be created at all, as they're
never used.
* meson: rename variables that are holdovers from another project
xreader => cmenu
Also the gir does not need to be saved to a variable as it is not being
pulled in as a target to anything.
Eli Schwartz authored 4 years ago
Clement Lefebvre committed 4 years ago
libmenu/libcinnamon-menu-3.0-uninstalled.pc.in
less
more
0 | |
prefix=@prefix@
|
1 | |
exec_prefix=@exec_prefix@
|
2 | |
libdir=@libdir@
|
3 | |
includedir=@includedir@
|
4 | |
|
5 | |
Name: libcinnamon-menu
|
6 | |
Description: Desktop Menu Specification Implementation
|
7 | |
Requires: gio-unix-2.0
|
8 | |
Version: @VERSION@
|
9 | |
Libs: ${pc_top_builddir}/${pcfiledir}/libcinnamon-menu-3.la
|
10 | |
Cflags: -I${pc_top_builddir}/${pcfiledir}
|
libmenu/libcinnamon-menu-3.0.pc.in
less
more
0 | |
prefix=@prefix@
|
1 | |
exec_prefix=@exec_prefix@
|
2 | |
libdir=@libdir@
|
3 | |
includedir=@includedir@
|
4 | |
|
5 | |
Name: libcinnamon-menu
|
6 | |
Description: Desktop Menu Specification Implementation
|
7 | |
Requires: gio-unix-2.0
|
8 | |
Version: @VERSION@
|
9 | |
Libs: -L${libdir} -lcinnamon-menu-3
|
10 | |
Cflags: -I${includedir}/cinnamon-menus-3.0
|
52 | 52 |
subdir: 'cinnamon-menus-3.0'
|
53 | 53 |
)
|
54 | 54 |
|
55 | |
pc_conf = configuration_data()
|
56 | |
pc_conf.set('prefix', prefix)
|
57 | |
pc_conf.set('exec_prefix', '${prefix}')
|
58 | |
pc_conf.set('libdir', join_paths('${prefix}', libdir))
|
59 | |
pc_conf.set('includedir', join_paths('${prefix}', includedir))
|
60 | |
pc_conf.set('VERSION', version)
|
|
55 |
pkgconfig = import('pkgconfig')
|
61 | 56 |
|
62 | |
pc = configure_file(
|
63 | |
input: 'libcinnamon-menu-3.0.pc.in',
|
64 | |
output: 'libcinnamon-menu-3.0.pc',
|
65 | |
configuration: pc_conf,
|
66 | |
install: true,
|
67 | |
install_dir: join_paths(libdir, 'pkgconfig'),
|
|
57 |
# meson 0.46.0 can drop the version keyword and move libraries to a
|
|
58 |
# positional argument
|
|
59 |
pkgconfig.generate(
|
|
60 |
name: 'libcinnamon-menu-3.0',
|
|
61 |
description: 'Desktop Menu Specification Implementation',
|
|
62 |
version: version,
|
|
63 |
libraries: libcinnamon_menus,
|
|
64 |
subdirs: 'cinnamon-menus-3.0'
|
68 | 65 |
)
|
69 | 66 |
|
70 | |
libdocument_gir = gnome.generate_gir(
|
|
67 |
gnome.generate_gir(
|
71 | 68 |
libcinnamon_menus,
|
72 | 69 |
namespace: 'CMenu',
|
73 | 70 |
nsversion: '3.0',
|
0 | |
project('cinnamon-menus', 'c', version : '4.0.0')
|
|
0 |
project('cinnamon-menus', 'c', version : '4.0.0', meson_version: '>=0.40.0')
|
1 | 1 |
|
2 | 2 |
gnome = import('gnome')
|
3 | 3 |
|
4 | 4 |
version = meson.project_version()
|
5 | |
version_list = version.split('.')
|
6 | |
major_version = version_list[0]
|
7 | |
minor_version = version_list[1]
|
8 | |
micro_version = version_list[2]
|
9 | 5 |
|
10 | 6 |
binary_version = '0.0.1'
|
11 | 7 |
binary_major_version = binary_version.split('.')[0]
|
12 | 8 |
|
13 | |
xreader_conf = configuration_data()
|
14 | |
xreader_conf.set_quoted('PACKAGE', meson.project_name())
|
|
9 |
cmenu_conf = configuration_data()
|
|
10 |
cmenu_conf.set_quoted('PACKAGE', meson.project_name())
|
15 | 11 |
|
16 | 12 |
# directories
|
17 | 13 |
prefix = get_option('prefix')
|
|
22 | 18 |
# generate config.h
|
23 | 19 |
config_h_file = configure_file(
|
24 | 20 |
output : 'config.h',
|
25 | |
configuration : xreader_conf
|
|
21 |
configuration : cmenu_conf
|
26 | 22 |
)
|
27 | 23 |
|
28 | 24 |
config_h = declare_dependency(
|