From 51db84750ece4de58923d4ce43cb0638ef150f5f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 7 Jul 2018 10:29:48 -0400 Subject: Add meson.build files to build with meson Provide both build systems in parallel for now, to ensure that we work out all the differences between the two. Some time from now, we'll give up on autotools. Meson tends to be faster and probably easier to read/maintain. On my machine, the full meson configure+build+install takes a little under half as long as a similar autotools-based invocation. Building with meson is a two step process. First, configure the build: meson build Then, compile the project: ninja -C build There's some mild differences in functionality between meson and autotools. specifically: 1) No singular update-po target. meson only generates individual update-po targets for each textdomain (of which we have 3). To make this easier, there's a build-aux/update-po script which finds all update-po targets and runs them. 2) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution. --- scripts/libmakepkg/integrity/meson.build | 20 +++++++++++++++ scripts/libmakepkg/lint_config/meson.build | 18 ++++++++++++++ scripts/libmakepkg/lint_package/meson.build | 20 +++++++++++++++ scripts/libmakepkg/lint_pkgbuild/meson.build | 37 ++++++++++++++++++++++++++++ scripts/libmakepkg/meson.build | 31 +++++++++++++++++++++++ scripts/libmakepkg/source/meson.build | 22 +++++++++++++++++ scripts/libmakepkg/tidy/meson.build | 23 +++++++++++++++++ scripts/libmakepkg/util/meson.build | 24 ++++++++++++++++++ 8 files changed, 195 insertions(+) create mode 100644 scripts/libmakepkg/integrity/meson.build create mode 100644 scripts/libmakepkg/lint_config/meson.build create mode 100644 scripts/libmakepkg/lint_package/meson.build create mode 100644 scripts/libmakepkg/lint_pkgbuild/meson.build create mode 100644 scripts/libmakepkg/meson.build create mode 100644 scripts/libmakepkg/source/meson.build create mode 100644 scripts/libmakepkg/tidy/meson.build create mode 100644 scripts/libmakepkg/util/meson.build (limited to 'scripts/libmakepkg') diff --git a/scripts/libmakepkg/integrity/meson.build b/scripts/libmakepkg/integrity/meson.build new file mode 100644 index 00000000..9aa9061c --- /dev/null +++ b/scripts/libmakepkg/integrity/meson.build @@ -0,0 +1,20 @@ +libmakepkg_module = 'integrity' + +sources = [ + 'generate_checksum.sh.in', + 'generate_signature.sh.in', + 'verify_checksum.sh.in', + 'verify_signature.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/lint_config/meson.build b/scripts/libmakepkg/lint_config/meson.build new file mode 100644 index 00000000..884d63d7 --- /dev/null +++ b/scripts/libmakepkg/lint_config/meson.build @@ -0,0 +1,18 @@ +libmakepkg_module = 'lint_config' + +sources = [ + 'paths.sh.in', + 'variable.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/lint_package/meson.build b/scripts/libmakepkg/lint_package/meson.build new file mode 100644 index 00000000..8eb1aaf7 --- /dev/null +++ b/scripts/libmakepkg/lint_package/meson.build @@ -0,0 +1,20 @@ +libmakepkg_module = 'lint_package' + +sources = [ + 'build_references.sh.in', + 'dotfiles.sh.in', + 'file_names.sh.in', + 'missing_backup.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/lint_pkgbuild/meson.build b/scripts/libmakepkg/lint_pkgbuild/meson.build new file mode 100644 index 00000000..9067c9d6 --- /dev/null +++ b/scripts/libmakepkg/lint_pkgbuild/meson.build @@ -0,0 +1,37 @@ +libmakepkg_module = 'lint_pkgbuild' + +sources = [ + 'arch.sh.in', + 'backup.sh.in', + 'changelog.sh.in', + 'checkdepends.sh.in', + 'conflicts.sh.in', + 'depends.sh.in', + 'epoch.sh.in', + 'install.sh.in', + 'makedepends.sh.in', + 'optdepends.sh.in', + 'options.sh.in', + 'package_function.sh.in', + 'pkgbase.sh.in', + 'pkglist.sh.in', + 'pkgname.sh.in', + 'pkgrel.sh.in', + 'pkgver.sh.in', + 'provides.sh.in', + 'source.sh.in', + 'util.sh.in', + 'variable.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/meson.build b/scripts/libmakepkg/meson.build new file mode 100644 index 00000000..07475b4d --- /dev/null +++ b/scripts/libmakepkg/meson.build @@ -0,0 +1,31 @@ +libmakepkg_modules = [ + { 'name' : 'integrity', 'has_subdir' : true }, + { 'name' : 'lint_config', 'has_subdir' : true }, + { 'name' : 'lint_package', 'has_subdir' : true }, + { 'name' : 'lint_pkgbuild', 'has_subdir' : true }, + { 'name' : 'source', 'has_subdir' : true }, + { 'name' : 'srcinfo', }, + { 'name' : 'tidy', 'has_subdir' : true }, + { 'name' : 'util', 'has_subdir' : true }, +] + +mkdir_p = 'mkdir -p $DESTDIR/@0@' + +foreach module : libmakepkg_modules + custom_target( + 'libmakepkg_@0@'.format(module['name']), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : '@0@.sh.in'.format(module['name']), + output : '@BASENAME@', + install : true, + install_dir : join_paths(get_option('datadir'), 'makepkg')) + + if module.get('has_subdir', false) + subdir(module['name']) + path = join_paths(get_option('prefix'), + get_option('datadir'), + 'makepkg', + module['name']) + meson.add_install_script('sh', '-c', mkdir_p.format(path)) + endif +endforeach diff --git a/scripts/libmakepkg/source/meson.build b/scripts/libmakepkg/source/meson.build new file mode 100644 index 00000000..59326133 --- /dev/null +++ b/scripts/libmakepkg/source/meson.build @@ -0,0 +1,22 @@ +libmakepkg_module = 'source' + +sources = [ + 'bzr.sh.in', + 'file.sh.in', + 'git.sh.in', + 'hg.sh.in', + 'local.sh.in', + 'svn.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/tidy/meson.build b/scripts/libmakepkg/tidy/meson.build new file mode 100644 index 00000000..052ac7a2 --- /dev/null +++ b/scripts/libmakepkg/tidy/meson.build @@ -0,0 +1,23 @@ +libmakepkg_module = 'tidy' + +sources = [ + 'docs.sh.in', + 'emptydirs.sh.in', + 'libtool.sh.in', + 'purge.sh.in', + 'staticlibs.sh.in', + 'strip.sh.in', + 'zipman.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach diff --git a/scripts/libmakepkg/util/meson.build b/scripts/libmakepkg/util/meson.build new file mode 100644 index 00000000..b0e829c4 --- /dev/null +++ b/scripts/libmakepkg/util/meson.build @@ -0,0 +1,24 @@ +libmakepkg_module = 'util' + +sources = [ + 'compress.sh.in', + 'error.sh.in', + 'message.sh.in', + 'option.sh.in', + 'parseopts.sh.in', + 'pkgbuild.sh.in', + 'source.sh.in', + 'util.sh.in', +] + +foreach src : sources + output_dir = join_paths(get_option('datadir'), 'makepkg', libmakepkg_module) + + custom_target( + libmakepkg_module + '_' + src.underscorify(), + command : [ SCRIPT_EDITOR, '@INPUT@', '@OUTPUT@' ], + input : src, + output : '@BASENAME@', + install : true, + install_dir : output_dir) +endforeach -- cgit v1.2.3-70-g09d2