aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/gtkdochelper.py
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy1-3/+2
2019-08-04gtkdoc: Use find_program() to get gtkdoc toolsXavier Claessens1-14/+19
This will allow using gtk-doc as a subproject instead of having to install it on the system. It also has the side effect of failing at configuration time with a proper message if gtkdoc is not installed, instead of failing at build time with a python backtrace.
2019-04-25Don't use len() to test for container emptinessDylan Baker1-7/+7
I ran the numbers once before (it's in the meson history) but it's *much* faster to *not* use len for testing if a container is empty or not.
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-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-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-06-26gtkdoc: Use generated types file if there is oneXavier Claessens1-0/+5
Closes: #3773.
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-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-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.
2018-04-02gtkdochelper: print warningsSébastien Wilmet1-0/+2
The GTK-Doc commands output was never printed, except in case of error. So there was no way to see the warnings. https://github.com/mesonbuild/meson/issues/2396
2018-01-07gtkdochelper: Set LD_LIBRARY_PATH from -Wl,-rpath argumentsTing-Wei Lan1-3/+15
gnome.gtkdoc uses -Wl,-rpath to ensure the scanner executable built by gtkdoc-scangobj will load shared libraries from the correct directories. However, FreeBSD configures its linker to use --enable-new-dtags by default, which converts RPATH to RUNPATH. If users have LD_LIBRARY_PATH environment variable set, RUNPATH will be overrided by LD_LIBRARY_PATH and libraries will be loaded from wrong directories, causing undefined symbol error when running the executable. In order to solve the problem, we have to prepend directories specified with -Wl,-rpath to LD_LIBRARY_PATH to avoid relying on the deprecated RPATH attribute.
2017-11-07gtkdoc: Pass the linker down to gtkdoc-scangobjXavier Claessens1-1/+2
Closes #2540
2017-07-17gnome.gtkdoc: Handle absolute install_dirs correctlyNirbheek Chauhan1-3/+5
Must prepend DESTDIR in case it's absolute. Also document that by default it is relative to the gtk-doc html directory.
2017-05-28Add mkdb_args support to gnome.gtkdoc()Emmanuele Bassi1-1/+10
There are cases where we need to specify arguments to gtkdoc-mkdb, like telling it to scan extensions that are not '.h' and '.c'. Let's add a new named argument to gnome.gtkdoc(), as well as the plumbing needed for the gtk-doc helper script.
2017-04-13gtkdochelper: Fix type file name optionRafael Fontenelle1-1/+1
'gtkdoc-scangobj' script was recently ported to Python (it was Perl), and it now requires providing '--type' option to specify the name of the file to store the types in. Without this option, 'gtkdockelper' will exit with error status 2 and will throw a message "gtkdoc-scangobj: error: unrecognized arguments: <typefile>"
2017-01-11style: [E303] too many blank lines (2)Mike Sinkovsky1-1/+0
2017-01-01style: fix E128 violationsIgor Gnatenko1-1/+3
E128: continuation line under-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18remove shebangs from scriptsIgor Gnatenko1-1/+0
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/regen_checker.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_test.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_benchmark.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_exe.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/symbolextractor.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/commandrunner.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/gtkdochelper.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_install.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/depfixer.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/dirchanger.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/delwithsuffix.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/vcstagger.py 644 /usr/bin/python3 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-12gnome.gtkdoc(): Include builddir variant of include dirs alsoPatrick Griffis1-1/+9
This avoids the need for users to constantly join paths themselves as this is commonly included.
2016-12-11Use universal_newlines=True for all Popen callsNirbheek Chauhan1-8/+6
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-06Merge pull request #1151 from mesonbuild/tingping/gtk-docJussi Pakkanen1-14/+34
gnome: Various improvements to gtkdoc
2016-12-06gnome.gtkdoc(): Add keyword to override the modePatrick Griffis1-7/+24
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-07misc: Use relative imports everywhereNirbheek Chauhan1-2/+2
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-06gnome.gtkdoc(): Add namespace keywordPatrick Griffis1-2/+6
2016-12-06gnome.gtkdoc(): Allow passing multiple source dirsPatrick Griffis1-7/+6
This is valid and used by glib for example.
2016-12-06gnome.gtkdoc(): Fix including doc source dir in pathPatrick Griffis1-1/+1
2016-11-12scripts/gtkdochelper: ignore_headers is a listNirbheek Chauhan1-4/+5
Also, only add it if it's defined. Closes #1020
2016-11-01gtkdoc: Add `ignore_headers` positional argumentEmmanuele Bassi1-3/+6
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-01gtkdochelper: Add 'overrides.txt' to the content filesEmmanuele Bassi1-0/+4
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-10-19gnome: Include build dir in gtkdoc-mkhtml pathPatrick Griffis1-1/+1
2016-10-07Remove shebangs on files that are not runnable and add execute bits to those ↵Jussi Pakkanen1-0/+0
that are.
2016-09-26gnome: Allow specifying gtkdoc where to install directoryThibault Saunier1-1/+3
2016-09-26gnome: Run gtkdoc-scanobjs and add a way to get assets workingThibault Saunier1-17/+67
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-07-24gtkdochelper: Add error checking and printingNirbheek Chauhan1-13/+23
This helps debug why things are failing
2016-06-16scripts: Use destdir_join fix for all DESTDIR prefixing (#598)Nirbheek Chauhan1-4/+3
2016-05-25Support passing extra arguments to gtkdoc-fixxrefEmmanuele Bassi1-3/+9
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-01-16Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen1-0/+122
in the same toplevel dir.