Created attachment 529552 [details] build.log media-libs/freetype-2.9.1 does not build (freetype-2.9.0 is fine): libtool: compile: x86_64-pc-linux-gnu-windres /var/tmp/portage/media-libs/freetype-2.9.1/work/freetype-2.9.1/src/base/ftver.rc -o /var/tmp/portage/media-libs/freetype-2.9.1/work/freetype-2.9.1-abi_x86_64.amd64/.libs/ftver.o /var/tmp/portage/media-libs/freetype-2.9.1/work/freetype-2.9.1/src/base/ftver.rc:19:9: fatal error: windows.h: No such file or directory #include<windows.h> ^~~~~~~~~~~ (will attach the full build log, config.log and emerge --info) This is a Linux (~amd64) system. windows.h should not be there. The problem isn't specific to the ebuild: manual "./configure && make" of freetype-2.9.1 fails similarly. The problem is introduced by the following two upstream commits: http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=fd8000f0402d48fd22f774170c74d585a82d7508 http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=4b8ccc56d8b4971a4f0434f497d74c641402222d These move ftver.rc out of the Windows-specific build, and have autotools build it if windres is found. Even though (other than app-emulation/wine) there shouldn't be anything to do with Windows on this system, binutils provides windres: [ebuild R ] sys-devel/binutils-2.30-r2:2.30::gentoo USE="cxx doc multitarget nls -static-libs {-test}" 0 KiB % qlist sys-devel/binutils|grep windres /usr/share/binutils-data/x86_64-pc-linux-gnu/2.30/man/man1/windres.1 /usr/x86_64-pc-linux-gnu/binutils-bin/2.30/windres Which is symlinked from /usr/bin: lrwxrwxrwx 1 root root 36 May 2 22:20 /usr/bin/x86_64-pc-linux-gnu-windres -> /usr/x86_64-pc-linux-gnu/bin/windres lrwxrwxrwx 1 root root 50 May 2 22:20 /usr/x86_64-pc-linux-gnu/bin/windres -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.30/windres
Created attachment 529554 [details] emerge --info
Created attachment 529556 [details] config.log
Looks like the culprit is sys-devel/binutils[multitarget]. Built without that flag, binutils does not provide windres. multitarget is not on by default, only depended upon by a tiny number of ebuilds, and probably not something one would otherwise enable. So I wouldn't expect many people to run into this.
My freetype only has one bin file, called /usr/bin and probalby is ttdebug freetype-2.9.1.tbz2/utar://usr -rwxr-xr-x 1 root root 39120 Mai 3 12:23 bin
I am just happily recognizing my Gentoo installation survived the emerge of freetype-2.9.1, because emerge had renamed the /usr/bin file. But my issue seems to be a different bug ....
Ideally freetype should try to use windres (and as a result windows.h) only if --host is a windows host (as .rc resource embedding is only used on PE32/32+ nowadays). In ebuilds it can be worked around by passing empty RC after matching on CHOST in a similar way: This seems to work for me: diff --git a/media-libs/freetype/freetype-2.9.1.ebuild b/media-libs/freetype/freetype-2.9.1.ebuild index b5c2fb86dea..b32a8ff7c76 100644 --- a/media-libs/freetype/freetype-2.9.1.ebuild +++ b/media-libs/freetype/freetype-2.9.1.ebuild @@ -174,6 +174,12 @@ multilib_src_configure() { LIBPNG_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libpng)" LIBPNG_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libpng)" ) + case ${CHOST} in + mingw*|*-mingw*) ;; + # Workaround windows mis-detection: bug #654712 + # Have to do it for both ${CHOST}-windres and windres + *) myeconfargs+=(ac_cv_prog_RC= ac_cv_prog_ac_ct_RC=) ;; + esac ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" }
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd38b4c265dd04f2659a0d4518bc687f82c168ac commit dd38b4c265dd04f2659a0d4518bc687f82c168ac Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2018-05-04 06:52:56 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2018-05-04 06:52:56 +0000 media-libs/freetype: Workaround windows mis-detection Thanks to slyfox for providing a fix. Closes: https://bugs.gentoo.org/654712 Package-Manager: Portage-2.3.35, Repoman-2.3.9 media-libs/freetype/freetype-2.9.1-r1.ebuild | 7 +++++++ media-libs/freetype/freetype-9999.ebuild | 7 +++++++ 2 files changed, 14 insertions(+)