Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668754 - media-gfx/openexr_viewers-2.3.0[cg]: Detection of Cg libraries broken on some architectures
Summary: media-gfx/openexr_viewers-2.3.0[cg]: Detection of Cg libraries broken on some...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-10-15 21:55 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2018-10-31 18:58 UTC (History)
2 users (show)

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


Attachments
openexr_viewers-2.3.0.ebuild (openexr_viewers-2.3.0.ebuild,1.28 KB, text/plain)
2018-10-17 20:50 UTC, Bernd
Details
openexr_viewers-2.3.0--with-cg-libdir.patch (openexr_viewers-2.3.0--with-cg-libdir.patch,825 bytes, patch)
2018-10-17 20:50 UTC, Bernd
Details | Diff
openexr_viewers-2.3.0--with-cg-libdir.patch (openexr_viewers-2.3.0--with-cg-libdir.patch,811 bytes, patch)
2018-10-18 06:32 UTC, Bernd
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2018-10-15 21:55:14 UTC
openexr_viewers-2.3.0-fix-cg-libdir.patch (added in https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f82dcf755d6676dda0ac065883e93076afc6d84) changes hardcoded component of directory of Cg libraries from "lib" to "lib64".

media-gfx/nvidia-cg-toolkit installs libraries in /opt/nvidia-cg-toolkit/$(get_libdir), so this patch breaks detection of Cg libraries on x86 (where Cg libraries are in /opt/nvidia-cg-toolkit/lib) and fixes detection of Cg libraries on amd64 (where Cg libraries are in /opt/nvidia-cg-toolkit/lib64).


I suggest to introduce support for separate --with-cg-libdir=... option which would override directory of Cg libraries.
Then media-gfx/openexr_viewers ebuild would contain:
...
	if use cg; then
		myeconfargs+=(
			--enable-cg
			--with-cg-prefix="/opt/nvidia-cg-toolkit"
			--with-cg-libdir="/opt/nvidia-cg-toolkit/$(get_libdir)"
		)
...

Build system can still default to $cg_prefix/lib when --with-cg-libdir=... option is not passed.
Comment 1 Jonathan Scruggs (RETIRED) gentoo-dev 2018-10-16 09:07:01 UTC
I agree with the above option of introducing a new variable. Plus, make this a separate patch and then submit it upstream, because other distros may benefit from having a dynamic cg lib directory. :)
Comment 2 Bernd 2018-10-16 20:56:01 UTC
I'll look into it.
Comment 3 Bernd 2018-10-17 20:49:08 UTC
I expected more resistance from autotools O.o This seemed too easy for my little m4 knowledge to be the actual solution. Any suggestions on the patch are welcome.

The patch is on my listed overlay https://github.com/waebbl/waebbl-gentoo/tree/master/media-gfx/openexr_viewers to try it out. I also add the patch and updated ebuild here for reference.

I tested it on my amd64 box and also inside a clean chroot32 environment and it compiled.

If one of you could please try it out and give me feedback? If it works, I'll open a PR for it.
Comment 4 Bernd 2018-10-17 20:50:13 UTC
Created attachment 551750 [details]
openexr_viewers-2.3.0.ebuild

updated ebuild
Comment 5 Bernd 2018-10-17 20:50:56 UTC
Created attachment 551752 [details, diff]
openexr_viewers-2.3.0--with-cg-libdir.patch

patch to add --with-cg-libdir option to configure
Comment 6 Arfrever Frehtes Taifersar Arahesis 2018-10-17 21:12:57 UTC
Suggested improvements:

In order to avoid repetition of -l... flags, you can use:
if test x$cg_libdir != x; then
  CG_LDFLAGS="-L$cg_libdir"
else
  CG_LDFLAGS="-L$cg_prefix/lib"
fi
CG_LDFLAGS="$CG_LDFLAGS -lGL -lCg -lCgGL -lGLU -lpthread -lglut"


The line after 'AC_ARG_WITH(cg-libdir' has indentation inconsistent with the line after 'AC_ARG_WITH(cg-prefix'.
Comment 7 Bernd 2018-10-18 06:31:46 UTC
Thanks for your suggestions.

For the first one, I already thought about doing it like this, but then didn't find a real advantage beside having to write a few chars less code. But on a second thought, I think it's actually a better way of handling it, as it's less error prone, in case the list of libraries needs to be changed.
Comment 8 Bernd 2018-10-18 06:32:51 UTC
Created attachment 551770 [details, diff]
openexr_viewers-2.3.0--with-cg-libdir.patch

updated patch to add --with-cg-libdir option to configure
Comment 9 Arfrever Frehtes Taifersar Arahesis 2018-10-18 18:52:37 UTC
(In reply to Bernd from comment #8)

Patch looks good.
Maybe you could send it to upstream?
( https://github.com/openexr/openexr/tree/master/OpenEXR_Viewers )
Comment 11 Andreas Sturmlechner gentoo-dev 2018-10-31 18:58:06 UTC
(In reply to Bernd from comment #10)
> https://github.com/openexr/openexr/issues/353
Maybe a PR would increase the chance of upstream inclusion.
Comment 12 Larry the Git Cow gentoo-dev 2018-10-31 18:58:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ae4594e8c806e9e2ab9099834c9d5380c2ce3ce

commit 7ae4594e8c806e9e2ab9099834c9d5380c2ce3ce
Author:     Bernd Waibel <waebbl@gmail.com>
AuthorDate: 2018-10-18 20:45:29 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2018-10-31 18:58:24 +0000

    media-gfx/openexr_viewers: fix Cg libdir
    
    * remove files/openexr_viewers-2.3.0-fix-cg-libdir.patch
    * add files/openexr_viewers-2.3.0--with-cg-libdir.patch
    
    Addresses an issue, where Cg libraries where not found on 32-bit
    arches. The patch adds an option --with-cg-libdir to configure to
    pass 32-/64-bit specific libraries of Cg to configure script.
    
    Thanks to Arfrever Frehtes Taifersar Arahesis for reporting the issue.
    
    See also
    https://github.com/gentoo/gentoo/pull/10030#pullrequestreview-164522412
    
    Closes: https://bugs.gentoo.org/668754
    Signed-off-by: Bernd Waibel <waebbl@gmail.com>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11
    Closes: https://github.com/gentoo/gentoo/pull/10172
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 .../openexr_viewers-2.3.0--with-cg-libdir.patch    | 23 ++++++++++++++++++++++
 .../openexr_viewers-2.3.0-fix-cg-libdir.patch      | 13 ------------
 .../openexr_viewers/openexr_viewers-2.3.0.ebuild   |  5 +++--
 3 files changed, 26 insertions(+), 15 deletions(-)