From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 16 Apr 2026 15:09:59 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wr1-f55.google.com (mail-wr1-f55.google.com [209.85.221.55]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 63GD9whu030781 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Apr 2026 15:09:59 +0200 Received: by mail-wr1-f55.google.com with SMTP id ffacd0b85a97d-43d177fb157sf7672381f8f.0 for ; Thu, 16 Apr 2026 06:09:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1776344993; cv=pass; d=google.com; s=arc-20240605; b=HlwoebkopCSDtfQFy81Cia63B/Rpj/8VBCVTPhF8rmpHXssOeBlhOPUH2R2YiVg9bb mrHy2pMNUMLUFp7CpyPMt2KjPyKsZc6JIi9YuikFLmnruFE6gfm/9rXQiKoagijkNPqx BQ5LiJIseU4sBWNIThYPesp90yZMHhrI4U1yAm8MR8RejtFS0zFGuNvr/jJ6qTlha19G y4BmLHPElqX1YV7A8SRPOm3fPu+zFgH6VtaWRh6UYWrZnwYXLJ0EqjdRbebzBhAYv3Px unc4oawUBmVRGqHFbEIA8Ytm5CH/Dst4Nr+y3nC6ijwFAYXfeFk7mZYQXMC6vyvbtJ/a Yfww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:dkim-signature; bh=hL05Fq+eoHAAmb98Hq7Ngma9U3XtdQFtRvzMOyHcDCA=; fh=9VlUARs7uhC3FU6a45Wn8GLzMWPZduBws++nF+3rMQE=; b=Jmh6deMY2ww1pZ48oayk//cl6Qiokfo7iARSFMVctxFn2n/9WxTG35nCGtyAkIHGfe em/U/fnEwdTsAWY3055YnJa8ioNxjYE37+RQVfQHArkTElw5KImCAek2yGA8Cs66SEfy Kq0ASIUFEgEd+oBzuOG7uGhf8sePRF4XAIW+RUC0VMwMsnGtYy5L79cr1e/+Oh+Eg7Zq 9hpq1Td0IdJwBbuLy5fFPCzzpMSltnMkULfAVDdYUciSgaCzei13c91ijnZTiCral1W+ ngBBpOxZ6oxpwVsPyFkN7dUXqi8cDOzJR3sEUWTlHB7AN/+AqW9mSRAK2uxvIdlzjvJP Fleg==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1776344993; x=1776949793; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:in-reply-to:from:content-language:references:to :subject:user-agent:mime-version:date:message-id:sender:from:to:cc :subject:date:message-id:reply-to; bh=hL05Fq+eoHAAmb98Hq7Ngma9U3XtdQFtRvzMOyHcDCA=; b=D5El7QpsWskQ/JlnhxpzlYhBsHQrN7C5Ved5oBeG/EYzhnMThZwNa6hl09aTa8NO7T +QMS8/Jyflxb8pfUXzsuPpdRqOO+QUQP4GVIWCh/iVLxacsO48ECki57doOM44ZywP14 A4gF3FUfYxnXQMNcmz1oNjZSrNxgbb3uymKOvksIuGzlqaAG/PRrLwK1VFhrjt8beahD jCWEESIYSY/GTCiPVyp09p7iQctZw2JV51Xe1zYVVMAs4wVHtDGidTq6VKfRgoYs/Hod E+KlPPGGqcyqCZa6O7guAXcyZ8FbxYKWfcDbcj7zH5LgN89q4vE/AOnBn1wrkwiD5gKr /tKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776344993; x=1776949793; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:in-reply-to :from:content-language:references:to:subject:user-agent:mime-version :date:message-id:x-beenthere:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=hL05Fq+eoHAAmb98Hq7Ngma9U3XtdQFtRvzMOyHcDCA=; b=MyOHirNtt/E1QqFn0gBUT8gLuOns34hOXbROUaNmWz7/EhHD4MQyYx0BH7ImULk0bL d9A7a8k3Hh2y3ea+1ebyTXAS+2kuJeVP72OKgk259jAdRxKtE+XmWQPWqEgjQvK0CFDp 8khARRX+Xxp+mzIW7ERjcKkFDUYuDt2gC8d2IKsnkxT/mS/LJ6mAWijb2poVbO+zICv0 HT6Qx1+QnXUlp+C06ALIj+nLndNtf0HRFZ1N6npkG/ITeG+IND7FKpJntN5KcERp95S8 0td9QmL0/q0xqCM+hODrkTzNfUQP/BbS3dI5SZGYLcrnjkWTukgPVqqZ8g+BngJcMb/7 81OA== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AFNElJ8WVppwL1w0g/I0Gwdw/5+4Fd1OduER+2Vw62BxH07ssEJPXmBz7Z5RZx19uN4iHDXuLdr6@ilbers.de X-Gm-Message-State: AOJu0Yx6OIRNWDKeSP4s/BCOuH0plXduc6dj8TdCtuBmLRm9XK3HhOay G1GsRninNT+ujPX/JeKw9O4CX7SpZRbkqRDVhypHcG+NMpqFf3muTUuM X-Received: by 2002:a05:6000:26c4:b0:439:ac6b:dd38 with SMTP id ffacd0b85a97d-43d642ab99bmr37115309f8f.31.1776344992789; Thu, 16 Apr 2026 06:09:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="AYAyTiLdpu23Bd2aVn6kjHE8/JsyknOhfLJCRSKDDSCEtF2v0Q==" Received: by 2002:a05:6000:602:b0:43e:ad46:1485 with SMTP id ffacd0b85a97d-43eb1c569ecls728827f8f.1.-pod-prod-06-eu; Thu, 16 Apr 2026 06:09:50 -0700 (PDT) X-Received: by 2002:a05:6000:186e:b0:43b:8f38:3b88 with SMTP id ffacd0b85a97d-43d642a989bmr39022354f8f.25.1776344989125; Thu, 16 Apr 2026 06:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776344989; cv=none; d=google.com; s=arc-20240605; b=Hd1DhQQDPvo9t2Xkia5Zo5EyvWmJKvZg1x3h1BwYtOFIWktjVA0JvbbXXZivGAcPxV Ip3kySE/Wvv/hQterL5g5KkywSkvMoFVhQ/fUUJibYiwxJx9nOLE8J6G9H77P7zjVy2E XAIzMu3ijwuVJDYgh419n7dnVTFf+yRruRBIeD1qk6NANu/echGnX61mQVT8SlQilCww ShUksu6YV1WB5uP/6efi4OA8dLbJ9hNtH41Mr0q8NYxxfCmLwTUHOmtgOhbipG28RFBd 6b0iAwVFZP9m831Jf8Ni4VIDm64YxzfcFcGJXX0mlFi/Z58lux+Rj0LbpgyZGntA+DWn aMRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id; bh=98DGO1oEX+H+LFNjgBWyANnIPns6YjjeajRI9FgsXRc=; fh=ED/5bHbRoWsBBumyfe/s1JVi85O62cQUG3TEgS33VV8=; b=cAccG8DuJzG60YbZJDb/QMlQ5m+3rSyq1FbxkdKD/t5RGyDVXfdQF51JuUwPp40VdA WHVmbTsfMm88cwKLNXVa9Wq8yHSfHN+Dj4QGXjKRuDvKDypMktF4GbBG1jbsy/0VoCYF bkZlJ4+o3GFbsg4JhwRgo/Ldrjw/dpQjr5Ear4avs5DCeFNA7tFD3YPLHfRY9kyZwOAV jQ0sdiKJlirPRJSZwkyfGncUK+cQsv6ZNlJglzHrzZFhK/+AkDzLnpIQjckk0jaQvH+3 T6KDWm+efUXxuaC86DKDixj0Ut7aoK3+V5wOeOpSgOhT80ppU4G/Xnej21BJe8SwTdHa OfHQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-43ead2db229si84824f8f.0.2026.04.16.06.09.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Apr 2026 06:09:49 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 63GD9lK5030768 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Apr 2026 15:09:48 +0200 Message-ID: Date: Thu, 16 Apr 2026 16:09:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] Add script to generate a recipe for cargo.io crates To: isar-users@googlegroups.com, Gylstorff Quirin References: <20260331081019.32111-1-Quirin.Gylstorff@siemens.com> <20260331081019.32111-2-Quirin.Gylstorff@siemens.com> Content-Language: en-US, ru-RU From: Anton Mikanovich In-Reply-To: <20260331081019.32111-2-Quirin.Gylstorff@siemens.com> Content-Type: text/plain; charset="UTF-8"; format=flowed X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: cJa3Eq6bwhyV 31.03.2026 11:10, 'Quirin Gylstorff' via isar-users wrote: > From: Quirin Gylstorff > > This script allows to create a recipe for building rust crates which > are not part of Debian. It uses for this `debcargo package` and follows > the process defined in https://rust-team.pages.debian.net/book. > > Signed-off-by: Quirin Gylstorff > --- > scripts/generate_cargo_crate.sh | 88 +++++++++++++++++++++++++++++++++ > 1 file changed, 88 insertions(+) > create mode 100755 scripts/generate_cargo_crate.sh > > diff --git a/scripts/generate_cargo_crate.sh b/scripts/generate_cargo_crate.sh > new file mode 100755 > index 00000000..727f7f0e > --- /dev/null > +++ b/scripts/generate_cargo_crate.sh > @@ -0,0 +1,88 @@ > +#!/bin/bash > +# This software is a part of ISAR. > +# Copyright (C) 2026 Siemens AG > + > +usage() { > + echo "This script generates a scaffold for rust crates from crates.io." > + echo "It uses debcargo to download and generate the debian folder." > + echo "USAGE: $0 [CRATE_VERSION]" > +} > + > +if [ $# -eq 0 ]; then > + usage > + exit 1 > +fi > +case $1 in > + -h|--help) > + usage > + exit 0 > + ;; > + *) > + true > + ;; > +esac > + > +package_name=$1 > +package_version= > +if [ $# -gt 1 ]; then > + package_version=$2 > +fi > + > +export NAME="isar-users isar" > + > +for dep in jq debcargo curl; do > + if ! command -v "$dep" ;then > + echo "Could not find tool dependency $dep !" > + exit 1 > + fi > +done > + > +source_name="rust-$package_name" > +mkdir -p "$source_name/files" > +# generate in the current directory to avoid the following > +# debcargo error: > +# Invalid cross-device link (os error 18) > +TMP_DIR=$(mktemp -d -p .) > +pushd "$source_name" || exit 1 > +debcargo package "$package_name" "$package_version" --directory "$TMP_DIR" > +cp -r "${TMP_DIR}"/debian files/ > +if [ -z "$package_version" ]; then > + package_version=$(grep -oP "X-Cargo-Crate-Version:\K.*" "${TMP_DIR}"/debian/control | tr -d "[:blank:]") > +fi > +rm -rf "$TMP_DIR" > +tarball_checksum="$(curl --silent "https://crates.io/api/v1/crates/${package_name}/${package_version}" | jq ".version.checksum" )" > +if [ "${tarball_checksum}" = "null" ] ; then > + echo "$package_name in $package_version could not be found in crates.io" > + exit 1 > +fi > +cat << EOF >> "${source_name}_${package_version}".bb > +# Created by generate_cargo_crate.sh. > +# SPDX-License-Identifier: MIT-0 > + > +inherit dpkg > + > +SRC_URI = "https://crates.io/api/v1/crates/${package_name}/\${PV}/download;downloadfilename=${PN}_${PV}.tar.gz" > +SRC_URI += "file://debian" > + > +SRC_URI[sha256sum] = ${tarball_checksum} > + > +S = "\${WORKDIR}/${package_name}-\${PV}" > + > +# In most cases we want to package a library crate from crates.io > +PROVIDES += "librust-${package_name}-dev" > + > +do_prepare_build() { > + cp -r \${WORKDIR}/debian \${S}/ > + cd \${WORKDIR} > + tar cJf \${PN}_\${PV}.orig.tar.xz \${TAR_REPRO_OPTS} ${package_name}-\${PV} > +} > +EOF > + > + > +popd || exit 1 > + > +echo "Finished generating isar scaffold for package $package_name in version $package_version" > +echo "" > +echo "Next steps:" > +echo " - Check if the package builds and add the necessary patches, e.g. relax dependencies to the debian folder." > +echo " - Also add the package to Debian by following https://rust-team.pages.debian.net/book/" Hello Quirin, Bitbake is already support cargo fetching with SRC_URI like "crate://crates.io/name/${package_name}/${PV}". Maybe it will be more clear? -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/a836449c-384f-4a1f-8f34-55f9e64d3305%40ilbers.de.