Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653916 - app-text/kbibtex: Pass along environment variables containing Git revision and branch
Summary: app-text/kbibtex: Pass along environment variables containing Git revision an...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-23 19:25 UTC by Thomas Fischer
Modified: 2018-06-23 20:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Fischer 2018-04-23 19:25:22 UTC
Current development versions of KBibTeX inspect the current source directory for information of a Git checkout and use the current Git revision and branch as additional information in the About box.
As the ebuild for KBibTeX (in the case of app-text/kbibtex-0.8_pre20180222) gets its source code as a .tar.gz-ball downloaded from GitHub, no .git directory exists. On the other hand, it is not (yet) a stable release with a fixed version number. Therefore the version string looks like " (), near 0.7.90" instead of "32bf6595 (kbibtex/0.8), near 0.7.90".

However, there is a simple solution: The CMake script assembling the version string from the Git repository can be told to use Git revision and branch information from environment variables instead.
Thus, this issue can be easily fixed by introducing a dedicated src_compile function:

src_compile() {
    GIT_REV=${COMMIT:0:8} GIT_BRANCH=${PN}/${PV%_pre*} kde5_src_compile
}

COMMIT is a variable set earlier in the ebuild file. GIT_REV shall be shorter, so only the first eight characters are used. GIT_BRANCH shall look like "kbibtex/0.8", so it takes the program name and the program version, but removes "_pre" and the following date.
Comment 1 Andreas Sturmlechner gentoo-dev 2018-04-23 21:39:59 UTC
This does not seem to work for me (with snapshot build from current 0.8 branch HEAD). I think a better approach, rather than using env vars, would be passing those to cmake.
Comment 2 Thomas Fischer 2018-04-24 06:17:51 UTC
(In reply to Andreas Sturmlechner from comment #1)
> This does not seem to work for me (with snapshot build from current 0.8
> branch HEAD). I think a better approach, rather than using env vars, would
> be passing those to cmake.

Hello, I am KBibTeX upstream. I'll look into passing the Git information via CMake arguments. Until then, can you please provide some details on "this does not seem to work for me"? For example, what is your output from the cmake and make/ninja phase?
Comment 3 Johannes Huber (RETIRED) gentoo-dev 2018-04-24 15:25:32 UTC
Imho as you are the upstream maintainer you should provide a final release version. Snapshots are only needed for unreleased and needed stuff downstream ;).
Comment 4 Thomas Fischer 2018-05-13 07:46:35 UTC
(In reply to Johannes Huber from comment #3)
> Imho as you are the upstream maintainer you should provide a final release
> version. Snapshots are only needed for unreleased and needed stuff
> downstream ;).
Updating a Gentoo package is far easier than making a release ... ;-)

There is a KBibTeX 0.8-beta1 release (0.7.90) available by now. Have you created a package for that one already (haven't checked)?
https://t-fischer.dreamwidth.org/6707.html
Comment 5 Andreas Sturmlechner gentoo-dev 2018-05-24 16:32:30 UTC
(In reply to Thomas Fischer from comment #4)
> There is a KBibTeX 0.8-beta1 release (0.7.90) available by now. Have you
> created a package for that one already (haven't checked)?
> https://t-fischer.dreamwidth.org/6707.html

Yes, 0.8_pre20180504 actually represents 0.7.90 (in order to be an upgrade to the existing snapshot).

Do you have an ETA for 0.8 release?
Comment 6 Thomas Fischer 2018-05-26 18:45:18 UTC
> Do you have an ETA for 0.8 release?
I just tagged 0.8-rc1 (0.7.95), now preparing tar-balls that shoud hit KDE's mirrors in a few hours/days. Then, depending on feedback, I plan to make the official release soon after, i.e. early June.
Comment 7 Andreas Sturmlechner gentoo-dev 2018-06-23 20:39:58 UTC
We have 0.8.1 in tree and considering the zero delta over the last snapshot already pending stabilisation: bug 658856

I think that a nice solution to the original issue in this bug would ideally go into extra-cmake-modules to be available to all KDE software. Maybe a short commit hash representation would even be useful to be displayed in the About dialog, if built from git or as a snapshot.