--- media-libs/libraw/libraw-0.9.1.ebuild 2010-09-11 22:26:44.007721012 +0200 +++ media-libs/libraw/libraw-0.10.0.ebuild 2010-09-11 22:27:33.743720971 +0200 @@ -6,7 +6,7 @@ inherit eutils -DESCRIPTION="LibRaw is a library for reading RAW files obtained from digital photo cameras" +DESCRIPTION="A library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)" HOMEPAGE="http://www.libraw.org/" SRC_URI="http://www.libraw.org/data/LibRaw-${PV}.tar.gz" @@ -18,35 +18,48 @@ KEYWORDS="~amd64 ~x86" IUSE="lcms openmp examples" -RDEPEND="" +RDEPEND="lcms? ( =media-libs/lcms-1* )" +DEPEND="${RDEPEND}" S="${WORKDIR}/LibRaw-${PV}" +MY_LIBDIR=$(get_libdir) src_prepare() { # Add pkg-config support - epatch "${FILESDIR}/libraw-0.9.1-pkg-config.patch" || die "pkg-config patch failed." + epatch "${FILESDIR}/${P}-pkg-config.patch" || die "pkg-config patch failed" sed -i -e "s:/usr/local/:${D}usr/:g" \ -e "/^CFLAGS/ s:-O4:${CFLAGS}:" \ - Makefile || die "Patching the hell out of manual Makefile failed." + -e "s:usr/lib:usr/${MY_LIBDIR}:g" \ + Makefile || die "Patching the hell out of manual Makefile failed" + + sed -i -e "s:LIBDIR:${MY_LIBDIR}:" \ + -e "s:VERSION:${PV}:" \ + *.pc || die "Patching pc files failed" if use lcms; then - sed -i -r '/^#LCMS/ s!^#!!' Makefile || die "Enabling LCMS failed." + sed -i -r '/^#LCMS/ s!^#!!' Makefile || die "Enabling LCMS failed" sed -i -r -e '/^Libs/ s!$! -llcms!' \ - -e '/^Requires/ s!$! lcms2!' *.pc || die "Adding pkg-config LCMS dependency failed." + -e '/^Requires/ s!$! lcms!' \ + *.pc || die "Adding pkg-config LCMS dependency failed" fi if use openmp; then - sed -i -r '/^CFLAGS/ s!^(.*)$!\1 -fopenmp!' Makefile || die "Enabling OpenMP failed." - sed -i -r '/^Cflags/ s!$! -fopenmp!' *.pc || die "Adding pkg-config OpenMP dependency failed." + sed -i -r '/^CFLAGS/ s!^(.*)$!\1 -fopenmp!' \ + Makefile || die "Enabling OpenMP failed" + sed -i -r -e '/^Cflags/ s!$! -fopenmp!' \ + -e '/^Libs/ s!$! -lgomp!' \ + *.pc || die "Adding pkg-config OpenMP dependency failed" fi } src_install() { - # This makefile doesn't even make the directories.. - mkdir -p "${D}usr/include" "${D}usr/lib" "${D}usr/lib/pkgconfig" \ - $(use examples && echo "${D}/usr/bin") || die "Directory making failed." + # This Makefile does not even make the directories. + mkdir -p "${D}usr/include" \ + "${D}usr/${MY_LIBDIR}" \ + "${D}usr/${MY_LIBDIR}/pkgconfig" \ + $(use examples && echo "${D}/usr/bin") || die "Directory making failed" emake install \ - $(use examples && echo "install-binaries") || die "Install failed." + $(use examples && echo "install-binaries") || die "Install failed" }