diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2019-09-28 11:04:37 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2019-09-28 11:04:37 +0200 |
commit | d28031cb786107c8a4400008ee2e41635ddea992 (patch) | |
tree | d001bc3f1e4a7da3f0c875300b534de0566d9af2 /util/mm-common-get.in | |
parent | 532d7a4218b43859db36b12b3a87e59ffb90a1f6 (diff) | |
download | mm-common-d28031cb786107c8a4400008ee2e41635ddea992.tar.gz |
Support modules that are built with Meson
* configure.ac:
* Makefile.am:
* meson.build: Install files from util/build_scripts/.
Configure mm-common-get and mm-common-get.1.
* README: Describe the new files.
* util/build_scripts/*.py:
* util/mm-common-get.1.in:
* util/mm-common-get.in: New files for modules built with Meson.
* util/mm-common-prepare.1.in:
* util/mm-common-prepare.in: Mention that these are used for modules built
with Autotools.
See MR !2
Diffstat (limited to 'util/mm-common-get.in')
-rw-r--r-- | util/mm-common-get.in | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/util/mm-common-get.in b/util/mm-common-get.in new file mode 100644 index 0000000..e0b28f0 --- /dev/null +++ b/util/mm-common-get.in @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2019 The gtkmm Development Team +# +# @configure_input@ +# +# mm-common is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 2 of the License, +# or (at your option) any later version. +# +# mm-common is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with mm-common. If not, see <http://www.gnu.org/licenses/>. + +import sys +import os +import argparse +import shutil +import filecmp + +pkgdatadir = os.path.join('@datadir_py@', '@PACKAGE_TARNAME@') +progname = os.path.basename(sys.argv[0]) + +parser = argparse.ArgumentParser( + description='Copy files from mm-common to a C++ binding module that uses Meson') +parser.add_argument('--version', action='version', version='%(prog)s @PACKAGE_VERSION@') +parser.add_argument('-f', '--force', help='replace existing files', action='store_true') +parser.add_argument('buildscript_dir', help='where to store build scripts') +parser.add_argument('doctool_dir', help='where to store doc tool files') +args = parser.parse_args() + +forceflag = args.force +buildscriptdir = args.buildscript_dir +doctooldir = args.doctool_dir + +print(progname + ': putting Meson build scripts in ' + buildscriptdir) +# Create the destination directory, if it does not exist. +os.makedirs(buildscriptdir, exist_ok=True) +for file in ['dist-build-scripts.py', 'dist-changelog.py', 'doc-reference.py', 'generate-binding.py']: + src_file = os.path.join(pkgdatadir, 'build', file) + dest_file = os.path.join(buildscriptdir, file) + # Don't update the timestamp of dest_file, if it's equal to src_file. + # if file-does-not-exist or (force and files-are-not-equal) + if (not os.path.isfile(dest_file)) or (forceflag and (not filecmp.cmp(src_file, dest_file))): + print(progname + ': copying file ' + file) + # shutil.copy() does not copy timestamps. + shutil.copy(src_file, dest_file) + +print(progname + ': putting documentation utilities in ' + doctooldir) +os.makedirs(doctooldir, exist_ok=True) +for file in ['doc-install.pl', 'doc-postprocess.pl', + 'doxygen.css', 'doxygen-extra.css', 'tagfile-to-devhelp2.xsl']: + src_file = os.path.join(pkgdatadir, 'doctool', file) + dest_file = os.path.join(doctooldir, file) + if (not os.path.isfile(dest_file)) or (forceflag and (not filecmp.cmp(src_file, dest_file))): + print(progname + ': copying file ' + file) + shutil.copy(src_file, dest_file) |