From patchwork Sun Feb 11 18:28:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Abramov X-Patchwork-Id: 60091 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DE62027BBEA; Sun, 11 Feb 2024 18:30:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3B6F927BBE2 for ; Sun, 11 Feb 2024 18:30:37 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZEaO-0005qX-GU; Sun, 11 Feb 2024 13:29:52 -0500 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 1rZEaK-0005pJ-QO for guix-patches@gnu.org; Sun, 11 Feb 2024 13:29:50 -0500 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 1rZEaK-0008F6-H3 for guix-patches@gnu.org; Sun, 11 Feb 2024 13:29:48 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZEaa-0003Xx-Ph; Sun, 11 Feb 2024 13:30:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54335] [PATCH v4 09/12] gnu: Add go-github-com-skip2-go-qrcode. Resent-From: Alexey Abramov Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Sun, 11 Feb 2024 18:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54335 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54335@debbugs.gnu.org Cc: Katherine Cox-Buday , Sharlatan Hellseher X-Debbugs-Original-Xcc: Katherine Cox-Buday , Sharlatan Hellseher Received: via spool by 54335-submit@debbugs.gnu.org id=B54335.170767615413429 (code B ref 54335); Sun, 11 Feb 2024 18:30:04 +0000 Received: (at 54335) by debbugs.gnu.org; 11 Feb 2024 18:29:14 +0000 Received: from localhost ([127.0.0.1]:37994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZEZm-0003UR-0J for submit@debbugs.gnu.org; Sun, 11 Feb 2024 13:29:14 -0500 Received: from mail.mmer.org ([178.22.65.174]:48250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZEZc-0003S0-GH for 54335@debbugs.gnu.org; Sun, 11 Feb 2024 13:29:05 -0500 Received: from mail.mmer.org (localhost [127.0.0.1]) by mail.mmer.org (OpenSMTPD) with ESMTP id f48b9d40 for <54335@debbugs.gnu.org>; Sun, 11 Feb 2024 18:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=mmer.org; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=ZvNmeA5lTggO8Qyl/03pCw3oN ZM1qGpXWDWKROf2ZxQ=; b=ib8cfwznknOw/82oeUFB8UUfAcMx1XOT9GoIynUc4 cRoaQKZ5jj6zm4uEwSKCs6oZli44zTJCb7S1dks2If2ch9Y/ZuAUym7Q0E7WWuvb m1kbdC0gDZjaez/WOekMI43umuLAOgSWe74ramietIa/1980/UyfRgEmFLANeQK/ pw= Received: from delta (i60212.upc-i.chello.nl [62.195.60.212]) by mail.mmer.org (OpenSMTPD) with ESMTPSA id b4afdcae (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <54335@debbugs.gnu.org>; Sun, 11 Feb 2024 18:28:37 +0000 (UTC) Date: Sun, 11 Feb 2024 19:28:23 +0100 Message-ID: <20240211182830.3631-10-levenson@mmer.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240211182830.3631-1-levenson@mmer.org> References: <20240211182830.3631-1-levenson@mmer.org> MIME-Version: 1.0 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: , Reply-to: Alexey Abramov X-ACL-Warn: , Alexey Abramov via Guix-patches X-Patchwork-Original-From: Alexey Abramov via Guix-patches via From: Alexey Abramov Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Dominic Martinez * gnu/packages/golang.scm (go-github-com-skip2-go-qrcode): New variable. --- gnu/packages/golang.scm | 23 ++++++++++++ ...github-com-skip2-go-qrcode-fix-tests.patch | 37 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 gnu/packages/patches/go-github-com-skip2-go-qrcode-fix-tests.patch diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 2f419fe35d..4196ffe2c9 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -11887,6 +11887,29 @@ (define-public go-google-golang-org-protobuf language specific bindings.") (home-page "https://go.googlesource.com/protobuf") (license license:bsd-3))) + +(define-public go-github-com-skip2-go-qrcode + (package + (name "go-github-com-skip2-go-qrcode") + (version "0.0.0-20200617195104-da1b6568686e") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/skip2/go-qrcode") + (commit (go-version->git-ref version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0pghd6y2x8a5fqy4rjn4d8j5jcslb236naycdza5an7vyvinsgs9")) + (patches (search-patches "go-github-com-skip2-go-qrcode-fix-tests.patch")))) + (build-system go-build-system) + (arguments '(#:import-path "github.com/skip2/go-qrcode")) + (home-page "https://github.com/skip2/go-qrcode") + (synopsis "QR code encoder") + (description "@code{go-github-com-skip2-go-qrcode} provides a QR code +encoder for the Go language.") + (license license:expat))) + ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances ;;; of a merge conflict, place them above by existing packages with similar diff --git a/gnu/packages/patches/go-github-com-skip2-go-qrcode-fix-tests.patch b/gnu/packages/patches/go-github-com-skip2-go-qrcode-fix-tests.patch new file mode 100644 index 0000000000..631cb0cdab --- /dev/null +++ b/gnu/packages/patches/go-github-com-skip2-go-qrcode-fix-tests.patch @@ -0,0 +1,37 @@ +From dd203f29a36bf518deacbc03e8562b0195c8345f Mon Sep 17 00:00:00 2001 +From: Dominic Martinez +Date: Mon, 4 Apr 2022 12:06:03 -0400 +Subject: [PATCH] Fix failing qr decode test + +First convert integers into runes before performing a string conversion. +--- + qrcode_decode_test.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/qrcode_decode_test.go b/qrcode_decode_test.go +index 1f4b1d3..2b0756b 100644 +--- a/qrcode_decode_test.go ++++ b/qrcode_decode_test.go +@@ -122,7 +122,7 @@ func TestDecodeAllCharacters(t *testing.T) { + + // zbarimg has trouble with null bytes, hence start from ASCII 1. + for i := 1; i < 256; i++ { +- content += string(i) ++ content += string(rune(i)) + } + + q, err := New(content, Low) +@@ -154,7 +154,7 @@ func TestDecodeFuzz(t *testing.T) { + for j := 0; j < len; j++ { + // zbarimg seems to have trouble with special characters, test printable + // characters only for now. +- content += string(32 + r.Intn(94)) ++ content += string(rune(32 + r.Intn(94))) + } + + for _, level := range []RecoveryLevel{Low, Medium, High, Highest} { + +base-commit: da1b6568686e89143e94f980a98bc2dbd5537f13 +-- +2.34.0 +