Commit Graph

189 Commits

Author SHA1 Message Date
Patrick Griffis c42167dc6f gnome.gtkdoc(): Include builddir variant of include dirs also
This avoids the need for users to constantly join paths themselves
as this is commonly included.
2016-12-12 21:01:49 +02:00
Nirbheek Chauhan 60716fcd6d Use universal_newlines=True for all Popen calls
Instead of adding it everywhere manually, create a wrapper called
mesonlib.Popen_safe and use that everywhere that we call an executable
and extract its output.

This will also allow us to tweak it to do more/different things if
needed for some locales and/or systems.

Closes #1079
2016-12-11 01:59:58 +02:00
Jussi Pakkanen d1501e39d5 Merge pull request #1086 from Keruspe/master
Allow specifying some toolchain executables using env
2016-12-06 23:43:36 +02:00
Jussi Pakkanen c58da4ee52 Merge pull request #1151 from mesonbuild/tingping/gtk-doc
gnome: Various improvements to gtkdoc
2016-12-06 23:27:41 +02:00
Patrick Griffis e265887ac3 gnome.gtkdoc(): Add keyword to override the mode
I'm not entirely sure if you ever want to mix and match but
I can say that glib required none of them to be passed so
this allows for that.
2016-12-06 14:07:45 -05:00
Nirbheek Chauhan b9a7c0cf39 misc: Use relative imports everywhere
Using 'mesonbuild' as the module can cause it to use the
system-installed module and can also break if we rename the directory,
so avoid that by always using relative imports.
2016-12-07 00:24:17 +05:30
Patrick Griffis 155617e539 i18n: Improve language handling
- Fix LINGUAS changes not being picked up
- Fix multiple langs per line in LINGUAS
- Make empty languages acceptable

Fixes #1127
2016-12-06 20:29:20 +02:00
Patrick Griffis d764c7dc91 gnome.gtkdoc(): Add namespace keyword 2016-12-06 13:23:58 -05:00
Patrick Griffis a626d1a7bc gnome.gtkdoc(): Allow passing multiple source dirs
This is valid and used by glib for example.
2016-12-06 12:23:29 -05:00
Patrick Griffis 9b560c29b6 gnome.gtkdoc(): Fix including doc source dir in path 2016-12-06 10:58:18 -05:00
Marc-Antoine Perennou a70f39f815 allow overriding nm with NM
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-12-05 10:57:10 +01:00
Marc-Antoine Perennou 4d3cce1532 allow overriding readelf with READELF
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-12-05 10:57:10 +01:00
Jussi Pakkanen c7ddce163f All testing is now in mesontest.py, which simplifies a lot of stuff. 2016-11-18 22:10:22 +02:00
Jussi Pakkanen 39df22bf53 Made Meson test into a class rather than abusing global variables and as preparation for moving it elsewhere. 2016-11-18 22:08:07 +02:00
Jussi Pakkanen 077741097a Run all tests if none are specified. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen def68cbc50 Use the same code for tests and benchmarks. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen 951262d759 Removed Valgrind from core. 2016-11-18 22:04:29 +02:00
Jussi Pakkanen ee90ce74e8 New test runner. 2016-11-18 22:04:29 +02:00
Elliott Sales de Andrade 155f163341 Use portable path separator in wrappers.
The semicolon only separates paths on Windows, but the wrapper is
sometimes used on other platforms.
2016-11-13 12:39:03 -05:00
Olexa Bilaniuk 05e217caa5 Fixed SyntaxError in itstool invocation in yelphelper.py during
installation.

During a `python3.4 setup.py install`, the yelphelper.py script errors
out with: "SyntaxError: can use starred expression only as assignment
target". Fix this problem.
2016-11-12 13:06:16 -05:00
Nirbheek Chauhan 55288b0fcc scripts/gtkdochelper: ignore_headers is a list
Also, only add it if it's defined.

Closes #1020
2016-11-12 11:54:13 -05:00
Nirbheek Chauhan 52eab4b006 vs backend: coredata.meson_script_file was renamed 2016-11-10 00:40:16 +05:30
Jussi Pakkanen f7431fd5db Can specify scan-build executable with an environment variable. Closes #1015. 2016-11-09 10:26:27 -05:00
Nirbheek Chauhan a2262103fb Implement mlog.warning and use it everywhere for warnings
Prepends the string with 'WARNING:' in ANSI yellow.

