From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aMGaCTxIS2JYAQEAgWs5BA (envelope-from ) for ; Mon, 04 Apr 2022 21:34:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GA0GAjxIS2LBagAAG6o9tA (envelope-from ) for ; Mon, 04 Apr 2022 21:34:20 +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 B0FDD30164 for ; Mon, 4 Apr 2022 21:34:19 +0200 (CEST) Received: from localhost ([::1]:41394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbSSw-0002lX-OA for larch@yhetil.org; 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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649100859; 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=7TC/q05x7mPeIyjwWrFVbnNjGVFscPe+Jb21XpKJSEg=; b=dzTqbxV0YBVPkR8/jca85SuEZvGl3WRX8aEAZ4Eek5tj587xXM9NjUuj/jh1A1YeB7oU1r DAW/Zu1peb6FMwhFbns/QgNy2DevYfQ6uHWfrzcP8aUyH7wASKlmrL/OP+YQkfp1mQ05Eq rluyBq7ZZ3pITR3lEP3ScMStShEDbrZMCT98YW11M6Tf9iS/wlLaZSH0mPRu9fXnZxobC3 vsbNmthJdDt60pI01w92VJ7e/zCDO9CseOcESR/PC+9wTjrXLdZ5cmA4Xe0i6tFnZghYXV ugYjYcZd1oJFUcyf2MpJwWGng9H06ol2v+a8YWo8hzglRqd6+xxXYgB7sSI/NA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649100859; a=rsa-sha256; cv=none; b=QsTyXEc73T1m6q1b0OoiwMygI5XszdIA46sLNRDwqBVb7M/yh0795fYLGO2lpAL0lhs5Iw 8xQpUYb1pEiZuZYMHWRPnjGs9B8OJaH1xD7QYSiiGIObuNg6xmacSA95c3YgVbUtxPFZmB A5ptryZIxZx+Ot1EWa1IeZiSxcBB8TJrqBfGIOgtC1v79SlirxLQow5IpLCkvrbs9XXHz5 lE0X+sEARRCuuKHcqOMm8YDrS7iVEO6iq86TlIrvIa2j9K7l4zg05jVheOV/dgosXwOAml NEuYvGi4v0SfhyX7NL9kBxxYAtAti+HRR7Sop8iZFrHR4c9K5PG5Ltgi3/gEJg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dominicm.dev header.s=default header.b=xcnXHaBv; dkim=fail ("headers rsa verify failed") header.d=dominicm.dev header.s=default header.b=xcnXHaBv; dmarc=none; 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" X-Migadu-Spam-Score: 1.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=dominicm.dev header.s=default header.b=xcnXHaBv; dkim=fail ("headers rsa verify failed") header.d=dominicm.dev header.s=default header.b=xcnXHaBv; dmarc=none; 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" X-Migadu-Queue-Id: B0FDD30164 X-Spam-Score: 1.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: olgwIF+FUQPp * 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 + -- 2.34.0