From patchwork Mon Jul 22 16:17:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3316 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D6DA23FA2C for ; Mon, 22 Jul 2024 18:17:46 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4272718b9b0sf33921425e9.1 for ; Mon, 22 Jul 2024 09:17:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1721665066; cv=pass; d=google.com; s=arc-20160816; b=fSSMUHTWGljKK57PtTW48cEOOcx4FLWrxoAcZCZsUJleumJpR7+FtgMSwjxZoJwXkh 7G6ieWEp0FKpivqxuSSrQCzyxsZTd2bvHuov0Y0WCw6huSkfVLRpgs4a/IrDNKQAxsNT eJPakF9ynkEVL5Oz4JMQXwztvcDLeLm4WwPsipG7OL3UFLv8oV48515+gjVtRM+pg1gx bBETdGY0A4w6/t/YNKKw1prAlzb//WUSfetnTrCKTjOMalYm0tF4WUsawolIb405vryf 80jgLmqQ8gtYyvvYERnc7mzWs99YFHGEv9AolZWevK7Wh7jciC5V7WjqVjNVhz2ttoHR xbwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=6s6AmcvsBJ7FF5CTcT7r+yibQzI+BAPqMtC2l6LM1B8=; fh=+gP8rDBialpBRdzes1N7te/C4Jve1Jie90D0wrpBdNo=; b=fk3EuRCSiBgYSl6bRVI8tn9/ncPSDhihfHa55JBm/StN8gs/6Nm1XISuI35Lk41Dei sQdFI4AVrG7iaWuND7ckqpj9BGLg4Euix7fbo08C7j4vMJWnN5iGpksRO2LlXGUa2jwn aHCdQb8K1xYLajijLKvDmseDhaiuKbT8qjevh531faDLn+PR9C3lA9dJaTdmz5KvSNUl rT+p07KJ+lWvBfgGbLwOBxKJT70fdVaU7RYP9/Pneom7QtyAhUBODrzqEzq1tWR0979u sKQahhoePHuFe9/p/N2uLfuKLMMRWd/ULA87QxvcNk+dX8Q//NsQh60Q8o0UC0iq3omh L+GQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=n04oEPkQ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1721665066; x=1722269866; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=6s6AmcvsBJ7FF5CTcT7r+yibQzI+BAPqMtC2l6LM1B8=; b=rfV3lcTIL858UttBYb5IaE9B0qkWkPSMXFapGNyk3z+n74t/ncbetlXrUdi9Fr+oNv 5U3mJ9pHOa6xBFk+apZlKD9juHpwIC8ClI94l4RbUNZOOGp2K88ceHo5/+n20PPBmOnZ MDEr6Y3KHRJEJFzSYXozILcHfmxTS+JOM5ZVY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721665066; x=1722269866; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6s6AmcvsBJ7FF5CTcT7r+yibQzI+BAPqMtC2l6LM1B8=; b=XRLrNo/tG+QypfoYjxglyjeEkqHLL5F5jT0rl81dRfqKyA09heF/jktVm++rQ21x2y ECcGe1f2AZlIT+N82owEUZf1m8sL16KO7YpjrVoQf+L7kp3bJnkEdFiliP7TYAoaZayq u4UOVPUXPNtYfmNJa+C+FbKQGdHR/QjTAphCoXcbkiAAkvGHOuEBbMi7I3eES885zt3e BZc4Z5ZpFedjeVWGpkU24Ya93p7G+mQ/W4N+T6BON3ikvwQmd7CYsI2EcypPZnj4sHgU TV2DvSLMjSN02h/AD5poxN3Zu0PhxMMGl64hRQY60HeGXut9VKrB4R+8H9h8PEGaMMMI Ja5w== X-Forwarded-Encrypted: i=2; AJvYcCUbfnsdWHJS5TMI6jwaqcmHKnHYD4btFql7yu41YvgGC0ZIh359HKE88sbxbGtcgmDgto9wJRqN57+PsYyN1GeiOGGNCyCWB/b8vkbn699GixOhC5MtZ0ZnkFkVJQ== X-Gm-Message-State: AOJu0Yyx8jyf21vuMJgnvMrn3YAEPCFh8wKgUWjesRu6i3Bz/hfKO6Z+ asHZh9Akg+uqZnUMrplBGnqvxalempIaoJkD+xFat7tLh3mPAI5efFcZJHUG8/toCQ== X-Google-Smtp-Source: AGHT+IF3RCzAkz4my3VoGy7GbQ2Lj5LUx4d/JFlUM3KU2CrBxpBrXMo2NyItrt5Wl5apkXHnRSm9nQ== X-Received: by 2002:a05:600c:1c1c:b0:426:597c:7d4d with SMTP id 5b1f17b1804b1-427ed001c2emr3575965e9.18.1721665066186; Mon, 22 Jul 2024 09:17:46 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3ba0:b0:426:68ce:c99e with SMTP id 5b1f17b1804b1-427c839ef4als23159015e9.1.-pod-prod-03-eu; Mon, 22 Jul 2024 09:17:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUl0VGfJP20BuAT62h7iczNjn7fWmwp4n0OynhKezOUlsbqFNVlhnpLQGwmV5wNsHIBgVm/B2jq59pUJ1N4jMobmniCJysNx9q7zZtiKWm4TLFI X-Received: by 2002:a05:600c:4f89:b0:426:58ca:5a3 with SMTP id 5b1f17b1804b1-427ed059c63mr2695905e9.30.1721665064675; Mon, 22 Jul 2024 09:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721665064; cv=none; d=google.com; s=arc-20160816; b=fSHhucYeEIUvbNXj27vJVIiZsvm9NQArGSbY/Jbj15hCLehg9btuENynMAf3yHYf88 hMS3Da/Ik/HW0nqebJ8kWctGsKt31wBoc5LTvOqPwXC/1g2DUsW3vCbk/Xb4Dn+zaaTf 6hz8KFe4p3IITT5l7DXF6/wErTk5Cz2DWcrs3uT8MzAJO8aF9ppUl+daqcR9bcqSCyqX vkXwsFKfbwzH/yUcsNffs//rKcB10UitxuPn/p5RansiXhZmrMuyg73EWK6aIfK0qcUY L29pU24CcJ6Rr/L2ohuKMdRSeVcK37l3cLLnaBDAMY3l62LJ9+JlawQ/v+DFKOP/1CQP e2Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=LlU1b7GoLZAiJIZJlYBCrVkLi/uKxc5qY5RF9DWHD5Y=; fh=peyCKPO4bcO83PQePQlvPThRk+0+1j56M7pYdwzedcA=; b=oADk3PT6e67ntuZUeAYNZfjbx5l6vc0gRi9Shij8GrJA4g2NotSH0F+xNwLG/cN9/w C4bwfpJSPkOqoLl1265+6fXlo6sawUvNij+e1Er/eks+c5bDTsMuA3xdxksbUfedknBR RuO67RK+o5W56bhv3/gLNPnjwLYi83T6dNb3ieRg0/2vhgTbVoMvERAtgPtYSIWLkDFx VxIGc3PaAZqfgsUox8M7kvPsJaQrfHRxUZS8cYMCFQzzG+55gdMoiUlNqfYN2m40AD9k GBXHwuigQUBPzf/N+X/wh3lABCLtxYDZo9PAkIeudZFLbXhERCuBXKYmk0znvcmB+lH6 tOdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=n04oEPkQ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-427d6ffa565sor20444575e9.11.2024.07.22.09.17.44 for (Google Transport Security); Mon, 22 Jul 2024 09:17:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCU/9NDCXpEBSwKxLcCiFroYc9Rmc6+zGlgWQA7qNkpe+HX/65s41YDq5Sl0LvkRx6wdWpPHGW5jfXU+b8ZHrGvz/5enyarUeNq8gtGkMDrMpy2n X-Received: by 2002:a5d:6e86:0:b0:367:97fd:1d75 with SMTP id ffacd0b85a97d-369dec2f34fmr270673f8f.27.1721665064067; Mon, 22 Jul 2024 09:17:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.40.39]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3687869447dsm8947002f8f.53.2024.07.22.09.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 09:17:43 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Cc: Frank Hunleth , Francesco Nicoletta Puzzillo , linux-amarula@amarulasolutions.com, Dario Binacchi Subject: [PATCH 1/1] package/zxing-cpp: bump to version 2.2.1 Date: Mon, 22 Jul 2024 18:17:40 +0200 Message-ID: <20240722161740.301988-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=n04oEPkQ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Release notes: https://github.com/zxing-cpp/zxing-cpp/releases/tag/v2.2.0 https://github.com/zxing-cpp/zxing-cpp/releases/tag/v2.2.1 The added patch fixes the library compilation when only the writer support is enabled. Co-Developed-by: Francesco Nicoletta Puzzillo Signed-off-by: Dario Binacchi --- ...-when-only-writer-support-is-enabled.patch | 164 ++++++++++++++++++ package/zxing-cpp/zxing-cpp.hash | 2 +- package/zxing-cpp/zxing-cpp.mk | 2 +- 3 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 package/zxing-cpp/0001-Fix-building-when-only-writer-support-is-enabled.patch diff --git a/package/zxing-cpp/0001-Fix-building-when-only-writer-support-is-enabled.patch b/package/zxing-cpp/0001-Fix-building-when-only-writer-support-is-enabled.patch new file mode 100644 index 000000000000..0d2a90f7a546 --- /dev/null +++ b/package/zxing-cpp/0001-Fix-building-when-only-writer-support-is-enabled.patch @@ -0,0 +1,164 @@ +From aef33b66df0ad6f085dc55b50d7847e0b8a2ccd8 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Wed, 17 Jul 2024 14:53:35 +0200 +Subject: [PATCH] Fix building when only writer support is enabled + +The compilation of the following code, which links the zxing-cpp library +built with only the writer (encoder) support, raises the following +linking errors: + +using namespace ZXing; + +int main(void) +{ + std::string str = "01"; + BitHacks::NumberOfLeadingZeros(0); + auto writer = MultiFormatWriter(BarcodeFormat::Code128); + writer.setEncoding(CharacterSet::UTF8); + writer.setMargin(0); + auto matrix = writer.encode(str, 0, 0 /*scaledImageWidth, pixelHeight*/); + + return EXIT_SUCCESS; +} + +arm-buildroot-linux-uclibcgnueabihf/bin/ld:host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libZXing.so: +undefined reference to `ZXing::TextDecoder::GuessEncoding(unsigned char const*, unsigned int, ZXing::CharacterSet)' +arm-buildroot-linux-uclibcgnueabihf/bin/ld: host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libZXing.so: +undefined reference to `ZXing::HRIFromGS1[abi:cxx11](std::basic_string_view >)' +arm-buildroot-linux-uclibcgnueabihf/bin/ld: host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libZXing.so: +undefined reference to `ZXing::TextDecoder::Append(std::__cxx11::basic_string, std::allocator >&, unsigned char const*, unsigned int, ZXing::CharacterSet, bool)' +arm-buildroot-linux-uclibcgnueabihf/bin/ld: host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/libZXing.so: +undefined reference to `ZXing::HRIFromISO15434[abi:cxx11](std::basic_string_view >)' +collect2: error: ld returned 1 exit status + +The patch fixes these errors. + +Co-Developed-by: Francesco Nicoletta Puzzillo +Signed-off-by: Dario Binacchi +Upstream: backport from upstream https://github.com/zxing-cpp/zxing-cpp/pull/811 +--- + core/src/Content.cpp | 4 ++++ + core/src/Content.h | 6 ++++++ + core/src/DecoderResult.h | 2 ++ + core/src/GTIN.cpp | 2 ++ + core/src/GTIN.h | 2 ++ + 5 files changed, 16 insertions(+) + +diff --git a/core/src/Content.cpp b/core/src/Content.cpp +index 4d3c44657cf9..569d4e35614a 100644 +--- a/core/src/Content.cpp ++++ b/core/src/Content.cpp +@@ -93,6 +93,7 @@ bool Content::canProcess() const + return std::all_of(encodings.begin(), encodings.end(), [](Encoding e) { return CanProcess(e.eci); }); + } + ++#ifdef ZXING_READERS + std::string Content::render(bool withECI) const + { + if (empty() || !canProcess()) +@@ -165,6 +166,7 @@ std::wstring Content::utfW() const + { + return FromUtf8(render(false)); + } ++#endif // ZXING_READERS + + ByteArray Content::bytesECI() const + { +@@ -188,6 +190,7 @@ ByteArray Content::bytesECI() const + return ByteArray(res); + } + ++#ifdef ZXING_READERS + CharacterSet Content::guessEncoding() const + { + // assemble all blocks with unknown encoding +@@ -236,5 +239,6 @@ ContentType Content::type() const + + return ContentType::Mixed; + } ++#endif // ZXING_READERS + + } // namespace ZXing +diff --git a/core/src/Content.h b/core/src/Content.h +index 99e5a01e7140..aa77bda94d54 100644 +--- a/core/src/Content.h ++++ b/core/src/Content.h +@@ -38,7 +38,9 @@ class Content + void ForEachECIBlock(FUNC f) const; + + void switchEncoding(ECI eci, bool isECI); ++#ifdef ZXING_READERS + std::string render(bool withECI) const; ++#endif // ZXING_READERS + + public: + struct Encoding +@@ -75,13 +77,17 @@ public: + bool empty() const { return bytes.empty(); } + bool canProcess() const; + ++#ifdef ZXING_READERS + std::string text(TextMode mode) const; + std::wstring utfW() const; // utf16 or utf32 depending on the platform, i.e. on size_of(wchar_t) + std::string utf8() const { return render(false); } ++#endif // ZXING_READERS + + ByteArray bytesECI() const; ++#ifdef ZXING_READERS + CharacterSet guessEncoding() const; + ContentType type() const; ++#endif // ZXING_READERS + }; + + } // ZXing +diff --git a/core/src/DecoderResult.h b/core/src/DecoderResult.h +index 02b285084195..3117b03a923a 100644 +--- a/core/src/DecoderResult.h ++++ b/core/src/DecoderResult.h +@@ -50,7 +50,9 @@ public: + Content&& content() && { return std::move(_content); } + + // to keep the unit tests happy for now: ++#ifdef ZXING_READERS + std::wstring text() const { return _content.utfW(); } ++#endif // ZXING_READERS + std::string symbologyIdentifier() const { return _content.symbology.toString(false); } + + // Simple macro to set up getter/setter methods that save lots of boilerplate. +diff --git a/core/src/GTIN.cpp b/core/src/GTIN.cpp +index 256855a03070..690901062301 100644 +--- a/core/src/GTIN.cpp ++++ b/core/src/GTIN.cpp +@@ -199,6 +199,7 @@ std::string LookupCountryIdentifier(const std::string& GTIN, const BarcodeFormat + return it != std::end(COUNTRIES) && prefix >= it->first && prefix <= it->last ? it->id : std::string(); + } + ++#ifdef ZXING_READERS + std::string EanAddOn(const Result& result) + { + if (!(BarcodeFormat::EAN13 | BarcodeFormat::UPCA | BarcodeFormat::UPCE | BarcodeFormat::EAN8) +@@ -208,6 +209,7 @@ std::string EanAddOn(const Result& result) + auto pos = txt.find(' '); + return pos != std::string::npos ? std::string(txt.substr(pos + 1)) : std::string(); + } ++#endif // ZXING_READERS + + std::string IssueNr(const std::string& ean2AddOn) + { +diff --git a/core/src/GTIN.h b/core/src/GTIN.h +index d56b604e5f71..9af0b01200ce 100644 +--- a/core/src/GTIN.h ++++ b/core/src/GTIN.h +@@ -47,7 +47,9 @@ bool IsCheckDigitValid(const std::basic_string& s) + */ + std::string LookupCountryIdentifier(const std::string& GTIN, const BarcodeFormat format = BarcodeFormat::None); + ++#ifdef ZXING_READERS + std::string EanAddOn(const Result& result); ++#endif // ZXING_READERS + + std::string IssueNr(const std::string& ean2AddOn); + std::string Price(const std::string& ean5AddOn); +-- +2.43.0 + diff --git a/package/zxing-cpp/zxing-cpp.hash b/package/zxing-cpp/zxing-cpp.hash index 6c6917ed8650..ff11896f4b79 100644 --- a/package/zxing-cpp/zxing-cpp.hash +++ b/package/zxing-cpp/zxing-cpp.hash @@ -1,5 +1,5 @@ # Locally calculated -sha256 6d54e403592ec7a143791c6526c1baafddf4c0897bb49b1af72b70a0f0c4a3fe zxing-cpp-2.1.0.tar.gz +sha256 02078ae15f19f9d423a441f205b1d1bee32349ddda7467e2c84e8f08876f8635 zxing-cpp-2.2.1.tar.gz # License files sha256 c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08 LICENSE diff --git a/package/zxing-cpp/zxing-cpp.mk b/package/zxing-cpp/zxing-cpp.mk index 077d7e75d3dd..5f91bf2f716d 100644 --- a/package/zxing-cpp/zxing-cpp.mk +++ b/package/zxing-cpp/zxing-cpp.mk @@ -4,7 +4,7 @@ # ################################################################################ -ZXING_CPP_VERSION = 2.1.0 +ZXING_CPP_VERSION = 2.2.1 ZXING_CPP_SITE = $(call github,zxing-cpp,zxing-cpp,v$(ZXING_CPP_VERSION)) ZXING_CPP_LICENSE = Apache-2.0 ZXING_CPP_LICENSE_FILES = LICENSE