commit:     ec1ca5afa84af6a0c28a5b38322699d86a798260
Author:     Marty E. Plummer <hanetzer <AT> startmail <DOT> com>
AuthorDate: Sat Mar 24 04:18:36 2018 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Jun  8 04:16:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec1ca5af

media-libs/mesa: Convert build to meson

With various changes by mattst88:
        - Add lm_sensors to IUSE, lest it be automagic
        - Depend on bison and flex unconditionally
        - Fix libGLESv1_CM in QA_WX_LOAD (Meson installs under a
          different name)

Closes: https://bugs.gentoo.org/652762

 media-libs/mesa/mesa-9999.ebuild | 171 +++++++++++++++++----------------------
 1 file changed, 73 insertions(+), 98 deletions(-)

diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
index 879c7d80434..e9bfa80a319 100644
--- a/media-libs/mesa/mesa-9999.ebuild
+++ b/media-libs/mesa/mesa-9999.ebuild
@@ -3,16 +3,9 @@
 
 EAPI=6
 
-EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
-
-if [[ ${PV} = 9999 ]]; then
-       GIT_ECLASS="git-r3"
-       EXPERIMENTAL="true"
-fi
-
 PYTHON_COMPAT=( python2_7 )
 
-inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
+inherit llvm meson multilib-minimal pax-utils python-any-r1
 
 OPENGL_DIR="xorg-x11"
 
@@ -21,8 +14,10 @@ MY_P="${P/_/-}"
 DESCRIPTION="OpenGL-like graphic library for Linux"
 HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/";
 
-if [[ $PV == 9999 ]]; then
-       SRC_URI=""
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
+       EXPERIMENTAL="true"
+       inherit git-r3
 else
        SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
        KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux 
~sparc-solaris ~x64-solaris ~x86-solaris"
@@ -30,7 +25,10 @@ fi
 
 LICENSE="MIT"
 SLOT="0"
-RESTRICT="!bindist? ( bindist )"
+RESTRICT="
+       !bindist? ( bindist )
+       !test? ( test )
+"
 
 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
 VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 
vivante vmware"
@@ -39,9 +37,9 @@ for card in ${VIDEO_CARDS}; do
 done
 
 IUSE="${IUSE_VIDEO_CARDS}
-       bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
-       +llvm +nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind
-       vdpau vulkan wayland xvmc xa"
+       bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm
+       lm_sensors +nptl opencl osmesa pax_kernel openmax pic selinux test 
unwind
+       vaapi valgrind vdpau vulkan wayland xvmc xa"
 
 REQUIRED_USE="
        d3d9?   ( dri3 gallium )
@@ -101,6 +99,7 @@ RDEPEND="
                                virtual/libelf:0=[${MULTILIB_USEDEP}]
                        )
                )