Closes https://github.com/mesonbuild/meson/issues/961
2016-11-08 17:43:24 -05:00
Patrick Griffis 314eb5110e gettext: Use argparse to handle arguments 2016-11-02 13:54:57 -07:00
Emmanuele Bassi e226d702bc gtkdoc: Add `ignore_headers` positional argument
Not all headers are public, or contain public types. GTK-Doc allows
adding headers to be ignored during the "scan" phase, by passing the
`--ignore-headers` command line argument to gtkdoc-scan.

Currently, you can do something like:

  ignored_headers = [ 'foo-private.h', 'bar-private.h', ]

  gnome.gtkdoc(...
               scan_args: [
                 '--ignore-headers=' + ' '.join(ignored_headers),
               ],
               ...)

But it does not guarantee escaping rules and it's definitely not nice.

We can add a simpler version of that mechanism through a new positional
argument, `ignore_headers`, which behaves like `content_files` or
`html_assets`, and takes an array of header files to ignore:

  gnome.gtkdoc(...
               ignore_headers: ignored_headers,
               ...)
2016-11-01 14:11:48 +00:00
Emmanuele Bassi 6eeecb8585 gtkdochelper: Add 'overrides.txt' to the content files
If a `<modulename>-overrides.txt` file exists in the docs directory it
means it's intended to be used in place of the one gtk-doc generates.

GLib and GTK+, for instance, ship with one because some of the types
they provide — like the thread primitives, or the platform macros —
contain architecture-dependent fields that should not be accessed
directly.

This commit should close the last bit of issue #550.
2016-11-01 14:10:56 +00:00
Aurelien Jarno caa1ef6318 Fix depfixer on MIPS. 2016-10-24 12:14:42 -07:00
Patrick Griffis 423c8dbb40 gettext: Add update-po target
For each project this creates a <project>-update-po target.
When ran this updates the pot file and then merges it back
into the po files in the source directory with `msgmerge`
for project maintainers and translators.

Fixes #819
2016-10-23 08:46:48 -07:00
Patrick Griffis 1781129740 gnome: Add yelp() function
Fixes #881
Mentioned in #295
2016-10-19 18:44:19 -04:00
Patrick Griffis 44690763b0 gnome: Include build dir in gtkdoc-mkhtml path 2016-10-19 21:16:29 +03:00
Hemmo Nieminen c4fabc8ecf Don't mention non-existing log files after testing. 2016-10-19 01:08:54 +03:00
Patrick Griffis f30be6fb92 gettext: Add ability to set GETTEXTDATADIRS
Some projects use this to allow using local its files
2016-10-16 17:54:16 +03:00
Jussi Pakkanen 1f4cce86ad Remove shebangs on files that are not runnable and add execute bits to those that are. 2016-10-07 21:10:33 +03:00
Thibault Saunier bb3823e6f4 gnome: Allow specifying gtkdoc where to install directory 2016-09-26 15:25:59 -03:00
Thibault Saunier f86fbf6ebf gnome: Run gtkdoc-scanobjs and add a way to get assets working
Allowing the object tree to be generated.

We need to add options to allow copying the ncesseary sources and
assets so the HTML generator can work with them (everything is
relative so we need to copy them in the build directory).

Until now the documentation was not generated from the user provided
main sgml file but it was using a generated one, which lead to a broken
documentation. Starting using it revealed the other bugs fixed in that
commit.
2016-09-26 15:25:59 -03:00
Tim-Philipp Müller 5ebc77f722 i18n: use POTFILES.in as fallback if there's no POTFILES in po dir
In autotools POTFILES is generated at configure time from POTFILES.in,
but Meson only looks for a po/POTFILES in the source directory, which
is awkward when trying to maintain both build systems in parallel.
Instead just use POTFILES.in as fallback if it exists but POTFILES
does not. Also print an error if neither exists.

