--- valgrind-3.7.0-r3.ebuild.orig 2012-02-17 03:02:54.000000000 +0100 +++ valgrind-3.7.0-r3.ebuild 2012-03-23 20:29:51.000000000 +0100 @@ -21,6 +21,10 @@ # Correct hard coded doc location sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die + # Don't force multiarch stuff on OSX + sed -i -e 's:-arch \(i386\|x86_64\)::g' \ + Makefile.all.am || die + # Respect CFLAGS, LDFLAGS epatch "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch @@ -68,6 +72,9 @@ ! has_multilib_profile && myconf="${myconf} --enable-only64bit" fi + use x86-macos && myconf="${myconf} --enable-only32bit" + use x64-macos && myconf="${myconf} --enable-only64bit" + # Don't use mpicc unless the user asked for it (bug #258832) if ! use mpi; then myconf="${myconf} --without-mpicc" @@ -80,7 +87,16 @@ emake DESTDIR="${D}" install dodoc AUTHORS FAQ.txt NEWS README* - pax-mark m "${D}"/usr/$(get_libdir)/valgrind/*-*-linux + pax-mark m "${ED}"/usr/$(get_libdir)/valgrind/*-*-linux + + if [[ ${CHOST} == *-darwin* ]] ; then + # fix install_names on shared libraries, can't turn them into bundles, + # as dyld won't load them any more then + local l + for l in "${ED}"/usr/lib/valgrind/*.so ; do + install_name_tool -id "${EPREFIX}"/usr/lib/valgrind/${l##*/} "${l}" + done + fi } pkg_postinst() {