aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
AgeCommit message (Collapse)AuthorFilesLines
2019-04-03Read file as utf8 on python3jonathan MERCIER1-3/+5
2019-04-01Also format headers with Clang-Format. Closes #5184.Jussi Pakkanen1-0/+1
2019-03-28gettext: prefer POTFILES.in if it existsEli Schwartz1-2/+2
If POTFILES.in exists, then it will have come from autotools, in which case it is explicitly the file passed to xgettext -f, and the POTFILES file itself is generated by autotools as a proxy file which eventually gets inlined into the final Makefile as a variable "POTFILES = ......" In this case, attempting to use POTFILES as the input file will simply result in syntax errors and the inability to find files with a literal trailing " \" in the name. Usually POTFILES will not exist at all, and we would fallback on POTFILES.in, but if the source tree happens to be dirty, this would result in errors. Since it's never going to be right to use it, we can just do the right thing from the start and carry on.
2019-01-30dist: Handle git worktrees, which have a .git file instead of dirDylan Baker1-1/+2
This is the second most straight forward stupid way of handling this (with usiing os.path.exists) as the most stupid obvious way. The only major advantage is that having .git as something other than a file or directory still doesn't register. Fixes: #3378
2018-12-30Add a clang-format target.Jussi Pakkanen1-0/+37
2018-12-16coverage: Also remove source_root prefixesWilliam A. Kennington III1-0/+1
The code our projects care about verifying coverage for mostly lives in the source_root with the exception of the generated source files in build_root. This change cleans up the output so we don't have prefixed paths on our source files anymore.
2018-12-12Better Python exe detector. Closes #4614.Jussi Pakkanen1-1/+5
2018-12-02coverage: Print summary after gcovr html generationMohammed Sadiq1-1/+2
summary from stdout is often used by Automated builds to show build details The --print-summary option was added to gcovr in v3.2, since html output was added only in 3.1, limitting support to 3.2 won’t be a big deal. --print-summary is not enabled for text/xml report generation as it will result in meson not supporting any gcovr version less than 3.2.
2018-10-25depfixer: Do not try to fix rpaths of dllsMarvin Scholz1-0/+3
2018-10-24Fix flake8 'imported but unused' reportsJon Turney1-1/+0
$ flake8 | grep F401 ./mesonbuild/minstall.py:15:1: F401 'gzip' imported but unused ./mesonbuild/backend/backends.py:26:1: F401 '..compilers.get_macos_dylib_install_name' imported but unused ./mesonbuild/backend/backends.py:29:1: F401 'functools.lru_cache' imported but unused ./mesonbuild/scripts/dist.py:27:1: F401 'mesonbuild.dependencies.ExternalProgram' imported but unused
2018-10-14Do not try to remove duplicate RPATH entries on macOSDavid Seifert1-2/+23
2018-10-09coverage: fix lcov branch coverage generationMohammed Sadiq1-0/+3
lcov branch coverage are disabled by default. So branch coverage has to be enabled for every stage to make them work. Fixes https://github.com/mesonbuild/meson/issues/4319
2018-10-08scanbuild: Split SCANBUILD using shlexGuido Günther1-7/+14
This allows invocations like SCANBUILD="scan-build --status-bugs" ninja scan-build Closes: #4334
2018-10-04Make custom dist scripts accept arguments.Jan Tojnar1-10/+11
meson.add_dist_script, introduced in #3906, did not accept any arguments other than script name. Since all other meson.add_*_script methods do accept args, this makes the dist script accept them as well.
2018-10-04Fixed the lack of stdout being displayed when not in capture mode for ↵dx-mon1-0/+2
meson_exe (meson --internal exe)
2018-09-28Merge pull request #4261 from rossburton/crossJussi Pakkanen1-1/+1
WIP RFC gnome.py cross improvements
2018-09-28dist: Warn if there are uncommitted changes in the repositoryNirbheek Chauhan1-2/+18
Closes https://github.com/mesonbuild/meson/issues/1977
2018-09-28dist: Make usage of period in messages consistentNirbheek Chauhan1-10/+10
Having a period at the end of sentences in messages is confusing when a file or path is being outputted, and is inconsistent when not. This is part of an ongoing effort to fix this inconsistency across the message outputs everywhere in Meson.
2018-09-28gtkdochelper: show full command if it failsRoss Burton1-1/+1
Instead of showing just the command invoked, it's useful when debugging to also show all of the arguments.
2018-09-21gnome: add support for `module_version`Marco Trevisan (Treviño)1-3/+14
gtk-doc for autotools has the concept of module version, that is used to define the module install path and the devhelp2 basename. Add a `module_version` parameter to gnome.gtkdoc to replicate the same behavior. Updated the test checking that the install_dir is properly computed (if not passed), and that the .devhelp2 file has proper name. https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_29/buildsystems/autotools/gtk-doc.make#L269
2018-08-29Merge pull request #4016 from thiblahute/hotdocJussi Pakkanen1-0/+36
modules: Add an 'hotdoc' module
2018-08-28modules: Add an 'hotdoc' moduleThibault Saunier1-0/+36
hotdoc: http://github.com/hotdoc/hotdoc/
2018-08-27Add support for custom dist scripts.Jussi Pakkanen1-4/+25
2018-08-07gtkdoc: set PATH on Windows when executing gtkdoc-scangobj. Fixes #3307Christoph Reiter1-8/+15
The code was adding the library paths to LD_LIBRARY_PATH, but that doesn't work on Windows where they need to be added to PATH instead. Move the environ handling into gtkdoc_run_check() and add paths to PATH instead of LD_LIBRARY_PATH when on Windows. This fixes the gtk-doc build for glib on Windows (in case glib isn't installed already)
2018-07-31Merge pull request #3799 from rossburton/gtkdocJussi Pakkanen1-1/+4
scripts/gtkdochelper: add support for --run
2018-07-09scripts/gtkdochelper: add support for --runRoss Burton1-1/+4
gtkdoc-scangobj has a --run argument that specifies a wrapper to be used when executing the GObject scanner. Typically this can be libtool but it is also useful in cross-compilation environments. This patch adds support for this argument to the gtkdochelper so that tools using the helper can pass --run if required.
2018-07-09cross: Be more permissive about not-found exe_wrapperNirbheek Chauhan1-1/+5
We used to immediately try to use whatever exe_wrapper was defined in the cross file, but some people generate the cross file once and use it for several projects, most of which do not even need an exe wrapper to build. Now we're a bit more resilient. We quietly fall back to using non-exe-wrapper paths for compiler checks and skip the sanity check. However, if some code needs the exe wrapper, f.ex., if you run a built executable using custom_target() or run_target(), we will error out during setup. Tests will, of course, continue to error out when you run them if the exe wrapper was not found. We don't want people's tests to silently "pass" (aka skip) because of a bad CI setup. Closes https://github.com/mesonbuild/meson/issues/3562 This commit also adds a test for the behaviour of exe_wrapper in these cases, and refactors the unit tests a bit for it.
2018-07-09cross: Use ExternalProgram for cross-file exe_wrapperNirbheek Chauhan1-2/+4
We already have code to fetch and find binaries specified in a cross file, so use the same code for exe_wrapper. This allows us to handle the same corner-cases that were fixed for other cross binaries.
2018-07-03java: remove manifest classpath from installed jarNiclas Moeslund Overby1-0/+14
2018-06-26gtkdoc: Use generated types file if there is oneXavier Claessens1-0/+5
Closes: #3773.
2018-06-21Merge pull request #3590 from mesonbuild/testcommandJussi Pakkanen1-441/+0
Made install a top level Meson command.
2018-06-20gtkdochelper: pass CC to gtkdoc-scangobjRoss Burton1-0/+1
The helper is told what CC to use already, but doesn't pass it to gtkdoc-scangobj.
2018-06-18Made install a top level Meson command.Jussi Pakkanen1-441/+0
2018-06-18meson_install: Don't add DESTDIR to install_nameNirbheek Chauhan1-2/+1
This was added accidentally. Includes a test for it. Also fix a rebase error. The variable was defined incorrectly and was overwritten with the correct value immediately afterwards.
2018-06-18macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2-9/+14
On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
2018-06-18depfixer: Rewrite install_name for dylibs on installNirbheek Chauhan2-8/+18
The install name is used by consumers of the library to find the library at runtime. If it's @rpath/libfoo.dylib, all consumers must manually add the library path to RPATH, which is not what people expect. Almost everyone sets the library install name as the full path to the library, and this is done at install time with install_name_tool.
2018-06-17gtkdoc: Run gtkdoc-scangobj command from build directoryXavier Claessens1-2/+3
All paths in CFLAGS are relative to build_root, so current directory must be there we invoking gtkdoc-scangobj. Closes: #3379
2018-06-07gettext: Install .mo files atomicallyPhilip Chimento1-2/+4
Without this, building a module in a Flatpak app manifest that is a newer version of a module already present in the Flatpak runtime will fail. (The Flatpak file system is a bunch of hard links to readonly files, which can be replaced but not written to.) This instead creates a temporary file in the same directory as the destination (to avoid cross-device renaming errors) and atomically renames the temporary file to the destination, replacing it instead of rewriting it as shutil.copyfile() would do.
2018-06-06Fix issues found by flake8Xavier Claessens1-1/+1
2018-06-05Set WINEPATH when running serialized executablesNirbheek Chauhan1-0/+9
When the exe runner is `wine` or `wine32` or `wine64`, etc. This allows people to run tests with wine. Note that you also have to set WINEPATH to point to your custom prefix(es) if your tests use external dependencies. Closes https://github.com/mesonbuild/meson/issues/3620
2018-06-02Add 'install_mode' to all installable targetsFilipe Brandenburger1-11/+13
This makes it possible to customize permissions of all installable targets, such as executable(), libraries, man pages, header files and custom or generated targets. This is useful, for instance, to install setuid/setgid binaries, which was hard to accomplish without access to this attribute.
2018-06-01Set the meson command to use when we know what it isNirbheek Chauhan1-4/+2
Instead of using fragile guessing to figure out how to invoke meson, set the value when meson is run. Also rework how we pass of meson_script_launcher to regenchecker.py -- it wasn't even being used With this change, we only need to guess the meson path when running the tests, and in that case: 1. If MESON_EXE is set in the env, we know how to run meson for project tests. 2. MESON_EXE is not set, which means we run the configure in-process for project tests and need to guess what meson to run, so either - meson.py is found next to run_tests.py, or - meson, meson.py, or meson.exe is in PATH Otherwise, you can invoke meson in the following ways: 1. meson is installed, and mesonbuild is available in PYTHONPATH: - meson, meson.py, meson.exe from PATH - python3 -m mesonbuild.mesonmain - python3 /path/to/meson.py - meson is a shell wrapper to meson.real 2. meson is not installed, and is run from git: - Absolute path to meson.py - Relative path to meson.py - Symlink to meson.py All these are tested in test_meson_commands.py, except meson.exe since that involves building the meson msi and installing it.
2018-06-01Revert "commandrunner: make run handle python options"Filipe Brandenburger1-21/+3
This reverts commit ab599b5733539130db5c4d17c664744f4d5aacaf.
2018-05-30commandrunner: make run handle python optionsMartin Kelly1-3/+21
Currently, commandrunner breaks when we give options to python because it assumes python commands are in the form "python script.py", rather than "python -u script.py" or "python -u -m module script.py". Extend it to be more resilient and correctly parse python options.
2018-05-24depfixer: Run install_name_tool only once while deleting rpathsNirbheek Chauhan1-2/+5
2018-05-24depfixer: We no longer run this as a scriptNirbheek Chauhan1-13/+0
2018-05-18Print message when using polkitRyan Gonzalez1-0/+2
2018-05-18Fix #3579: Wait for a permissions failure before trying to run pkexecRyan Gonzalez1-13/+17
2018-05-17Support installation via polkitRyan Gonzalez1-17/+27
2018-05-06gnome.gtkdoc: Allow passing file objects as xml_filesNirbheek Chauhan1-3/+6
If we pass a source files() object, we will look for it in the build directory, which is wrong. If we pass a build files() object (from configure_file()), we will find it in the build directory, and then try to copy it on top of itself in gtkdochelper.py getting a SameFileError. Add a test for it, and also properly iterate custom target outputs when adding to content files.