diff options
author | Eli Schwartz <eschwartz@gentoo.org> | 2024-07-12 11:27:23 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@gentoo.org> | 2024-07-12 12:06:56 -0400 |
commit | 92860b9146e02479dd67de74585f3d170f8c03e1 (patch) | |
tree | f17893e6f32afe5670f2f61ed0d5f76d2dec1e87 /media-libs | |
parent | dev-ml/odoc-parser: add 2.4.2 (diff) | |
download | gentoo-92860b9146e02479dd67de74585f3d170f8c03e1.tar.gz gentoo-92860b9146e02479dd67de74585f3d170f8c03e1.tar.bz2 gentoo-92860b9146e02479dd67de74585f3d170f8c03e1.zip |
media-libs/mesa: update NVK rust crate handling to use meson packagecache
We do a bit of a song and a dance to slip rust crates into meson's
subprojects directory and migrate the meson.build files over. But meson
can handle this builtin via:
- `meson subprojects download`
- providing the tarball seeds in the packagecache and relying on
extraction at time of use
It's a bit less fragile than manual extraction because meson guarantees
that patch_directory handling is done and no need to manually
reimplement it in bash. The downside, for the moment, is that previously
the checksums didn't actually match what the meson wraps expected, due
to the differences between crates.io distfiles and github distfiles. So
we cannot rename the files on the mirror to what we want.
Once all the crate versions have been bumped by the passing of time, we
can rename them in SRC_URI and simply use ${MESON_PACKAGE_CACHE_DIR},
new since meson 1.3.0 (we already require 1.4 so that's okay), to tell
meson that it should use wrap tarballs from ${DISTDIR} without any
intervention.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Diffstat (limited to 'media-libs')
-rw-r--r-- | media-libs/mesa/Manifest | 10 | ||||
-rw-r--r-- | media-libs/mesa/mesa-24.1.3.ebuild | 61 | ||||
-rw-r--r-- | media-libs/mesa/mesa-9999.ebuild | 61 |
3 files changed, 67 insertions, 65 deletions
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest index 6e75f97a117c..418a9b83f7e8 100644 --- a/media-libs/mesa/Manifest +++ b/media-libs/mesa/Manifest @@ -1,7 +1,7 @@ DIST mesa-24.0.9.tar.xz 20197892 BLAKE2B 3c68e544898031fe76a57ea754f46ede5b105c259d13dd484eaa63fe51b7d52cf76a4084529b11a586c4d8d06f4cb32f993fd1ea4e6ccc4cbc91e78fe755743a SHA512 de2ee6c9df1fc106ee10befe0a76be1e9cfe83d65dbdb83bad6d8d7cfaa085232fb115293a1a790b37b50b1fe14bd58aafbcfe5a15e953b5901a7105d57569a5 DIST mesa-24.1.3.tar.xz 29086488 BLAKE2B 2e8e4ee98f904aa02f304a6c3cbbb81d04802203e270e6b8ad2b7a62b334ac28f5e91687d7a92501f66b0043255a533d024537ff5ef3f2f03d986e46a7272eeb SHA512 db4071ac80747397023762d6e0355b001f4e942cdc706c67f8aced80e162058667c02a0dc0804a45afc2656cb65d8b16e17148bc03f0a1692067ec170f193c1a -DIST paste-1.0.14.tar.gz 18429 BLAKE2B 88f533fd336bbbe24872b100777703832ff46b52970b94981fea202726de35ac0d3466f96370fa89c966b33e0f13c75cbf7f5f88bba290dc490a63c9e08a0b16 SHA512 0ec40c228afe645cb027a99c8bd8f7c65158aab48655018a45736727906b05f7354df114405f2eae88c4eba73dec62e8228f8be9834afa0f22b5f31c18006d34 -DIST proc-macro2-1.0.70.tar.gz 46747 BLAKE2B 808e3a30c89fd979663899124853d386cc53862621f4d872bba87fe91baccddbc6612bd658b4c18b44f8420fcb10700b2906cde9c9512a616ab800ebbfb0867d SHA512 cd5c41ef6a410e310e90828a33fee42c1e2bf30dfc2b0a0cf429fcc60fa1262393c977b2cab5f8a50a35fd1394fd6cc7e7a482581f88dcde20d9ad030c7414a5 -DIST quote-1.0.33.tar.gz 32169 BLAKE2B 2438915aebe30b79929ddc6ed8bad5282537b081c763a3d6b2b9483b63e7b5e99b9bba6f1f7deb725031b23384410b60c7cc4aef0b00bb1d94541cde54408ee3 SHA512 3c000577d0e9f82bc379570a4fa63283d73cfc6dee0475475ba201994491dece0110cdefc26fcf9a3b9d0bf50a3649ca5b68c8a0f6f2e620946b624ff8b8f38b -DIST syn-2.0.39.tar.gz 286899 BLAKE2B 8bf5e89cb961195b48896294dc876d4e5e81fe7ac1df5330b972e6fdcfa2cf89fd1467f315081f84c1f447d402850e0ab4c7dc2bd20271c5e2bc9a2e3008f70b SHA512 2ee6bb196bef427a9b9aada38fb3a3a11e893c4e9e8808063f544f5c05cda58d554dfea24488dd60b4c299457852b52bf17e5de8595333ff4f2358441964c672 -DIST unicode-ident-1.0.12.tar.gz 50118 BLAKE2B 04e2651e14251d68f4e7e70e1e7a6d5eded21aa4f684c6162a91608189f6dcabaca4aa22204c40e08c82d76773c679ff965f21836264885a3b4cb62d7aa762db SHA512 0d0228bfd8eb6a94d8ae4a003511dd5ad52a58b08d98a8f0a8c5e3dc8b3e6b987ea5009255dc1e9c411f91aec16edc4aaff26ed7a9c48430272f970cd2a9510d +DIST paste-1.0.14.crate 18157 BLAKE2B 35e8548611c51ee75f4d04926149e5e54870d7073d9b635d550a6fa0f85891f57f326bdbcff3dd8618cf40f8e08cf903ef87d9c034d5921d8b91e1db842cdd7c SHA512 3a793f0e5e773a7f7defc798a4c17ae9a40d715144632ea6cb0a8c785e14c4212046491df016bb9838281f8eaf327a79f01c1e2ac5f26785c028bc880faff9ee +DIST proc-macro2-1.0.70.crate 44343 BLAKE2B fff0dec06b21e391783cc136790238acb783780eaedcf14875a350e7ceb46fdc100c8b9e3f09fb7f4c2196c25d4c6b61e574c0dad762d94533b628faab68cf5c SHA512 ae9366856853f7d96caf7a7581843d36bfc7843f8683897b19ffc666c03b0b1eff502ddb18ca4c1c1a239a368f03f6cc258b0e2795f64b61c6a31404462eec5f +DIST quote-1.0.33.crate 28090 BLAKE2B 77c4b166f1200e1ee2ab94a5014acd334c1fe4b7d72851d73768d491c56c6779a0882a304c1f30c88732a6168351f0f786b10516ae537cff993892a749175848 SHA512 c1e76c3c017e8554eebe309f8167fd56fce931981c06798aa85a0cc6d64a9cba6ab103f5a1324e69c6f9ca5dc47a8e31ff2e847850542748697afcd265b5939c +DIST syn-2.0.39.crate 244129 BLAKE2B 2cff6626624d03f70f1662af45a8644c28a9f92e2dfe38999bef3ba4a4c1ce825ae598277e9cb7abd5585eebfb17b239effc8d0bbf1c6ac196499f0d288e5e01 SHA512 96cc347cfdb0f9ca0b6c7289279a1cad8fc401625783742292564f7ceca8237ced8d9a3f62069696f6132ed06092dff2baaf4be09ef53b21260d93785b0e27c3 +DIST unicode-ident-1.0.12.crate 42168 BLAKE2B 4cede03c08758ccd6bf53a0d0057d7542dfdd0c93d342e89f3b90460be85518a9fd24958d8b1da2b5a09b5ddbee8a4263982194158e171c2bba3e394d88d6dac SHA512 bc1824e1e4452a40732fc69874d7e1a66f7803717a314790dcf48867eba34bc9441331ef031e386912e52c385645c25b6ed39d4f149973b5b97371b1b96b1920 diff --git a/media-libs/mesa/mesa-24.1.3.ebuild b/media-libs/mesa/mesa-24.1.3.ebuild index c184d9ab1e76..9a583c95d8ec 100644 --- a/media-libs/mesa/mesa-24.1.3.ebuild +++ b/media-libs/mesa/mesa-24.1.3.ebuild @@ -5,40 +5,43 @@ EAPI=8 LLVM_COMPAT=( {15..18} ) LLVM_OPTIONAL=1 +CARGO_OPTIONAL=1 PYTHON_COMPAT=( python3_{10..12} ) inherit flag-o-matic llvm-r1 meson-multilib python-any-r1 linux-info rust-toolchain toolchain-funcs MY_P="${P/_/-}" -SYN_PV=2.0.39 -PROC_MACRO2_PV=1.0.70 -QUOTE_PV=1.0.33 -UNICODE_IDENT_PV=1.0.12 -PASTE_PV=1.0.14 - -NAK_URI=" - https://github.com/dtolnay/syn/archive/refs/tags/${SYN_PV}.tar.gz -> syn-${SYN_PV}.tar.gz - https://github.com/dtolnay/proc-macro2/archive/refs/tags/${PROC_MACRO2_PV}.tar.gz -> proc-macro2-${PROC_MACRO2_PV}.tar.gz - https://github.com/dtolnay/quote/archive/refs/tags/${QUOTE_PV}.tar.gz -> quote-${QUOTE_PV}.tar.gz - https://github.com/dtolnay/unicode-ident/archive/refs/tags/${UNICODE_IDENT_PV}.tar.gz -> unicode-ident-${UNICODE_IDENT_PV}.tar.gz - https://github.com/dtolnay/paste/archive/refs/tags/${PASTE_PV}.tar.gz -> paste-${PASTE_PV}.tar.gz +CRATES=" + syn@2.0.39 + proc-macro2@1.0.70 + quote@1.0.33 + unicode-ident@1.0.12 + paste@1.0.14 " +inherit cargo + DESCRIPTION="OpenGL-like graphic library for Linux" HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/" if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git" - SRC_URI="${NAK_URI}" inherit git-r3 else SRC_URI=" https://archive.mesa3d.org/${MY_P}.tar.xz - ${NAK_URI} " KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-solaris" fi + +# This should be {CARGO_CRATE_URIS//.crate/.tar.gz} to correspond to the wrap files, +# but there are "stale" distfiles on the mirrors with the wrong names. +# export MESON_PACKAGE_CACHE_DIR="${DISTDIR}" +SRC_URI+=" + ${CARGO_CRATE_URIS} +" + S="${WORKDIR}/${MY_P}" EGIT_CHECKOUT_DIR=${S} @@ -186,8 +189,20 @@ x86? ( )" src_unpack() { - [[ ${PV} == 9999 ]] && git-r3_src_unpack - unpack ${A} + if [[ ${PV} == 9999 ]]; then + git-r3_src_unpack + else + unpack ${MY_P}.tar.xz + fi + + # We need this because we cannot tell meson to use DISTDIR yet + pushd "${DISTDIR}" >/dev/null || die + mkdir -p "${S}"/subprojects/packagecache || die + local i + for i in *.crate; do + ln -s "${PWD}/${i}" "${S}/subprojects/packagecache/${i/.crate/}.tar.gz" || die + done + popd >/dev/null || die } pkg_pretend() { @@ -282,20 +297,6 @@ src_prepare() { default sed -i -e "/^PLATFORM_SYMBOLS/a '__gentoo_check_ldflags__'," \ bin/symbols-check.py || die # bug #830728 - - if use video_cards_nvk; then - # NVK Subproject Handling - pushd "${S}" >/dev/null || die - for subpkg in proc-macro2-${PROC_MACRO2_PV} syn-${SYN_PV} quote-${QUOTE_PV} unicode-ident-${UNICODE_IDENT_PV} paste-${PASTE_PV}; do - # copy subprojects folder - cp -r ../${subpkg} subprojects || die - # copy meson.build - cp subprojects/packagefiles/${subpkg%-*}/meson.build subprojects/${subpkg} || die - # ovewrite subpkg version when needed - sed -i -e "s/directory = \S\+/directory = ${subpkg}/" subprojects/${subpkg%-*}.wrap || die - done - popd >/dev/null || die - fi } multilib_src_configure() { diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index c184d9ab1e76..9a583c95d8ec 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -5,40 +5,43 @@ EAPI=8 LLVM_COMPAT=( {15..18} ) LLVM_OPTIONAL=1 +CARGO_OPTIONAL=1 PYTHON_COMPAT=( python3_{10..12} ) inherit flag-o-matic llvm-r1 meson-multilib python-any-r1 linux-info rust-toolchain toolchain-funcs MY_P="${P/_/-}" -SYN_PV=2.0.39 -PROC_MACRO2_PV=1.0.70 -QUOTE_PV=1.0.33 -UNICODE_IDENT_PV=1.0.12 -PASTE_PV=1.0.14 - -NAK_URI=" - https://github.com/dtolnay/syn/archive/refs/tags/${SYN_PV}.tar.gz -> syn-${SYN_PV}.tar.gz - https://github.com/dtolnay/proc-macro2/archive/refs/tags/${PROC_MACRO2_PV}.tar.gz -> proc-macro2-${PROC_MACRO2_PV}.tar.gz - https://github.com/dtolnay/quote/archive/refs/tags/${QUOTE_PV}.tar.gz -> quote-${QUOTE_PV}.tar.gz - https://github.com/dtolnay/unicode-ident/archive/refs/tags/${UNICODE_IDENT_PV}.tar.gz -> unicode-ident-${UNICODE_IDENT_PV}.tar.gz - https://github.com/dtolnay/paste/archive/refs/tags/${PASTE_PV}.tar.gz -> paste-${PASTE_PV}.tar.gz +CRATES=" + syn@2.0.39 + proc-macro2@1.0.70 + quote@1.0.33 + unicode-ident@1.0.12 + paste@1.0.14 " +inherit cargo + DESCRIPTION="OpenGL-like graphic library for Linux" HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/" if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git" - SRC_URI="${NAK_URI}" inherit git-r3 else SRC_URI=" https://archive.mesa3d.org/${MY_P}.tar.xz - ${NAK_URI} " KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-solaris" fi + +# This should be {CARGO_CRATE_URIS//.crate/.tar.gz} to correspond to the wrap files, +# but there are "stale" distfiles on the mirrors with the wrong names. +# export MESON_PACKAGE_CACHE_DIR="${DISTDIR}" +SRC_URI+=" + ${CARGO_CRATE_URIS} +" + S="${WORKDIR}/${MY_P}" EGIT_CHECKOUT_DIR=${S} @@ -186,8 +189,20 @@ x86? ( )" src_unpack() { - [[ ${PV} == 9999 ]] && git-r3_src_unpack - unpack ${A} + if [[ ${PV} == 9999 ]]; then + git-r3_src_unpack + else + unpack ${MY_P}.tar.xz + fi + + # We need this because we cannot tell meson to use DISTDIR yet + pushd "${DISTDIR}" >/dev/null || die + mkdir -p "${S}"/subprojects/packagecache || die + local i + for i in *.crate; do + ln -s "${PWD}/${i}" "${S}/subprojects/packagecache/${i/.crate/}.tar.gz" || die + done + popd >/dev/null || die } pkg_pretend() { @@ -282,20 +297,6 @@ src_prepare() { default sed -i -e "/^PLATFORM_SYMBOLS/a '__gentoo_check_ldflags__'," \ bin/symbols-check.py || die # bug #830728 - - if use video_cards_nvk; then - # NVK Subproject Handling - pushd "${S}" >/dev/null || die - for subpkg in proc-macro2-${PROC_MACRO2_PV} syn-${SYN_PV} quote-${QUOTE_PV} unicode-ident-${UNICODE_IDENT_PV} paste-${PASTE_PV}; do - # copy subprojects folder - cp -r ../${subpkg} subprojects || die - # copy meson.build - cp subprojects/packagefiles/${subpkg%-*}/meson.build subprojects/${subpkg} || die - # ovewrite subpkg version when needed - sed -i -e "s/directory = \S\+/directory = ${subpkg}/" subprojects/${subpkg%-*}.wrap || die - done - popd >/dev/null || die - fi } multilib_src_configure() { |