diff mbox series

[PATCHV2,4/5] devtool: add support for multiple git url inside a cargo based recipe

Message ID eaf66cf5064cbc92f0f643d42a266927f0c502a0.1679842454.git.frederic.martinsons@gmail.com
State Accepted, archived
Commit 474658a3681c343385c359a21c3693401217298d
Headers show
Series [PATCHV2,1/5] cargo_common.bbclass: Support local github repos | expand

Commit Message

Frédéric Martinsons March 26, 2023, 2:56 p.m. UTC
From: Frederic Martinsons <frederic.martinsons@gmail.com>

Without that, the possible git urls that are in SRC_URI of a recipe
are removed from SRC_URI during devtool process and so the
cargo_common_do_patch_paths in cargo_common.bbclass cannot
patch these packages to fetch them locally.

I use a generic type name because I foresee this change will
be useful for recipe that used a package manager (cargo but also
npm) see https://bugzilla.yoctoproject.org/show_bug.cgi?id=11015

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
---
 meta/classes/externalsrc.bbclass                       | 4 +---
 meta/recipes-extended/rust-example/zvariant-crates.inc | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 26c5803ee6..b00fdba8e9 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -68,9 +68,7 @@  python () {
         for url in fetch.urls:
             url_data = fetch.ud[url]
             parm = url_data.parm
-            if (url_data.type == 'file' or
-                    url_data.type == 'npmsw' or url_data.type == 'crate' or
-                    'type' in parm and parm['type'] == 'kmeta'):
+            if url_data.type in ['file', 'npmsw', 'crate'] or parm.get('type') in ['kmeta', 'git-dependency']:
                 local_srcuri.append(url)
 
         d.setVar('SRC_URI', ' '.join(local_srcuri))
diff --git a/meta/recipes-extended/rust-example/zvariant-crates.inc b/meta/recipes-extended/rust-example/zvariant-crates.inc
index 297a784661..41f50b1b0c 100644
--- a/meta/recipes-extended/rust-example/zvariant-crates.inc
+++ b/meta/recipes-extended/rust-example/zvariant-crates.inc
@@ -125,9 +125,9 @@  SRC_URI += " \
     crate://crates.io/winnow/0.4.0 \
     crate://crates.io/zvariant_derive/3.12.0 \
     crate://crates.io/zvariant_utils/1.0.0 \
-    git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib \
-    git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys \
-    git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys \
+    git://github.com/gtk-rs/glib;protocol=https;nobranch=1;name=glib;destsuffix=glib;type=git-dependency \
+    git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=glib-sys;destsuffix=glib-sys;subpath=glib-sys;type=git-dependency \
+    git://github.com/gtk-rs/sys;protocol=https;nobranch=1;name=gobject-sys;destsuffix=gobject-sys;subpath=gobject-sys;type=git-dependency \
 "
 
 SRCREV_FORMAT .= "_glib"