From patchwork Mon Apr 4 19:32:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominic Martinez X-Patchwork-Id: 38321 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 6823127BBEA; Mon, 4 Apr 2022 20:34:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable 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 DD58D27BBE9 for ; Mon, 4 Apr 2022 20:34:18 +0100 (BST) Received: from localhost ([::1]:41394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbSSw-0002lX-2c for patchwork@mira.cbaines.net; Mon, 04 Apr 2022 15:34:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbSSh-0002Ho-Tk for guix-patches@gnu.org; Mon, 04 Apr 2022 15:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59176) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbSSh-0002Ri-LH for guix-patches@gnu.org; Mon, 04 Apr 2022 15:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nbSSh-00049G-J5 for guix-patches@gnu.org; Mon, 04 Apr 2022 15:34:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54335] [PATCH v3 09/10] gnu: Add go-github-com-skip2-go-qrcode. Resent-From: Dominic Martinez Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Apr 2022 19:34:03 +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: Dominic Martinez Received: via spool by 54335-submit@debbugs.gnu.org id=B54335.164910079215803 (code B ref 54335); Mon, 04 Apr 2022 19:34:03 +0000 Received: (at 54335) by debbugs.gnu.org; 4 Apr 2022 19:33:12 +0000 Received: from localhost ([127.0.0.1]:53065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSRs-00046p-AZ for submit@debbugs.gnu.org; Mon, 04 Apr 2022 15:33:12 -0400 Received: from mta-06-4.privateemail.com ([198.54.122.146]:58811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSRq-000466-N3 for 54335@debbugs.gnu.org; Mon, 04 Apr 2022 15:33:11 -0400 Received: from mta-06.privateemail.com (localhost [127.0.0.1]) by mta-06.privateemail.com (Postfix) with ESMTP id 5097E18000A1; Mon, 4 Apr 2022 15:33:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dominicm.dev; s=default; t=1649100785; bh=mW7gDlPGAa98v41LER6i/4j74Uvjnw7cUXW/IlGpjqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xcnXHaBv7RlDkZCeahf0purBCycg+YTf6930GrkKhW3exY1bWIV8+Q2iExlYDtFKO 8YipOqROMWyDFum+k701OkB7/xlTa7ig+ICObXMIhN/Q6Heuh4o1TzoQZBQopYgTZ8 KLG+MyhXo27YiNIC88gNSxsdXDZDSpqo+A6qVH2+en58AVjvRAp5aLWdjDLXZhLNNY YHBmYC+pUB/JN/DMdpfJRM277cJsKviXHsPh7/dsmAwJoJ7HyGuTr1Kos1CKH0uUPK ZOl6KP7MeAqDoDIwY7H0Dpso3e0VmevAxMXi+gG8rDRCCmMh3ioPPRv8xJKe3OGjpz LHDihIPxNuOBg== Received: from guix.wireless.duke.edu (unknown [10.20.151.184]) by mta-06.privateemail.com (Postfix) with ESMTPA id CDBE018000AD; Mon, 4 Apr 2022 15:33:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dominicm.dev; s=default; t=1649100785; bh=mW7gDlPGAa98v41LER6i/4j74Uvjnw7cUXW/IlGpjqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xcnXHaBv7RlDkZCeahf0purBCycg+YTf6930GrkKhW3exY1bWIV8+Q2iExlYDtFKO 8YipOqROMWyDFum+k701OkB7/xlTa7ig+ICObXMIhN/Q6Heuh4o1TzoQZBQopYgTZ8 KLG+MyhXo27YiNIC88gNSxsdXDZDSpqo+A6qVH2+en58AVjvRAp5aLWdjDLXZhLNNY YHBmYC+pUB/JN/DMdpfJRM277cJsKviXHsPh7/dsmAwJoJ7HyGuTr1Kos1CKH0uUPK ZOl6KP7MeAqDoDIwY7H0Dpso3e0VmevAxMXi+gG8rDRCCmMh3ioPPRv8xJKe3OGjpz LHDihIPxNuOBg== From: Dominic Martinez Date: Mon, 4 Apr 2022 15:32:07 -0400 Message-Id: <20220404193208.27634-10-dom@dominicm.dev> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220404193208.27634-1-dom@dominicm.dev> References: <20220404193208.27634-1-dom@dominicm.dev> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/golang.scm (go-github-com-skip2-go-qrcode): New variable. --- The go-qrcode decoding test doesn't compile due to a change in Go's int to string conversion. There is an active pull request with the fix at https://github.com/skip2/go-qrcode/pull/53, but in the meantime I included a patch for the test. gnu/packages/golang.scm | 22 +++++++++++ ...github-com-skip2-go-qrcode-fix-tests.patch | 37 +++++++++++++++++++ 2 files changed, 59 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 db1ea44d8c..0eae371f40 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -9997,3 +9997,25 @@ (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))) 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 +