meson: Cleanup build files

Remove some twice declared variables and keep code style
This commit is contained in:
Rafał Dzięgiel
2021-09-08 20:44:12 +02:00
parent b5007d12a1
commit 6cddb1a16d
6 changed files with 81 additions and 85 deletions

View File

@@ -9,21 +9,21 @@ foreach id_postfix : clapper_apps
bin_conf.set('PACKAGE_VERSION', meson.project_version()) bin_conf.set('PACKAGE_VERSION', meson.project_version())
bin_conf.set('ID_POSTFIX', id_postfix) bin_conf.set('ID_POSTFIX', id_postfix)
bin_conf.set('prefix', get_option('prefix')) bin_conf.set('prefix', get_option('prefix'))
bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) bin_conf.set('libdir', libdir)
bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) bin_conf.set('datadir', datadir)
configure_file( configure_file(
input: 'com.github.rafostar.Clapper.in', input: 'com.github.rafostar.Clapper.in',
output: 'com.github.rafostar.Clapper' + app_postfix, output: 'com.github.rafostar.Clapper' + app_postfix,
configuration: bin_conf, configuration: bin_conf,
install: true, install: true,
install_dir: get_option('bindir'), install_dir: bindir,
install_mode: 'rwxr-xr-x' install_mode: 'rwxr-xr-x'
) )
endforeach endforeach
clapper_symlink_cmd = 'ln -fs @0@ $DESTDIR@1@'.format( clapper_symlink_cmd = 'ln -fs @0@ $DESTDIR@1@'.format(
'com.github.rafostar.Clapper', 'com.github.rafostar.Clapper',
join_paths(get_option('prefix'), get_option('bindir'), 'clapper') join_paths(bindir, 'clapper')
) )
meson.add_install_script('sh', '-c', clapper_symlink_cmd) meson.add_install_script('sh', '-c', clapper_symlink_cmd)

View File

