gplugin/gplugin

Silence warnings from Python files

2021-09-29, Elliott Sales de Andrade
4a32fb36235b
Silence warnings from Python files

The `Python.h` header must be included first to appease the preprocessor.
Additionally, it includes ``, ``, ``, ``,
`` and ``, so we don't have to.

Also:

* Mark Python code as `ssize_t` clean
We don't use any `#` format variants, but it's best to define this for any future usage.

* Remove unused struct members from Python loader

* Simplify `gplugin_python3_filename_to_module`
I believe the call to `g_utf8_strrchr` was in error, as the second argument is
length in bytes, but `g_utf8_strlen` returns length in characters, which is
shorter. In any case, it accepts -1 anyway, so there's no need to count the
length.

Testing Done:
Compile and `ninja test`

Reviewed at https://reviews.imfreedom.org/r/960/
There are a few notes about building on OSX.
First off, building has *ONLY* been tested against homebrew. If you want to
support fink or macports, please let me know and I will merge your pull
request.
Currently there is no known way to build the Perl loader on MacOS. So you
**MUST** run meson with `-Dperl5=false`.
## Lua
For the Lua loader to work, you need to install `lgi` from luarocks either
systemwide for lua 5.1 as `lgi` does not currently work with lua 5.4 which is
the default in homebrew.
To make this work, you'll need to install both `lua@5.1` and `luarocks` via
`brew install lua@5.1 luarocks`. Once those are installed, you'll need to
create `/usr/local/etc/luarocks/config-5.1.lua` with the following contents.
```
-- LuaRocks configuration
rocks_trees = {
{ name = "user", root = home .. "/.luarocks" };
{ name = "system", root = "/usr/local" };
}
lua_interpreter = "lua5.1";
variables = {
LUA_DIR = "/usr/local/opt/lua@5.1";
LUA_BINDIR = "/usr/local/opt/lua@5.1/bin";
}
```
Once that is done, you can then finally install `lgi` with the following
command.
```
luarocks --lua-version=5.1 install lgi
```
## Python3
If you're using homebrew, you need to install `pygobject3`.