+               lm_sensors? ( sys-apps/lm_sensors:= )
                opencl? (
                                        app-eselect/eselect-opencl
                                        dev-libs/libclc
@@ -217,17 +216,12 @@ DEPEND="${RDEPEND}
        opencl? (
                >=sys-devel/gcc-4.6
        )
+       sys-devel/bison
+       sys-devel/flex
        sys-devel/gettext
        virtual/pkgconfig
        valgrind? ( dev-util/valgrind )
        x11-base/xorg-proto
-       vulkan? (
-               $(python_gen_any_dep 
">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
-       )
-"
-[[ ${PV} == 9999 ]] && DEPEND+="
-       sys-devel/bison
-       sys-devel/flex
        $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
 "
 
@@ -238,7 +232,7 @@ QA_WX_LOAD="
 x86? (
        !pic? (
                usr/lib*/libglapi.so.0.0.0
-               usr/lib*/libGLESv1_CM.so.1.1.0
+               usr/lib*/libGLESv1_CM.so.1.0.0
                usr/lib*/libGLESv2.so.2.0.0
                usr/lib*/libGL.so.1.2.0
                usr/lib*/libOSMesa.so.8.0.0
@@ -271,55 +265,46 @@ pkg_setup() {
        python-any-r1_pkg_setup
 }
 
-src_prepare() {
-       eapply_user
-       [[ ${PV} == 9999 ]] && eautoreconf
-}
-
 multilib_src_configure() {
-       local myconf
+       local emesonargs=()
 
        if use classic; then
-               # Configurable DRI drivers
-               driver_enable swrast
-
                # Intel code
-               driver_enable video_cards_i915 i915
-               driver_enable video_cards_i965 i965
+               dri_driver_enable video_cards_i915 i915
+               dri_driver_enable video_cards_i965 i965
                if ! use video_cards_i915 && \
                        ! use video_cards_i965; then
-                       driver_enable video_cards_intel i915 i965
+                       dri_driver_enable video_cards_intel i915 i965
                fi
 
                # Nouveau code
-               driver_enable video_cards_nouveau nouveau
+               dri_driver_enable video_cards_nouveau nouveau
 
                # ATI code
-               driver_enable video_cards_r100 radeon
-               driver_enable video_cards_r200 r200
+               dri_driver_enable video_cards_r100 r100
+               dri_driver_enable video_cards_r200 r200
                if ! use video_cards_r100 && \
-                               ! use video_cards_r200; then
-                       driver_enable video_cards_radeon radeon r200
+                       ! use video_cards_r200; then
+                       dri_driver_enable video_cards_radeon r100 r200
                fi
        fi
 
        if use egl; then
-               myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm")"
+               emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm") )
        fi
 
        if use gallium; then
-               myconf+="
-                       $(use_enable d3d9 nine)
-                       $(use_enable llvm)
-                       $(use_enable openmax omx-bellagio)
-                       $(use_enable vaapi va)
-                       $(use_enable vdpau)
-                       $(use_enable xa)
-                       $(use_enable xvmc)
-               "
-               use vaapi && myconf+=" 
--with-va-libdir=/usr/$(get_libdir)/va/drivers"
+               emesonargs+=(
+                       -Dgallium-nine=$(usex d3d9 true false)
+                       -Dllvm=$(usex llvm true false)
+                       -Dgallium-omx=$(usex openmax bellagio disabled)
+                       -Dgallium-va=$(usex vaapi true false)
+                       -Dgallium-vdpau=$(usex vdpau true false)
+                       -Dgallium-xa=$(usex xa true false)
+                       -Dgallium-xvmc=$(usex xvmc true false)
+               )
+               use vaapi && emesonargs+=( 
-Dva-libs-path=/usr/$(get_libdir)/va/drivers )
 
-               gallium_enable swrast
                gallium_enable video_cards_vc4 vc4
                gallium_enable video_cards_vivante etnaviv
                gallium_enable video_cards_vmware svga
@@ -335,17 +320,16 @@ multilib_src_configure() {
                gallium_enable video_cards_r600 r600
                gallium_enable video_cards_radeonsi radeonsi
                if ! use video_cards_r300 && \
-                               ! use video_cards_r600; then
+                       ! use video_cards_r600; then
                        gallium_enable video_cards_radeon r300 r600
                fi
 
                gallium_enable video_cards_freedreno freedreno
                # opencl stuff
                if use opencl; then
-                       myconf+="
-                               $(use_enable opencl)
-                               --with-clang-libdir="${EPREFIX}/usr/lib"
-                               "
+                       emesonargs+=(
+                               -Dgallium-opencl="$(usex opencl standalone 
disabled)"
+                       )
                fi
 
                gallium_enable video_cards_virgl virgl
@@ -353,55 +337,54 @@ multilib_src_configure() {
 
        if use vulkan; then
                vulkan_enable video_cards_i965 intel
-               vulkan_enable video_cards_radeonsi radeon
+               vulkan_enable video_cards_radeonsi amd
        fi
 
        # x86 hardened pax_kernel needs glx-rts, bug 240956
        if [[ ${ABI} == x86 ]]; then
-               myconf+=" $(use_enable pax_kernel glx-read-only-text)"
+               emesonargs+=( -Dglx-read-only-text=$(usex pax_kernel true 
false) )
        fi
 
        # on abi_x86_32 hardened we need to have asm disable
        if [[ ${ABI} == x86* ]] && use pic; then
-               myconf+=" --disable-asm"
+               emesonargs+=( -Dasm=false )
        fi
 
        if use gallium; then
-               myconf+=" $(use_enable osmesa gallium-osmesa)"
+               gallium_enable swrast
+               emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
        else
-               myconf+=" $(use_enable osmesa)"
+               dri_driver_enable swrast
+               emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
        fi
 
-       # build fails with BSD indent, bug #428112
-       use userland_GNU || export INDENT=cat
-
-       ECONF_SOURCE="${S}" \
-       econf \
-               --enable-dri \
-               --enable-glx \
-               --enable-shared-glapi \
-               $(use_enable !bindist texture-float) \
-               $(use_enable d3d9 nine) \
-               $(use_enable debug) \
-               $(use_enable dri3) \
-               $(use_enable egl) \
-               $(use_enable gbm) \
-               $(use_enable gles1) \
-               $(use_enable gles2) \
-               $(use_enable nptl glx-tls) \
-               $(use_enable unwind libunwind) \
-               --enable-valgrind=$(usex valgrind auto no) \
-               --enable-llvm-shared-libs \
-               --disable-opencl-icd \
-               --with-dri-drivers=${DRI_DRIVERS} \
-               --with-gallium-drivers=${GALLIUM_DRIVERS} \
-               --with-vulkan-drivers=${VULKAN_DRIVERS} \
-               PYTHON2="${PYTHON}" \
-               ${myconf}
+       emesonargs+=(
+               -Dbuild-tests=$(usex test true false)
+               -Dglx=dri
+               -Dshared-glapi=true
+               -Dtexture-float=$(usex bindist false true)
+               -Dgallium-nine=$(usex d3d9 true false)
+               -Ddri3=$(usex dri3 true false)
+               -Degl=$(usex egl true false)
+               -Dgbm=$(usex gbm true false)
+               -Dgles1=$(usex gles1 true false)
+               -Dgles2=$(usex gles2 true false)
+               -Dlibunwind=$(usex unwind true false)
+               -Dlmsensors=$(usex lm_sensors true false)
+               -Dvalgrind=$(usex valgrind auto false)
+               -Ddri-drivers=${DRI_DRIVERS}
+               -Dgallium-drivers=${GALLIUM_DRIVERS}
+               -Dvulkan-drivers=${VULKAN_DRIVERS}
+       )
+       meson_src_configure
+}
+
+multilib_src_compile() {
+       meson_src_compile
 }
 
 multilib_src_install() {
-       emake install DESTDIR="${D}"
+       meson_src_install
 
        if use opencl; then
                ebegin "Moving Gallium/Clover OpenCL implementation for dynamic 
switching"
@@ -426,7 +409,6 @@ multilib_src_install() {
 }
 
 multilib_src_install_all() {
-       find "${ED}" -name '*.la' -delete
        einstalldocs
 
        if use !bindist; then
@@ -435,14 +417,7 @@ multilib_src_install_all() {
 }
 
 multilib_src_test() {
-       if use llvm; then
-               local llvm_tests='lp_test_arit lp_test_arit lp_test_blend 
lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format 
lp_test_printf lp_test_printf'
-               pushd src/gallium/drivers/llvmpipe >/dev/null || die
-               emake ${llvm_tests}
-               pax-mark m ${llvm_tests}
-               popd >/dev/null || die
-       fi
-       emake check
+       meson_src_test
 }
 
 pkg_postinst() {
@@ -481,7 +456,7 @@ pkg_prerm() {
 # $1 - VIDEO_CARDS flag
 # other args - names of DRI drivers to enable
 # TODO: avoid code duplication for a more elegant implementation
-driver_enable() {
+dri_driver_enable() {
        case $# in
                # for enabling unconditionally
                1)

Reply via email to