summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* g-ir-compiler: Fix leaks in write_out_typelibDavid King2021-06-181-0/+2
| | | | | | Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938731
* Make test suite work with cross-related optionsJohn Ericson2021-05-232-7/+9
| | | | | | | | | | Because of skepticism I received in #224, I made this PR which keeps the testsuite and CI improvements but doesn't add any new build options. I hope this would be less controversial: - no new knobs - tests for those using existing build options - CI tests `build_introspection_data = false`
* Merge remote-tracking branch 'upstream/master' into find_program_overrideJohn Ericson2020-05-172-10/+4
|\
| * Remove old autoconf fallback code for the python tools.John Ericson2020-05-172-9/+3
| |
* | Don't override finding executables when using pre-built tools.John Ericson2020-04-271-4/+9
|/ | | | | | | | | | | | | | | Actually, we shouldn't really need this. We are building `native: false` binaries so when we look up a `native: true` binary the override should not apply. I've fixed this upstream in meson in https://github.com/NixOS/nixpkgs/pull/86080, though some backwards compatibility migration might be in order. In the meantime, we can make `gi_cross_use_host_gi` prevent the overrides from happening, which will achieve the desired behavior. Finally, this allows us to use `find_program` in `scanner_command`, unconditionally, letting the presence of the override dictate whether a freshly-built or pre-built `g-ir-scanner` is used.
* Windows: Fix building and running on Python 3.8+Chun-wei Fan2020-01-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Python 3.8.x and later changed the way how dependent DLLs can be found for a given Python module that depends on the presence of external, non-system DLLs, for more fine-grained DLLs searching and loading, as well as for security purposes, which required the use of os.add_dll_directory(). Thus, the scripts in scanner/ must be updated such that: -We are able to find and load the GObject and GLib DLLs, at least, on initialization, via the use of 'pkg-config --variable bindir', as we already depend on the GLib DLLs. Note that since the gobject-2.0.pc file does not have a 'bindir' entry, we use gio-2.0.pc instead to discover the bindir of the GObject and GLib DLLs. Likewise, we use the same technique for pkg-config files that are dependent upon when using g-ir-scanner (or friends) on items that are higher up in the stack. -We are able to find any other DLLs (e.g. non-GNOME DLLs such as ZLib) that are dependent but are not found in the path(s) given by 'pkg-config --variable bindir' with the envvar GI_EXTRA_BASE_DLL_DIRS, as needed. Note that GI_EXTRA_BASE_DLL_DIRS can be multiple paths, and that the results from 'pkg-config --variable bindir' takes precendence, in a LIFO manner.
* tools/meson: use the path from the python-module insteadHåvard Graff2019-11-101-1/+1
|
* meson: change "doctool" from a boolean to a feature optionChristoph Reiter2019-09-301-0/+2
| | | | | | | Similar to !180 this should prevent devs from not running all tests by accident. This also adds some checks for the required doctool dependencies, mako and markdown.
* Make meson.override_find_program working on more complex use casesThibault Saunier2019-08-152-1/+5
| | | | | | | Add some missing `meson.override_find_program` And make sure that the `.gir` we build are found when used uninstalled as a concequence of `meson.override_find_program`.
* meson: don't pass "install" to configure_file() unless really neededChristoph Reiter2019-07-261-1/+0
| | | | | | | | | | In our case it was never needed because it defaults to true if install_dir is set, which it always is for all calls. This avoids a warning when running with newer meson where it complains that install is only available with 0.50+. Fixes #298
* build: Force-include msvc_recommended_pragmas.h on Visual StudioChun-wei Fan2019-04-301-9/+6
| | | | | | | | | | By doing so, we essentially cover the various compiler flags that we want to use for non-Visual Studio builds to check for warnings that might cause real concern. This also skips the checks for the various GCC-isque CFlag checks that are scattered in the various build files on Visual Studio builds, since they are essentially meaningless on Visual Studio builds.
* meson: warn that not all tests will be run if building without cairo/doctoolChristoph Reiter2019-01-061-2/+2
|
* meson: port doctool testsChristoph Reiter2019-01-031-0/+3
|
* Add a --version option to g-ir-compiler and g-ir-generate. Fixes #55Christoph Reiter2018-12-192-0/+18
|
* meson: add default compiler warning flags and enable -Werror on CIChristoph Reiter2018-12-181-0/+12
| | | | | | | | This enables various compiler warnings project wide and disables the triggered ones for each library/executable. This should give us roughly the same behaviour as with autotools. Tested with gcc8 and clang7.
* meson: Always replace GIR_DIR in toolsEmmanuele Bassi2018-12-181-0/+1
| | | | Removes a warning on an unreplaced pattern.
* Drop all Python 2 compat codeChristoph Reiter2018-12-081-8/+1
| | | | We only support 3.4+ now.
* meson: add back /usr/bin/env to the python-cmd. Fixes #237Havard Graff2018-11-041-1/+1
| | | | | | | | | | | | | From nirbheek: "The shebang parsing goes like this: everything before the first space is the interpreter, everything after that is a single argument to that interpreter. So in meson, if the interpreter in the shebang is `env`, we ignore it and slurp the rest as the actual interpreter and parse it with shell syntax to handle spaces correctly. IIRC the py.exe python launcher on windows also knows that it should ignore /usr/bin/env and look at the rest to find the actual interpreter you want to use."
* g-ir-tools: respect gir_dir_prefixKai Kang2018-10-082-0/+11
| | | | | | | | | Configure option gir_dir_prefix is used to configure install dir for .gir files, so add its value to include file search paths. Fix for flake8 and meson-test at same time. Signed-off-by: Kai Kang <kai.kang@windriver.com>
* g-ir-tool: ask sysconfig instead of hardcoding the extension module suffixChristoph Reiter2018-08-211-4/+4
| | | | | MinGW Python doesn't use .pyd so this makes sure we always look for the file distutils produces for the given Python setup.
* g-ir-tool-template.in: Don't hardcode /usr/bin/envChun-wei Fan2018-08-212-3/+8
| | | | | | | | | | | | | | | For Visual Studio builds, it is likely that we specify a specific Python installation as there may well be multiple Python installations, but _giscanner.pyd gets tied to the particular Python DLL that it was built with. So, we cannot just use /usr/bin/env python3 in such a case on Visual Studio, but instead we use the full path to the Python executable in the shebang so that the correct Python installation is used, when running the installed scripts. This is necessary as Meson could bump the Python version it requires but _giscanner.pyd could not be used on the newer Python that is required due to differences in the Python version and the CRT Python itself is linked to, for instance. We continue to use /usr/bin/env python[2|3] for other builds.
* g-ir-tool-templates.in: Fix installed use on WindowsChun-wei Fan2018-08-201-1/+6
| | | | | | | The .so file extension for compiled C Python modules is only valid if we are not on Windows. Use .pyd for the extension for Python modules on Windows so that we can use g-ir-scanner et al properly on Windows when installed.
* build: enable -WshadowChristoph Reiter2018-07-291-1/+1
|
* g-ir-generate: fix missing error handling for command line parsingChristoph Reiter2018-07-291-1/+6
| | | | The error arg was used but the result never checked.
* meson: Provide our Python tools for builds. See !51Christoph Reiter2018-07-221-1/+4
| | | | So that meson projects using gi as a subproject can find them.
* meson: Just use python2/python3 in the tool shebang lineChristoph Reiter2018-07-201-1/+2
| | | | | So we end up using the same version as glib will be using. See glib!187.
* meson: Add a "python" option to make the python to build against configurableChristoph Reiter2018-07-111-2/+1
| | | | | | | | This allows us to build with Python 2 and run tests with it. This requires the new "python" meson module which was added in 0.46.0 so bump the required meson version (glib needs a newer one anyway). Also fixes a small test error under Python 2.
* Remove unused g-idl-offsets.plChristoph Reiter2018-06-231-258/+0
| | | | It's not used and not distributed. If someone needs it, it's in git.
* Remove unused define GIREPO_DEFAULT_SEARCH_PATH.Tomasz Miąsko2018-05-111-2/+0
|
* g-ir-tool-template: Add correct path to _giscanner.so on autotoolsRico Tzschichholz2018-03-101-1/+1
| | | | | This fixed make check and was a regression of 9b41d08057ed1ee2f4ce3a733413a8b2ad5a98d8
* Revert "meson: Handle spaces in the full python path"Nirbheek Chauhan2018-03-101-5/+0
| | | | | | | | | | This reverts commit f473d3b3ede94639f8d68fe618cc4cd287053181. This can cause Meson to run g-ir-scanner with the wrong python; for instance if you built gobject-introspection with a 64-bit Python but you have a 32-bit Python in your PATH. The correct fix is https://github.com/mesonbuild/meson/pull/2708.
* meson: Handle spaces in the full python pathNirbheek Chauhan2018-03-101-0/+5
| | | | | | If there is a space in the path to python, we cannot use it in the shebang since there is no way to quote spaces. Use the basename instead since we pass it to /usr/bin/env anyway.
* g-ir-scanner: Don't require SRCDIR and BUILDDIR env varsNirbheek Chauhan2018-03-101-12/+33
| | | | | | | | | | | | | When building with Meson, we cannot set environment variables while running custom targets and our builddir layout is different from Autotools anyway. Now g-ir-scanner and friends can autodetect when they're being run uninstalled by Meson and will find _giscanner.so and the giscanner python files in the build directory. This is very similar to what gdbus-codegen uses in glib/gio. Same for girepository/gdump.c.
* meson: Rewrite glib gir generationNirbheek Chauhan2018-03-101-1/+1
| | | | | | | | | | | | | | The previous build files had a bunch of problems: 1. It assumed that glib would only be sourced via pkg-config 2. It was using the system gobject-introspection-1.0.pc file while building GIRepository-1.0.gir 3. It wasn't ignoring the *-autocleanup.h headers properly Now you can build glib as a subproject and generate girs against the in-tree sources. This also yields more accurate girs because they document platform-specific features that are actually enabled in the glib build we are linking against.
* Initial work on meson portPatrick Griffis2018-03-102-0/+58
|
* g-ir-inspect: Ensure variables are at the top of blockChun-wei Fan2017-05-181-1/+2
| | | | | We did not yet advertise C99 requirements for G-I yet, so let's not assume this yet.
* g-ir-{compiler,generate,inspect}: Call setlocale in main functionTing-Wei Lan2017-05-053-0/+10
| | | | | | It is required to correctly show translated messages on some locales. https://bugzilla.gnome.org/show_bug.cgi?id=760419
* g-ir-inspect: make description for --version a bit betterIgor Gnatenko2016-08-171-1/+1
| | | | | | Reported-and-tested-by: Dominique Leuenberger <dimstar@opensuse.org> Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org> Reviewed-by: Colin Walters <walters@verbum.org>
* g-ir-inspect: remove last usage of g_autoptr()Igor Gnatenko2016-08-071-1/+2
| | | | | | Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=769600
* g-ir-inspect: Inspect GI typelibsIgor Gnatenko2016-04-291-0/+133
| | | | | | | | | | | | | | | | Various distributions (mainly RPM based so far) make use of automatic dependencies extracted from typelib files (they can require other typelibs and also shared libraries) Current features * Print used shared libraries * Print used typelib dependencies Based-on-patch-by: Dominique Leuenberger <dimstar@opensuse.org> Reference: https://bugzilla.gnome.org/show_bug.cgi?id=665672 Reviewed-by: Colin Walters <walters@verbum.org> Signed-off-by: Dominique Leuenberger <dimstar@opensuse.org> Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
* g-ir-tool-template: Fix a coding error that hooks up pdb in any buildMikhail Zabaluev2015-11-011-2/+2
| | | | | | | | | A condition was supposed to test if GI_SCANNER_DEBUG environment variable is unset or empty, but instead always evaluated to true. This results in any build pausing in pdb whenever an uncaught exception occurs in a g-ir-* tool. https://bugzilla.gnome.org/show_bug.cgi?id=757443
* tools: Windows-re-enable 'relocatability' for tool templateChun-wei Fan2015-10-281-2/+2
| | | | | | | | The transition to Python 3.x compatibility accidentily removed the 'relocatability' support that was added, so re-enable this support on Windows again. https://bugzilla.gnome.org/show_bug.cgi?id=757126
* g-ir-compiler: Allow multiple --shared-libraryGarrett Regier2015-09-291-4/+4
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=744535 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* giscanner: Use builtins module in Python 3Simon Feltman2015-09-291-2/+6
| | | | | | Add conditional import for Python 3's renamed builtins module. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use unicode literals in all Python filesSimon Feltman2015-09-291-0/+2
| | | | | | | | | | | | Add unicode_literals future import which turns any string literal into a unicode string. Return unicode strings from the Python C extension module. Force writing of annotations (g-ir-annotation-tool) to output utf8 encoded data to stdout. This is an initial pass at following the "unicode sandwich" model of programming (http://nedbatchelder.com/text/unipain.html) needed for supporting Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use print as a function for Python 3 compatibilitySimon Feltman2015-09-291-1/+2
| | | | | | | Use future import "print_function" and update relevant uses of print as a function call. See: PEP 3105 https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Enable "true division" for all Python filesSimon Feltman2015-09-291-0/+1
| | | | | | | | | | Import Python 3 compatible "true division" from the future (PEP 238). This changes the Python 2 classic division which uses floor division on integers to true division. Verfied we don't actually use the division operator anywhere in the code base so this a safety for supporting both Python 2 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use absolute_import for all Python filesSimon Feltman2015-09-291-1/+1
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* g-ir-compiler: message when arguments are wrongBen Boeckel2015-08-041-0/+9
| | | | | | | | Otherwise the error is "no input files" which is very confusing. https://bugzilla.gnome.org/show_bug.cgi?id=753160 Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
* tools: move verbump.py from tools to misc...Dieter Verfaillie2015-06-291-47/+0
| | | | ... so it lives next to the rest of the maintainer utilities.