diff --git a/sci-libs/cgnslib/cgnslib-4.5.0.ebuild b/sci-libs/cgnslib/cgnslib-4.5.0.ebuild index fda3e085bea47..712c25a49978a 100644 --- a/sci-libs/cgnslib/cgnslib-4.5.0.ebuild +++ b/sci-libs/cgnslib/cgnslib-4.5.0.ebuild @@ -44,6 +44,7 @@ REQUIRED_USE=" PATCHES=( "${FILESDIR}"/${PN}-4.5.0-rpath.patch + "${FILESDIR}"/${PN}-4.5.0-tk-internal.patch ) pkg_setup() { @@ -66,10 +67,12 @@ src_configure() { filter-lto # Needed for uses an internal header (bug #934122) - local tk_ver=$(best_version dev-lang/tk) - tk_ver=${tk_ver#dev-lang/tk-} - tk_ver=$(ver_cut 1-2 ${tk_ver}) - append-cppflags -I"${ESYSROOT}/usr/$(get_libdir)/tk${tk_ver}/include/generic" + if use tools ; then + local tk_ver=$(best_version dev-lang/tk) + tk_ver=${tk_ver#dev-lang/tk-} + tk_ver=$(ver_cut 1-2 ${tk_ver}) + append-cppflags -I"${ESYSROOT}/usr/$(get_libdir)/tk${tk_ver}/include/generic" + fi local mycmakeargs=( -DCGNS_BUILD_SHARED=ON diff --git a/sci-libs/cgnslib/files/cgnslib-4.5.0-tk-internal.patch b/sci-libs/cgnslib/files/cgnslib-4.5.0-tk-internal.patch new file mode 100644 index 0000000000000..fb05b0aeb6f36 --- /dev/null +++ b/sci-libs/cgnslib/files/cgnslib-4.5.0-tk-internal.patch @@ -0,0 +1,12 @@ +https://bugs.gentoo.org/959272 +--- a/src/cgnstools/tkogl/tkogl.c ++++ b/src/cgnstools/tkogl/tkogl.c +@@ -25,7 +25,7 @@ + #if ! defined(__WIN32__) && ! defined(_WIN32) + /* For TkWmAddToColormapWindows. */ + #define _TKPORT /* Typical installations cannot find tkPort.h. */ +-#include ++#include + #endif + + #ifndef CONST