When installing Meson, distutils may choose to put shim scripts in the
`PATH` that only set up the egg requirements before launching the real
`meson.py` contained in the egg.
This means that `__file__` points to the real `meson.py` file, but
launching it directly is doomed to fail as it's missing the metadata
contained in the shim to set up the path egg, resulting in errors when
trying to import the `mesonbuild` module.
A similar issue affects Meson when installed as a zipapp, with the
current code going great lengths to figure out how to relaunch itself.
Using `argv[0]` avoids these issues as it gives us the way the current
executable has been launched, so we are pretty much guaranteed that
using it will create another instance of the same executable. We only
need to resolve relative paths as the current working directory may
get changed before re-launching the script, and using `realpath()` for
that saves us the trouble of manually resolving links and getting caught
in endless loops.
This also mean that `meson_script_file` no longer necessarily point to a
absolute file, so rename it to `_launcher` which hopefully would be less
prone to inducing false assumptions.
the pkgconfig module automatically specified to install the
pkgconfig file to {libdir}/pkgconfig. Default settings in meson
already include multiarch-directories like x86_64-gnu-linux into
the libdir. pkgconfig usually does not check inside multiarch-dirs
for any pkgconfig-files.
to make this a bit more flexible, this commit introduces the
install_dir attribute for pkgconfig.generate. if it is set, the
default install path will be overridden by the users input
This makes the following changes:
* Explicitly closes the file for force flushing (this fixes an issue on which the last 2 or 3 lines weren't being written to disk)
* Adds another check on the PBXBuildFile stage to get the file name if the returned source type is a File instead of a string
Fixes issue #337
When building against software that is being built uninstalled,
pkg-config returns values from the -uninstalled.pc variant which
might contain .la files as --libs.
This patch opens the .la files to figure out where the actual shared
library are.
Some part of this is inspired by what is done in the
gobject-introspection giscanner/utils.py code
Addition (+), subtraction (-), multiplication (*) and division (/) for numbers
follows the BIDMAS rules.
Strings and arrays can be concatenated with the addition operator
Strings can be concatenated with numbers with the addition operator