--- irda-utils-0.9.18.ebuild 2007-09-25 17:34:21.000000000 +0200 +++ irda-utils-0.9.18.ebuild 2007-11-25 18:31:58.000000000 +0100 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-wireless/irda-utils/irda-utils-0.9.18.ebuild,v 1.1 2007/09/25 15:34:21 hanno Exp $ -inherit eutils +inherit eutils toolchain-funcs DESCRIPTION="IrDA utilities for infrared communication" HOMEPAGE="http://irda.sourceforge.net" @@ -13,9 +13,10 @@ KEYWORDS="~amd64 ~arm ~ppc ~sh ~x86" IUSE="" -RDEPEND="=dev-libs/glib-2*" +RDEPEND="=dev-libs/glib-2* + >=sys-apps/pciutils-2.2.7-r1" DEPEND="${RDEPEND} - sys-apps/sed" + dev-util/pkgconfig" src_unpack() { unpack ${A} @@ -24,10 +25,21 @@ epatch "${FILESDIR}/irda-utils-rh1.patch" epatch "${FILESDIR}/irda-utils-0.9.18-makefile.diff" epatch "${FILESDIR}/irda-utils-0.9.18-io.h.diff" + + # fix crosscompile, respect CFLAGS (Bug 200295) + for i in $(find . -type f -name Makefile -print) ; do + sed -i -e "/^CC/s:gcc:$(tc-getCC):" \ + -e "/^LD/s:ld:$(tc-getLD):" \ + -e "/^AR/s:ar:$(tc-getAR):" \ + -e "/^RANLIB/s:ranlib:$(tc-getRANLIB):" \ + -e "/^CFLAGS/s:-O2:${CFLAGS}:" ${i} + done + # fix compile when pciutils is compiled with USE=zlib (Bug 200295) + sed -i -e "s:-lpci:$(pkg-config --libs libpci):g" smcinit/Makefile } src_compile() { - emake RPM_OPT_FLAGS="${CFLAGS}" RPM_BUILD_ROOT="${D}" ROOT="${D}" \ + emake RPM_OPT_FLAGS="-fno-strict-aliasing" RPM_BUILD_ROOT="${D}" ROOT="${D}" \ || die "emake failed" } @@ -35,7 +47,7 @@ dodir /usr/bin dodir /usr/sbin - emake install RPM_OPT_FLAGS="${CFLAGS}" ROOT="${D}" \ + emake install ROOT="${D}" \ MANDIR="${D}/usr/share/man" \ || die "emake install failed"