Fixes #818
2016-09-25 20:06:02 +01:00
Thibault Saunier a2e7ebc575 Add a new 'environment' object to be used to build test environment (#781)
Allowing user to fine tune tests environment variables
2016-09-14 23:11:27 +03:00
Thibault Saunier 5d30ea99ea meson_test: Add env variables to the test logs file (#767)
So users can more easily reproduce the test without the
launcher
2016-09-08 21:50:19 +03:00
Jussi Pakkanen 3f62fb788b Remove unneeded shebang line that was triggering some linters. 2016-09-07 22:06:33 +03:00
Jussi Pakkanen cdf0c4f1a9 Merge branch 'QuLogic-context-managers' 2016-09-01 23:12:06 +03:00
Elliott Sales de Andrade 38a2a636b5 Refactor DESTDIR determination into a single function. 2016-08-27 23:07:59 -04:00
Elliott Sales de Andrade 3a593d0aca Always obey DESTDIR even with absolute install_dir.
Passing an absolute path to `install_dir` would previously always
attempt to install there, instead of obeying DESTDIR, since os.path.join
will 'reset' on absolute paths.
2016-08-27 23:07:59 -04:00
Elliott Sales de Andrade fe0aa7daff Convert depfixer.Elf class into a context manager.
This allows for automatic closing of its internal file handle.
2016-08-27 18:29:56 -04:00
Elliott Sales de Andrade 4c71695e41 Use context manager for file I/O.
There are a few cases where a context manager cannot be used, such as
the logger.
2016-08-27 18:29:55 -04:00
Elliott Sales de Andrade b7757189e4 Echo stderr from captured command.
This helps with debugging if the command fails.
2016-08-26 20:46:42 -04:00
Elliott Sales de Andrade 70d94a5550 Allow capturing command output of a custom target.
For commands that always output to stdout and don't have a "-o" or
"--output" or some other similar option, this 'capture' setting allows
the build to capture the result and place it in the output file.
2016-08-26 20:46:42 -04:00
Jussi Pakkanen 3671c40a4b Handle both DT_RPATH as well as DT_RUNPATH when fixing rpath settings. 2016-08-04 21:31:40 +03:00
Nirbheek Chauhan 042e0b3467 gtkdochelper: Add error checking and printing
This helps debug why things are failing
2016-07-24 13:48:12 +05:30
Nirbheek Chauhan 69d9c2228d vs: Fix Meson invocation while doing regen (#646)
The Meson script is not always in $scriptdir/../../ -- for instance if
installed with pip on Windows, the scriptdir is in:

C:/Python35/Lib/site-packages/meson-0.33.0.dev1-py3.5.egg/mesonbuild/scripts

and the meson.py script is in:

C:/Python35/Scripts

So, let's save the path available as Environment().meson_script_file
into the coredata.dat private file and use that to invoke Meson when
doing regen.

Also, let's fetch the backend that was used from the coredata too
instead of hard-coding vs2010.

Both these were causing a hard failure while doing regen with msbuild or
visual studio.
2016-07-19 00:00:17 +03:00
Jussi Pakkanen 64919b1c74 Merge pull request #417 from nirbheek/dll-paths
Fix filenames and paths used in DLL shared library generation
2016-07-13 22:18:50 +03:00
Jussi Pakkanen 38a896ae51 Create a log file of all files installed. 2016-07-12 13:43:49 +03:00
Nirbheek Chauhan 598997bdb5 scripts/install: Also strip '\' from the end of a path
Fixes installation of subdirs on Windows
2016-07-01 20:50:47 +05:30
Nirbheek Chauhan b2fb4f9d66 scripts: Use destdir_join fix for all DESTDIR prefixing (#598) 2016-06-16 20:43:23 +03:00
Hemmo Nieminen 30bbcded23 meson_test: Fix a bug in valgrind argument handling.
Do not modify the wrap command argument from the calling function.
Appending the valgrind arguments to the wrap list argument will cause all
the valgrind arguments to cumulate from all the tests to the wrapper
command itself.
2016-06-06 10:28:00 +03:00
Jussi Pakkanen 205037047f Try to delete target files before installing. Closes #578. 2016-06-05 14:16:01 +03:00
Jussi Pakkanen 0482635c12 Handle case of install_subdirring a subdir. 2016-05-30 23:08:24 +03:00
Jussi Pakkanen beb6827413 Installing subdirs now merges with existing files in the target dir. 2016-05-30 21:48:03 +03:00
Jussi Pakkanen 9dace5fc5e Always initialise final_command. 2016-05-28 23:14:34 +03:00
Jussi Pakkanen aac7f6ef1f Since we only care about shebang line and sane ones use plain ASCII, use an encoding that can not fail. Closes #561. 2016-05-28 23:04:15 +03:00
Jussi Pakkanen 1b78e354a6 Join windows-style destdir paths correctly. Closes #567. 2016-05-28 14:13:01 +03:00
Jussi Pakkanen 3b3c05f6b1 Can pass extra args to xgettext. Closes #554. 2016-05-26 01:09:37 +03:00
Jussi Pakkanen f3fa6c02a7 Merge pull request #556 from ebassi/gtkdoc-fixref
Support passing extra arguments to gtkdoc-fixxref
2016-05-25 18:00:15 +03:00
Jussi Pakkanen babdb27570 Merge pull request #479 from mesonbuild/i18n
Moved gettext into i18n module.
2016-05-25 17:53:35 +03:00
Emmanuele Bassi 8998e44cd9 Support passing extra arguments to gtkdoc-fixxref
The extra arguments are typically used to specified the location of
installed API references that gtk-doc can use to create cross links
for symbols.

Fixes #555
2016-05-25 11:36:33 +01:00
Jussi Pakkanen 1a0938cc25 Automagic scan-build support. 2016-05-22 19:24:59 +03:00
Jussi Pakkanen dc148e0702 Remove all special casing for gettext and use elementary operations instead. 2016-05-21 18:21:23 +03:00
Jussi Pakkanen 2e2df70dd0 Merge branch 'centricular-customtarget-path-windows' 2016-05-01 18:39:45 +03:00
Minijackson cab1c3f2bf Fix argv count requirement in delwithsuffix.py script 2016-04-28 14:10:34 +02:00
Nirbheek Chauhan ed774a68c6 scripts/meson_exe: prepend extra_paths to PATH instead of appending
This way locally-built DLLs and EXEs are preferred over system-wide ones
2016-04-18 22:51:24 +05:30
Nirbheek Chauhan e3bc2e5c68 ninja: Set PATH for CustomTargets with built EXEs on Windows
When a CustomTarget is run with a command that is an executable built
by the project which also has a DLL built in the same project as a
dependency, the EXE can't run on Windows because the DLL can't be found.
On UNIX-like systems, we set the RPATH using the linker so these
dependencies can be found, but on Windows the only way is to set the
PATH environment variable.

The same problem exists for tests, so we reuse that infrastructure by
creating a new meson_exe.py script that can be used as a wrapper to run
CustomTarget commands on Windows. This can later also be extended to add
support for setting an environment while calling the command needed to
generate a CustomTarget: https://github.com/mesonbuild/meson/issues/266
2016-04-15 05:49:42 +05:30
trhd a76693f338 Fix a bug (typo) seen when printing the logs from failed tests. (#513) 2016-04-14 07:49:46 +03:00
Jussi Pakkanen cab5ce4fc0 Merge pull request #438 from trhd/testing_options
New options for controlling test output.
2016-04-06 23:10:20 +03:00
Jussi Pakkanen ea092fefc2 Use individual tempdirs for building and installing in unit tests. 2016-04-01 20:20:48 +03:00
Hemmo Nieminen 5764bee2f4 meson_test: Don't print logs from failing tests that are expected to fail. 2016-04-01 00:51:12 +03:00
Hemmo Nieminen 297749581d meson_test: Add support for --print-errorlogs option.
This option can be used to control whether the logs from failing tests
should be shown to the user after the tests have been executed.
2016-04-01 00:51:12 +03:00
Hemmo Nieminen f2868420ca meson_test: Add support for --no-stdsplit option. 2016-04-01 00:51:12 +03:00
Hemmo Nieminen 457ecb6be7 meson_test: Move "options" to a global variable. 2016-04-01 00:51:12 +03:00
Jussi Pakkanen 67377e69b5 Invoke depfixer in-process to make it faster. Closes #480. 2016-03-30 22:09:36 +03:00
Nirbheek Chauhan d5c9b98cab meson_install.py: Start by checking if the shebang is directly runnable
If it's just runnable as-is, then we don't need to do fancy basename detection
and such to find the interpretor to use for running the script.
2016-03-17 16:16:35 +05:30
Nicolas Schneider 40a7287a59 vs2010: properly check whether solution needs to be regenerated 2016-02-25 23:13:29 +01:00
Nirbheek Chauhan a15e784851 meson_install: os.symlink may be implemented and still not work
Requires Administrator access by default to work
2016-02-20 14:28:28 +02:00
Jussi Pakkanen 091b782e43 Prevent state leaks when running tests in-process. 2016-02-17 23:27:18 +02:00
Jussi Pakkanen edd61dcf81 When killing a frozen process, take all its children with it. Closes #377. 2016-02-14 22:11:48 +02:00
Jussi Pakkanen 58d7db4a6c Some windows fixes. 2016-01-23 17:45:01 +02:00
Jussi Pakkanen b91134b806 Better error message when failing to run install script. Closes #361. 2016-01-23 13:24:30 +02:00
Jussi Pakkanen 84456537da Fix some issues that break pypi installs and bump version to upload new version. 2016-01-16 20:59:34 +02:00
Jussi Pakkanen d6e176f455 Made gtkdoc and run targets work. 2016-01-16 18:04:59 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00