--- adobe-flash-11.2.202.310.ebuild 2013-09-11 11:31:35.000000000 +0200 +++ adobe-flash-11.2.202.310-r1.ebuild 2013-09-23 18:42:34.541637656 +0200 @@ -3,7 +3,7 @@ # $Header: /var/cvsroot/gentoo-x86/www-plugins/adobe-flash/adobe-flash-11.2.202.310.ebuild,v 1.2 2013/09/11 09:04:54 pinkbyte Exp $ EAPI=5 -inherit nsplugins multilib toolchain-funcs versionator +inherit nsplugins multilib toolchain-funcs versionator multilib-minimal DESCRIPTION="Adobe Flash Player" HOMEPAGE="http://www.adobe.com/products/flashplayer.html" @@ -16,22 +16,13 @@ AF_32_DB_URI="${AF_DB_URI}/${PV_M}/flashplayer_${PV_M}_plugin_debug.i386.tar.gz -> ${P}-debug.i386.tar.gz" SRC_URI=" - x86? ( + abi_x86_32? ( !debug? ( ${AF_32_URI} ) debug? ( ${AF_32_DB_URI} ) ) - amd64? ( - multilib? ( - 32bit? ( - !debug? ( ${AF_32_URI} ) - debug? ( ${AF_32_DB_URI} ) - ) - 64bit? ( ${AF_64_URI} ) - ) - !multilib? ( ${AF_64_URI} ) - ) + abi_x86_64? ( ${AF_64_URI} ) " -IUSE="-32bit +64bit debug kde multilib selinux sse2" +IUSE="debug kde selinux sse2" REQUIRED_USE="sse2" SLOT="0" @@ -42,33 +33,79 @@ S="${WORKDIR}" NATIVE_DEPS=" - >=sys-libs/glibc-2.4 + dev-libs/atk + dev-libs/glib:2 dev-libs/nspr dev-libs/nss - kde? ( kde-base/kcmshell ) + kde? ( + dev-qt/qtcore:4 + dev-qt/qtdbus:4 + dev-qt/qtgui:4 + dev-qt/qtsvg:4 + kde-base/kdelibs + x11-libs/libICE + x11-libs/libSM + x11-libs/libXau + x11-libs/libXdmcp + x11-libs/libXext + x11-libs/libXft + x11-libs/libXpm + ) media-libs/fontconfig - net-misc/curl + media-libs/freetype + >=sys-libs/glibc-2.4 + x11-libs/cairo + x11-libs/gdk-pixbuf x11-libs/gtk+:2 -" - -EMUL_DEPS=" - >=app-emulation/emul-linux-x86-gtklibs-20100409-r1 - app-emulation/emul-linux-x86-soundlibs + x11-libs/libX11 + x11-libs/libXcursor + x11-libs/libXext + x11-libs/libXrender + x11-libs/libXt + x11-libs/pango " DEPEND=" - amd64? ( multilib? ( !64bit? ( www-plugins/nspluginwrapper ) ) ) + amd64? ( abi_x86_32? ( www-plugins/nspluginwrapper ) ) selinux? ( sec-policy/selinux-flash ) " RDEPEND=" ${DEPEND} - x86? ( $NATIVE_DEPS ) - amd64? ( - multilib? ( - 64bit? ( $NATIVE_DEPS ) - 32bit? ( $EMUL_DEPS ) + abi_x86_64? ( $NATIVE_DEPS ) + abi_x86_32? ( + amd64? ( + || ( + ( + dev-libs/atk[abi_x86_32(-)] + x11-libs/cairo[abi_x86_32(-)] + x11-libs/gdk-pixbuf[abi_x86_32(-)] + x11-libs/gtk+:2[abi_x86_32(-)] + x11-libs/pango[abi_x86_32(-)] + ) + app-emulation/emul-linux-x86-gtklibs[-abi_x86_32(-)] + ) + || ( + ( + dev-libs/glib:2[abi_x86_32(-)] + dev-libs/nspr[abi_x86_32(-)] + dev-libs/nss[abi_x86_32(-)] + ) + app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + ) + || ( + ( + media-libs/fontconfig[abi_x86_32(-)] + media-libs/freetype[abi_x86_32(-)] + x11-libs/libX11[abi_x86_32(-)] + x11-libs/libXcursor[abi_x86_32(-)] + x11-libs/libXext[abi_x86_32(-)] + x11-libs/libXrender[abi_x86_32(-)] + x11-libs/libXt[abi_x86_32(-)] + ) + app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)] + ) ) - !multilib? ( $NATIVE_DEPS ) + x86? ( $NATIVE_DEPS ) ) || ( media-fonts/liberation-fonts media-fonts/corefonts ) " @@ -85,59 +122,36 @@ } pkg_setup() { - if use x86; then - export native_install=1 - elif use amd64; then - # amd64 users may unselect the native 64bit binary, if they choose - # TODO: In future revisions, remove this ability now that 64-bit - # binaries are officially released and working. - if ! use multilib || use 64bit; then - export native_install=1 - else - unset native_install - fi - - if use multilib && use 32bit; then - export amd64_32bit=1 - else - unset amd64_32bit - fi - - if use multilib && ! use 32bit && ! use 64bit; then - eerror "You must select at least one architecture USE flag (32bit or 64bit)" - die "No library version selected [-32bit -64bit]" - fi - - unset need_lahf_wrapper - if [[ $native_install ]]; then - # 64bit flash requires the 'lahf' instruction (bug #268336) - if any_cpu_missing_flag 'lahf_lm'; then - export need_lahf_wrapper=1 - fi - fi + unset need_lahf_wrapper + if use amd64 && use abi_x86_64 && any_cpu_missing_flag 'lahf_lm'; then + export need_lahf_wrapper=1 fi } src_unpack() { - if [[ $amd64_32bit ]]; then - # Since the 32-bit and 64-bit packages collide, put the 32-bit one - # elsewhere: - local my_32b_src=${AF_32_URI##*>} - local my_64b_src=${AF_64_URI##*>} - if [[ $native_install ]]; then - unpack $my_64b_src - fi - mkdir 32bit - pushd 32bit >/dev/null - unpack $my_32b_src - popd >/dev/null - else - default_src_unpack - fi + unpack_for_abi() { + mkdir -p "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" || die + if use debug; then + local my_src=${AF_32_URI##*>} + else + local my_src=${AF_32_DB_URI##*>} + fi + [[ ${ABI} == "amd64" ]] && my_src="${AF_64_URI##*>}" + unpack $my_src + # shortcut the need for PKGLIB using a common symlink + if [[ -d /usr/lib64 ]] ; then + ln -s /usr/lib64 usr/correctlib + else + ln -s /usr/lib usr/correctlib + fi + popd || die + } + multilib_parallel_foreach_abi unpack_for_abi } -src_compile() { - if [[ $need_lahf_wrapper ]]; then +multilib_src_compile() { + if [[ ${ABI} == "amd64" ]] && [[ $need_lahf_wrapper ]]; then # This experimental wrapper, from Maks Verver via bug #268336 should # emulate the missing lahf instruction affected platforms. $(tc-getCC) -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so \ @@ -146,24 +160,18 @@ fi } -src_install() { - if [[ $native_install ]]; then - if use x86; then - local PKGLIB=lib - else - local PKGLIB=lib64 - fi - local BASE=${INSTALL_BASE} +multilib_src_install() { + local BASE=${INSTALL_BASE} + if multilib_build_binaries; then # The plugin itself exeinto /${BASE}/flash-plugin doexe libflashplayer.so inst_plugin /${BASE}/flash-plugin/libflashplayer.so - # The optional KDE4 KCM plugin if use kde; then exeinto /${BASE}/kde4 - doexe usr/${PKGLIB}/kde4/kcm_adobe_flash_player.so + doexe usr/correctlib/kde4/kcm_adobe_flash_player.so dosym /${BASE}/kde4/kcm_adobe_flash_player.so \ /usr/$(get_libdir)/kde4/kcm_adobe_flash_player.so insinto /usr/share/kde4/services @@ -191,48 +199,40 @@ sed -i usr/share/applications/flash-player-properties.desktop \ -e "s:^Exec=:Exec=/${BASE}/bin/:" || die "sed of .desktop file failed" doins usr/share/applications/flash-player-properties.desktop - fi - - if [[ $need_lahf_wrapper ]]; then - # This experimental wrapper, from Maks Verver via bug #268336 should - # emulate the missing lahf instruction affected platforms. - exeinto /${INSTALL_BASE} - doexe flashplugin-lahf-fix.so - inst_plugin /${INSTALL_BASE}/flashplugin-lahf-fix.so - fi - if [[ $amd64_32bit ]]; then - # Only install the plugin, nothing else for 32-bit. - local oldabi="${ABI}" - ABI="x86" - - # 32b plugin - pushd "${S}/32bit" - exeinto /${INSTALL_BASE}32 - doexe libflashplayer.so - inst_plugin /${INSTALL_BASE}32/libflashplayer.so - popd + if [[ ${ABI} == "amd64" ]] && [[ $need_lahf_wrapper ]]; then + # This experimental wrapper, from Maks Verver via bug #268336 should + # emulate the missing lahf instruction affected platforms. + exeinto /${INSTALL_BASE} + doexe flashplugin-lahf-fix.so + inst_plugin /${INSTALL_BASE}/flashplugin-lahf-fix.so + fi - ABI="${oldabi}" + # The magic config file! + insinto "/etc/adobe" + doins "${FILESDIR}/mms.cfg" + else + # install plugin only for alternate ABIs + local mylibdir=$(get_libdir) + BASE=${INSTALL_BASE}${mylibdir##*lib} + exeinto /${BASE} + doexe libflashplayer.so + inst_plugin /${BASE}/libflashplayer.so fi - - # The magic config file! - insinto "/etc/adobe" - doins "${FILESDIR}/mms.cfg" } pkg_postinst() { - if use amd64; then + if use amd64 ; then if [[ $need_lahf_wrapper ]]; then ewarn "Your processor does not support the 'lahf' instruction which is used" ewarn "by Adobe's 64-bit flash binary. We have installed a wrapper which" ewarn "should allow this plugin to run. If you encounter problems, please" ewarn "adjust your USE flags to install only the 32-bit version and reinstall:" - ewarn " ${CATEGORY}/$PN[+32bit -64bit]" + ewarn " ${CATEGORY}/$PN[+abi_x86_32 -abi_x86_64]" elog fi if has_version 'www-plugins/nspluginwrapper'; then - if [[ $native_install ]]; then + if ! use abi_x86_32; then # TODO: Perhaps parse the output of 'nspluginwrapper -l' # TODO: However, the 64b flash plugin makes # TODO: 'nspluginwrapper -l' segfault. @@ -249,7 +249,7 @@ nspluginwrapper -i "${FLASH_SOURCE}" ABI="${oldabi}" fi - elif [[ ! $native_install ]]; then + elif use abi_x86_32; then elog "To use the 32-bit flash player in a native 64-bit browser," elog "you must install www-plugins/nspluginwrapper" fi