From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id JgclH9eRCGWWdwAAG6o9tA:P1 (envelope-from ) for ; Mon, 18 Sep 2023 20:07:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id JgclH9eRCGWWdwAAG6o9tA (envelope-from ) for ; Mon, 18 Sep 2023 20:07:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2CD5F60354 for ; Mon, 18 Sep 2023 20:07:19 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=HAaPW2na; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695060439; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=X6y7F263pQ9DetoUxcmjgz6mDWXsO5xe8gxWGITXaR8=; b=ug29eh10LoyGJBkFYePppdYvfWcD+SIdgQ5N8M8GMkDWwucw73YYrKidzASyQFL+RdVdmk KFZOIDisfyN4biR0V6tqCoTVKkU+Bt4qed+mHYAo+qity4sbjxoPPS9USbZtVSze/iG6lO IB+Q8bBXMltnWmdAqnx4Ta6QRzP0chUjmtINYnj/EoMGZ61444lKSjZadBA+JVQjkndD3c kLegkqrY6Cg4SRhK16KzziDU/jw0wt7rmk8VzTs+wanNSA8iYNxlg6wYSeh7mxZtof0CQl vJ5gGjOMJAK53wuxwouMfvq+sG9dlf3NOI3rtt5KL3RDkP0bsS1dwEXiU3yBJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=HAaPW2na; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695060439; a=rsa-sha256; cv=none; b=FohcYoeSQGc+o4vvH7FAQYFowIOZbSAD3gGLFok3z19NrwLXUNL/r8pq0iWwhv+8gO/a+s 0mYV6mMHKPHZy+alLiVA9dEQrUwtkmMCwlIH4eA2E9E5k1C5O2rGxVJsgfKK+anRm7U9ZQ sddphV28qo5pSwUcu1RBko542gtvpovjhX+GYPr/wsb8NtSQJG+v4uDYUZys/hz2aq4aQr wnfV8ZnEJxQMIpJgk55YujU+KizC0I5kLPndnv57ePzkEis+24/grB82DigwXup6DW6nYO rFlqQDQnp0ix5xc7I7wzBFSCwpO4bbPseEtRGMe7RjnL6QzpfUGTEbBDPk0Qrw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiId6-0004MU-T4; Mon, 18 Sep 2023 14:05:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiIcG-0003FW-32 for guix-patches@gnu.org; Mon, 18 Sep 2023 14:05:00 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiIcF-0003ZT-QR for guix-patches@gnu.org; Mon, 18 Sep 2023 14:04:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiIcN-0002Or-TZ for guix-patches@gnu.org; Mon, 18 Sep 2023 14:05:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62202] [PATCH v2 15/23] DRAFT import: juliahub: Add support for versions for juliahub-fetch. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 18 Sep 2023 18:05:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62202 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: 62202@debbugs.gnu.org Cc: zimon.toutoune@gmail.com X-Debbugs-Original-Cc: Nicolas Graves via Guix-patches via , Simon Tournier Received: via spool by 62202-submit@debbugs.gnu.org id=B62202.16950602578900 (code B ref 62202); Mon, 18 Sep 2023 18:05:07 +0000 Received: (at 62202) by debbugs.gnu.org; 18 Sep 2023 18:04:17 +0000 Received: from localhost ([127.0.0.1]:54395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiIbY-0002JO-RD for submit@debbugs.gnu.org; Mon, 18 Sep 2023 14:04:17 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:38975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiIbJ-0002Es-3U for 62202@debbugs.gnu.org; Mon, 18 Sep 2023 14:04:04 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-404800222d2so8773835e9.0 for <62202@debbugs.gnu.org>; Mon, 18 Sep 2023 11:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695060227; x=1695665027; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X6y7F263pQ9DetoUxcmjgz6mDWXsO5xe8gxWGITXaR8=; b=HAaPW2nag7f0ZAhqk3i7vgGpj+96vICdiKpfjLSxmPaq8MLvdvsXpZSnXUZ1jsXoc1 rpFV/aRK8j/vRsjMBtT9p3MWhOaKrvH2FDX2h3g2H9xLkMgyK2hnK+OperGadkceLf+U JkJpmij8Jy+a5KF25rfLbbeq0Pp7gbzcTf8kHAQo2GnQ8GKmVlKptxRN71WbH4KJQUJM YsT8nmVp9nINQX8z/6oSKZxcTKl3wRt518U/Q2EKaHnlsu+JBH1w17J992jJb+16vxXL +dOz326OxnG/tOyiL2FJbn6bl4CKQQkeMSteed1sxu0hghkWaQva3EaGf08GyhCviPVX H0tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695060227; x=1695665027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X6y7F263pQ9DetoUxcmjgz6mDWXsO5xe8gxWGITXaR8=; b=wOmUf/qgBDw6rsKvQXykNPIDVLLQWvK6OSMGyb+oHY1JKv5lo9IsTn+GjDmS6E7Fw7 sxBySXxj+sv9YwoPiGdEY57FM5S/x3kC32QM3l1E+PH/Qa6wy7/VlhBhbu6t0esHnybD qeS2WZfA5qTkLuKoQcNoK7LNPO7Y8VdKhSEcRRkxzNbBGyRimNbxmekKiNRHAXOVZj0F zch9SjTCDNpygCwI+9t21Sfl7/jgNib3b59AoNfgQRfP/qB586vlvaAZxibYb2ZtwS3z yBbSdjzV5H3wHbUz2D5MYPAw524fLQ/cNd+Gsfygs3lM1Hov4z+s3oVmMNJJDuzJQFDU 5+mA== X-Gm-Message-State: AOJu0YwWMVMMFhH7d0BSuubYudQkc1DfDHOs7x4G5QvWZhdtkCDSg9uJ 0zNCKhKkrpBFDzUR1PeYfUTRyvIH7uw= X-Google-Smtp-Source: AGHT+IEpycZYk8lE6bBUr+8ABxBDIacvi6yhbFtVuK87B/LXxq+PSX+xp5PdkARV4OKxZPgjUxpPzQ== X-Received: by 2002:a5d:508e:0:b0:317:73e3:cf41 with SMTP id a14-20020a5d508e000000b0031773e3cf41mr7498521wrt.1.1695060226980; Mon, 18 Sep 2023 11:03:46 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id z2-20020adfd0c2000000b0030ada01ca78sm2210465wrh.10.2023.09.18.11.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 11:03:46 -0700 (PDT) From: Simon Tournier Date: Mon, 18 Sep 2023 20:03:22 +0200 Message-Id: <1fef7a18856fd9670be3746e6f3579a8be39163e.1695060058.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: 0.19 X-Spam-Score: 0.19 X-Migadu-Queue-Id: 2CD5F60354 X-TUID: NXIIU7cFFcEy From: Nicolas Graves via Guix-patches via Signed-off-by: Simon Tournier --- guix/import/juliahub.scm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm index b646f9329562..6ce0487dba38 100644 --- a/guix/import/juliahub.scm +++ b/guix/import/juliahub.scm @@ -122,7 +122,7 @@ (define %julia-stdlibs "Pkg" "LazyArtifacts")) -(define (juliahub-uri name) +(define (juliahub-redirect-uri name) (let* ((url (string-append "https://docs.juliahub.com/" name "/")) (port (http-fetch url #:text? #t)) (_ (get-line port)) @@ -134,11 +134,11 @@ (define (juliahub-uri name) (define (juliahub-url name) (let* ((url (string-append "https://docs.juliahub.com/" name "/")) - (uri (juliahub-uri name))) + (uri (juliahub-redirect-uri name))) (string-append url uri "/"))) -(define (juliahub-slug-version name) - (let* ((uri (juliahub-uri name)) +(define (juliahub-slug+version name) + (let* ((uri (juliahub-redirect-uri name)) (slug (string-take uri 5)) (latest-version (string-drop uri 6))) `(,slug ,latest-version))) @@ -203,8 +203,12 @@ (define (julia-name->guix-name name) (define* (juliahub-fetch name #:key (version #f)) "Return a record for package NAME, or #f on failure." - (and=> (json-fetch (string-append (juliahub-url name) "pkg.json")) - json->juliahub-package)) + (let ((url (if version + (string-append "https://docs.juliahub.com/" name "/" + (car (juliahub-slug+version name)) "/" + version "/pkg.json") + (string-append (juliahub-url name) "pkg.json")))) + (and=> (json-fetch url) json->juliahub-package))) (define (make-julia-sexp name source home-page synopsis description direct-dependencies test-dependencies-names licenses) @@ -242,9 +246,9 @@ (define* (juliahub->guix-package package-name (subdir (assoc-ref package-toml 'subdir)) (tag (latest-git-tag (assoc-ref package-toml 'repo))) (package (if version - (juliahub-fetch package-name version) + (juliahub-fetch package-name #:version version) (if tag - (juliahub-fetch package-name tag) + (juliahub-fetch package-name #:version tag) (juliahub-fetch package-name))))) (if package (let-values (((source directory) -- 2.38.1