diff -ru a/exact-image-0.8.1.ebuild b/exact-image-0.8.1.ebuild --- a/exact-image-0.8.1.ebuild 2010-07-08 21:36:48.000000000 +0000 +++ b/exact-image-0.8.1.ebuild 2010-10-02 04:48:52.255844723 +0000 @@ -6,7 +6,7 @@ PYTHON_DEPEND="python? 2:2.5" -inherit eutils multilib python +inherit eutils multilib python toolchain-funcs DESCRIPTION="A fast, modern and generic image processing library" HOMEPAGE="http://www.exactcode.de/site/open_source/exactimage/" @@ -54,6 +54,30 @@ sed -i -e "s:python2.5:python$(python_get_version):" \ -e "s:\$(libdir):usr/$(get_libdir):" \ "${S}"/api/python/Makefile + # Respect user CFLAGS/CXXFLAGS. + sed -i \ + -e '/C\(XX\)\?FLAGS =/s/-O2//' \ + -e "\$aCFLAGS += ${CFLAGS}\nCXXFLAGS += ${CXXFLAGS}" \ + Makefile || die + # Show commands. Use qualified CC/CXX. + sed -i \ + -e '/^Q =/d' \ + -e '/^\t@echo /d' \ + -e "\$aCC:=$(tc-getCC)\nCXX:=$(tc-getCXX)" \ + build/bottom.make || die + # The copied string fits exactly. Use memcpy to reflect that a null + # terminator is not needed. + sed -i \ + -e 's/strcpy(\([^,]*\)\(,["a-zA-Z -]*\))/memcpy(\1\2, sizeof(\1))/' \ + codecs/tga.cc || die + # gcc warns because the array access is technically ill-formed, though it + # happens to work with standard memory layouts. Rewrite the lookup to stay + # in bounds at all times. + local lengthof='(sizeof(\1) / sizeof(\1[0]))' + sed -i \ + -e 's:\(romm_cam\)\[0\]\[i\]:\1[i / '"$lengthof"'][i % '"$lengthof"']:' \ + -e 's:\(cam_xyz\)\[0\]\[j\]:\1[j / '"$lengthof"'][j % '"$lengthof"']:' \ + codecs/dcraw.h || die } src_configure() {