@@ -1,4 +1,3 @@
sharedir = join_paths(get_option('prefix'), 'share')
iconsdir = join_paths(sharedir, 'icons', 'hicolor') iconsdir = join_paths(sharedir, 'icons', 'hicolor')
appstream_util = find_program('appstream-util', required: false) appstream_util = find_program('appstream-util', required: false)
@@ -16,16 +15,16 @@ install_data('com.github.rafostar.Clapper-symbolic.svg',
install_dir: join_paths(iconsdir, 'symbolic', 'apps') install_dir: join_paths(iconsdir, 'symbolic', 'apps')
) )
install_data('com.github.rafostar.Clapper.gschema.xml', install_data('com.github.rafostar.Clapper.gschema.xml',
install_dir: join_paths(sharedir, 'glib-2.0', 'schemas') install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
) )
install_data('com.github.rafostar.Clapper.xml', install_data('com.github.rafostar.Clapper.xml',
install_dir: join_paths(sharedir, 'mime', 'packages') install_dir: join_paths(datadir, 'mime', 'packages')
) )
install_data('com.github.rafostar.Clapper.desktop', install_data('com.github.rafostar.Clapper.desktop',
install_dir: join_paths(sharedir, 'applications') install_dir: join_paths(datadir, 'applications')
) )
install_data('com.github.rafostar.Clapper.metainfo.xml', install_data('com.github.rafostar.Clapper.metainfo.xml',
install_dir: join_paths(sharedir, 'metainfo') install_dir: join_paths(datadir, 'metainfo')
) )
gnome.compile_resources('com.github.rafostar.Clapper.data', gnome.compile_resources('com.github.rafostar.Clapper.data',
'com.github.rafostar.Clapper.data.gresource.xml', 'com.github.rafostar.Clapper.data.gresource.xml',

View File

@@ -83,7 +83,7 @@ gstclapper = library('gstclapper-' + api_version,
include_directories: [configinc, libsinc], include_directories: [configinc, libsinc],
version: libversion, version: libversion,
install: true, install: true,
install_dir : clapper_libdir, install_dir: pkglibdir,
dependencies: [gtk4_dep, glib_dep, gio_dep, dependencies: [gtk4_dep, glib_dep, gio_dep,
gstbase_dep, gstvideo_dep, gstaudio_dep, gstbase_dep, gstvideo_dep, gstaudio_dep,
gsttag_dep, gstpbutils_dep, libm] + gtk_deps, gsttag_dep, gstpbutils_dep, libm] + gtk_deps,
@@ -99,7 +99,7 @@ clapper_gir = gnome.generate_gir(gstclapper,
includes: ['Gst-1.0', 'GstPbutils-1.0', 'GstBase-1.0', 'GstVideo-1.0', includes: ['Gst-1.0', 'GstPbutils-1.0', 'GstBase-1.0', 'GstVideo-1.0',
'GstAudio-1.0', 'GstTag-1.0'], 'GstAudio-1.0', 'GstTag-1.0'],
install: true, install: true,
install_dir_typelib : join_paths(clapper_libdir, 'girepository-1.0'), install_dir_typelib: join_paths(pkglibdir, 'girepository-1.0'),
extra_args: gir_init_section + ['-DGST_USE_UNSTABLE_API'], extra_args: gir_init_section + ['-DGST_USE_UNSTABLE_API'],
dependencies: [gstbase_dep, gstvideo_dep, gstaudio_dep, dependencies: [gstbase_dep, gstvideo_dep, gstaudio_dep,
gsttag_dep, gstpbutils_dep] gsttag_dep, gstpbutils_dep]

8
lib/meson.build vendored
View File

@@ -7,10 +7,6 @@ libversion = meson.project_version()
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp') cxx = meson.get_compiler('cpp')
clapper_libdir = join_paths(
get_option('prefix'), get_option('libdir'), meson.project_name()
)
cdata = configuration_data() cdata = configuration_data()
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
@@ -142,7 +138,7 @@ cdata.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/Rafostar/clapper/issue
cdata.set_quoted('PACKAGE_NAME', 'GStreamer Clapper Libs') cdata.set_quoted('PACKAGE_NAME', 'GStreamer Clapper Libs')
cdata.set_quoted('GST_API_VERSION', api_version) cdata.set_quoted('GST_API_VERSION', api_version)
cdata.set_quoted('GST_LICENSE', 'LGPL') cdata.set_quoted('GST_LICENSE', 'LGPL')
cdata.set_quoted('LIBDIR', clapper_libdir) cdata.set_quoted('LIBDIR', pkglibdir)
cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
warning_flags = [ warning_flags = [
@@ -259,9 +255,7 @@ cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', 'Unknown')
configinc = include_directories('.') configinc = include_directories('.')
libsinc = include_directories('gst') libsinc = include_directories('gst')
gnome = import('gnome')
gir = find_program('g-ir-scanner', required: true) gir = find_program('g-ir-scanner', required: true)
if not gir.found() if not gir.found()
error('Clapper requires GI bindings to be compiled') error('Clapper requires GI bindings to be compiled')
endif endif

View File

@@ -11,13 +11,13 @@ project('com.github.rafostar.Clapper', 'c', 'cpp',
gnome = import('gnome') gnome = import('gnome')
i18n = import('i18n') i18n = import('i18n')
python = import('python') python = import('python')
python_bin = python.find_installation('python3')
pkgdatadir = join_paths(get_option('datadir'), meson.project_name()) bindir = join_paths(get_option('prefix'), get_option('bindir'))
libdir = join_paths(get_option('prefix'), get_option('libdir'))
datadir = join_paths(get_option('prefix'), get_option('datadir'))
if not python_bin.found() pkglibdir = join_paths(libdir, meson.project_name())
error('No valid python3 binary found') pkgdatadir = join_paths(datadir, meson.project_name())
endif
if get_option('clapper-lib') if get_option('clapper-lib')
subdir('lib') subdir('lib')
@@ -28,11 +28,14 @@ if get_option('clapper-player')
subdir('data') subdir('data')
subdir('po') subdir('po')
installdir = join_paths(get_option('prefix'), 'share', meson.project_name()) install_subdir('src', install_dir: pkgdatadir)
install_subdir('src', install_dir : installdir) install_subdir('extras', install_dir: pkgdatadir)
install_subdir('extras', install_dir : installdir) install_subdir('css', install_dir: pkgdatadir)
install_subdir('css', install_dir : installdir) install_subdir('ui', install_dir: pkgdatadir)
install_subdir('ui', install_dir : installdir)
python_bin = python.find_installation('python3')
if not python_bin.found()
error('No valid python3 binary found')
endif
meson.add_install_script('build-aux/meson/postinstall.py') meson.add_install_script('build-aux/meson/postinstall.py')
endif endif