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.
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. :)
I'll look into it.
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.
Created attachment 551750 [details] openexr_viewers-2.3.0.ebuild updated ebuild
Created attachment 551752 [details, diff] openexr_viewers-2.3.0--with-cg-libdir.patch patch to add --with-cg-libdir option to configure
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'.
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.
Created attachment 551770 [details, diff] openexr_viewers-2.3.0--with-cg-libdir.patch updated patch to add --with-cg-libdir option to configure
(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 )
https://github.com/openexr/openexr/issues/353
(In reply to Bernd from comment #10) > https://github.com/openexr/openexr/issues/353 Maybe a PR would increase the chance of upstream inclusion.
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(-)