When repos are forked on GitLab tags aren't copied (0 Tags) thus making
git-version-gen producing incorrect version ("UNKNOWN") which in turn
causes CI build failures (not helpful for people trying to make Merge
Requests). To workaround this issue reconstruct version from ChangeLogs
files (handy updated on every release). If git describe is not working
and we are not in dist package - take version from the top-most
ChangeLog file.
Example of error messages:
../libtool: line 1168: UNKNOWN + : syntax error: operand expected (error token is "+ ")
In file included from net.c:83:
net.c: In function 'connect_dev':
<command-line>: error: 'UNKNOWN' undeclared (first use in this function)
../include/sane/sane.h:31:21: note: in definition of macro 'SANE_VERSION_CODE'
31 | ( (((SANE_Word) (major) & 0xff) << 24) \
| ^~~~~
net.c:485:41: note: in expansion of macro 'V_MAJOR'
485 | req.version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR,
| ^~~~~~~