Incorrect GIR version numbers in generated files
Describe the bug
For a project version number MAJOR.MINOR.MICRO
, the corresponding API version number is MAJOR.MINOR
.
When building, gexiv2 is incorrectly labelling the GIR files with an out-of-date API version number - hard-coded to 0.10
. The API version is used in identification of the filenames (i.e. GExiv2-0.10.typelib
and GExiv2-0.10.gir
), and within the files themselves .
The naming situation causes problems when the public API changes, as one version cannot be differentiated from another. This can be seen in the project testing, where test/python/gexiv2.py and test/python/test_metadata.py cannot choose which version they are using - even thought both call gi.require_version()
.
The Debian build files have the same problem, as the packages are hard-coded with 0.10
and explicitly copy the GExiv2-0.10.typelib
file. Other parts of the debian build files also need modernising.
To Reproduce
For the general build issue, build gexiv2 with the introspection
flag set (it is by default).
For Debian, follow the debian instructions on building.
The general build problem goes back 3 years to commit a18c1789 and has been in place since version 0.10.6
, up until the last release of 0.12.1
.
The Debian problem goes back 4 years to commit 17f6276e and has been in place since version 0.10.4
, up until the last release of 0.12.1
Expected behaviour
Generate the GIR files with the correct API version number.
Generate the correct packages for Debian.
Desktop (please complete the following information):
- OS: Windows, MinGW64
- Compiler & version: gcc.exe (Rev9, Built by MSYS2 project) 10.2.0
The bug is expected on all setups.
Additional context
While experimenting with the version number during building, I found that the GIR seems to correctly create the files using the full version number. The GExiv2-0.12.typelib
and GExiv2-0.12.2.typelib
files were exactly the same size, with the GExiv2-0.12.typelib
file padded with 2 extra bytes where the MICRO
component would be.
PyGObject
(used in the project testing) however, would not use the files and only worked when an API version number was used.