media-libs/libglvnd: Convert to Meson
authorMatt Turner <mattst88@gentoo.org>
Thu, 5 Dec 2019 21:37:54 +0000 (16:37 -0500)
committerMatt Turner <mattst88@gentoo.org>
Thu, 5 Dec 2019 22:29:33 +0000 (17:29 -0500)
Also add ~ppc ~ppc64 ~x86 keywords, for platforms where I've run the
test suite.

Signed-off-by: Matt Turner <mattst88@gentoo.org>
media-libs/libglvnd/libglvnd-9999.ebuild

index 877b89fb3094811575cad387aa0ae91e536a873c..1905bb39e78e3e928a33048fbc3d23d5bd612aed 100644 (file)
@@ -9,24 +9,27 @@ if [[ ${PV} = 9999* ]]; then
        GIT_ECLASS="git-r3"
 fi
 
-PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
-inherit autotools ${GIT_ECLASS} multilib-minimal python-any-r1
+PYTHON_COMPAT=( python3_{5,6,7,8} )
+VIRTUALX_REQUIRED=manual
+
+inherit ${GIT_ECLASS} meson multilib-minimal python-any-r1 virtualx
 
 DESCRIPTION="The GL Vendor-Neutral Dispatch library"
 HOMEPAGE="https://gitlab.freedesktop.org/glvnd/libglvnd"
 if [[ ${PV} = 9999* ]]; then
        SRC_URI=""
 else
-       KEYWORDS="~amd64"
-       COMMIT=""
-       SRC_URI="https://github.com/NVIDIA/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
-       S=${WORKDIR}/${PN}-${COMMIT}
+       KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+       SRC_URI="https://gitlab.freedesktop.org/glvnd/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2 -> ${P}.tar.bz2"
+       S=${WORKDIR}/${PN}-v${PV}
 fi
 
 LICENSE="MIT"
 SLOT="0"
-IUSE="X"
+IUSE="test X"
 
+BDEPEND="${PYTHON_DEPS}
+       test? ( X? ( ${VIRTUALX_DEPEND} ) )"
 RDEPEND="
        !media-libs/mesa[-libglvnd(-)]
        !<media-libs/mesa-19.2.2
@@ -34,28 +37,29 @@ RDEPEND="
                x11-libs/libX11[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
        )"
-DEPEND="${PYTHON_DEPS}
-       ${RDEPEND}
+DEPEND="${RDEPEND}
        X? ( x11-base/xorg-proto )"
 
-src_prepare() {
-       default
-       [[ $PV = 9999* ]] && eautoreconf
-}
-
 multilib_src_configure() {
-       myconf=(
-               $(use_enable X x11)
-               $(use_enable X glx)
+       local emesonargs=(
+               $(meson_feature X x11)
+               $(meson_feature X glx)
        )
-       ECONF_SOURCE=${S} econf "${myconf[@]}"
+       meson_src_configure
 }
 
-multilib_src_install() {
-       default
-       find "${D}" -name '*.la' -delete || die
+multilib_src_compile() {
+       meson_src_compile
 }
 
 multilib_src_test() {
-       emake check
+       if use X; then
+               virtx meson_src_test
+       else
+               meson_src_test
+       fi
+}
+
+multilib_src_install() {
+       meson_src_install
 }