--- db-5.1.29-r1.ebuild 2015-04-07 18:47:02.273301548 -0400 +++ db-5.1.29-r2.ebuild 2015-04-07 18:46:14.872251845 -0400 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/sys-libs/db/db-5.1.29-r1.ebuild,v 1.3 2015/03/20 14:41:50 jlec Exp $ EAPI=5 -inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib toolchain-funcs +inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal toolchain-funcs #Number of official patches #PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"` @@ -34,13 +34,17 @@ REQUIRED_USE="test? ( tcl )" # the entire testsuite needs the TCL functionality -DEPEND="tcl? ( >=dev-lang/tcl-8.4:0 ) - test? ( >=dev-lang/tcl-8.4:0 ) +DEPEND="tcl? ( >=dev-lang/tcl-8.4:0=[${MULTILIB_USEDEP}] ) + test? ( >=dev-lang/tcl-8.4:0=[${MULTILIB_USEDEP}] ) java? ( >=virtual/jdk-1.5 ) >=sys-devel/binutils-2.16.1" -RDEPEND="tcl? ( dev-lang/tcl:0 ) +RDEPEND="tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] ) java? ( >=virtual/jre-1.5 )" +MULTILIB_WRAPPED_HEADERS=( + /usr/include/db5.1/db.h +) + src_prepare() { cd "${WORKDIR}"/"${MY_P}" for (( i=1 ; i<=${PATCHNO} ; i++ )) @@ -95,6 +99,16 @@ } src_configure() { + # Add linker versions to the symbols. Easier to do, and safer than header file + # mumbo jumbo. + if use userland_GNU ; then + append-ldflags -Wl,--default-symver + fi + + multilib-minimal_src_configure +} + +multilib_src_configure() { local myconf='' tc-ld-disable-gold #470634 @@ -107,18 +121,12 @@ # use `set` here since the java opts will contain whitespace set -- - if use java ; then + if multilib_is_native_abi && use java ; then set -- "$@" \ --with-java-prefix="${JAVA_HOME}" \ --with-javac-flags="$(java-pkg_javac-args)" fi - # Add linker versions to the symbols. Easier to do, and safer than header file - # mumbo jumbo. - if use userland_GNU ; then - append-ldflags -Wl,--default-symver - fi - # Bug #270851: test needs TCL support if use tcl || use test ; then myconf="${myconf} --enable-tcl" @@ -129,7 +137,6 @@ # sql_compat will cause a collision with sqlite3 # --enable-sql_compat - cd "${S}" ECONF_SOURCE="${S_BASE}"/dist \ STRIP="true" \ econf \ @@ -140,49 +147,47 @@ --enable-sql \ --enable-sql_codegen \ --disable-sql_compat \ - $(use arm && echo --with-mutex=ARM/gcc-assembly) \ - $(use amd64 && echo --with-mutex=x86/gcc-assembly) \ + $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \ + $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \ $(use_enable cxx) \ $(use_enable cxx stl) \ - $(use_enable java) \ + $(multilib_native_use_enable java) \ ${myconf} \ $(use_enable test) \ "$@" } -src_compile() { - emake || die "make failed" -} - -src_install() { +multilib_src_install() { emake install DESTDIR="${D}" || die - db_src_install_usrbinslot - db_src_install_headerslot - db_src_install_doc - db_src_install_usrlibcleanup - dodir /usr/sbin - # This file is not always built, and no longer exists as of db-4.8 - [[ -f "${D}"/usr/bin/berkeley_db_svc ]] && \ - mv "${D}"/usr/bin/berkeley_db_svc "${D}"/usr/sbin/berkeley_db"${SLOT/./}"_svc - - if use java; then + if multilib_is_native_abi && use java; then java-pkg_regso "${D}"/usr/"$(get_libdir)"/libdb_java*.so java-pkg_dojar "${D}"/usr/"$(get_libdir)"/*.jar rm -f "${D}"/usr/"$(get_libdir)"/*.jar fi } +multilib_src_install_all() { + db_src_install_usrbinslot + + db_src_install_doc + + dodir /usr/sbin + # This file is not always built, and no longer exists as of db-4.8 + [[ -f "${D}"/usr/bin/berkeley_db_svc ]] && \ + mv "${D}"/usr/bin/berkeley_db_svc "${D}"/usr/sbin/berkeley_db"${SLOT/./}"_svc +} + pkg_postinst() { - db_fix_so + multilib_foreach_abi db_fix_so } pkg_postrm() { - db_fix_so + multilib_foreach_abi db_fix_so } src_test() { @@ -197,5 +202,11 @@ -e '/multi_repmgr/d' \ "${S_BASE}/test/tcl/test.tcl" - db_src_test + multilib-minimal_src_test +} + +multilib_src_test() { + multilib_is_native_abi || return + + S=${BUILD_DIR} db_src_test }