From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 5JvtFulOKWAOegAA0tVLHw (envelope-from ) for ; Sun, 14 Feb 2021 16:25:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id V9g2EulOKWCeSgAAB5/wlQ (envelope-from ) for ; Sun, 14 Feb 2021 16:25:13 +0000 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 406D32D5B6 for ; Sun, 14 Feb 2021 17:25:12 +0100 (CET) Received: from localhost ([::1]:36124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBKCt-0003f9-AN for larch@yhetil.org; Sun, 14 Feb 2021 11:25:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBKCk-0003dT-RX for guix-patches@gnu.org; Sun, 14 Feb 2021 11:25:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBKCk-0000Rd-KE for guix-patches@gnu.org; Sun, 14 Feb 2021 11:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBKCk-0006Pl-Fc for guix-patches@gnu.org; Sun, 14 Feb 2021 11:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46512] [PATCH]: gnu: opencc: Update to 1.1.1. Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Feb 2021 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46512 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46512@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161331984524585 (code B ref -1); Sun, 14 Feb 2021 16:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Feb 2021 16:24:05 +0000 Received: from localhost ([127.0.0.1]:36612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBKBo-0006OS-LZ for submit@debbugs.gnu.org; Sun, 14 Feb 2021 11:24:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:35434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBKBm-0006OB-9a for submit@debbugs.gnu.org; Sun, 14 Feb 2021 11:24:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBKBm-0002dn-2j for guix-patches@gnu.org; Sun, 14 Feb 2021 11:24:02 -0500 Received: from m12-12.163.com ([220.181.12.12]:37554) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lBKBc-0000FV-94 for guix-patches@gnu.org; Sun, 14 Feb 2021 11:24:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=g8upo 3/4wgq9UUHYhsuquhH48NdGlLs2YJ/aTHIygQY=; b=ErscIzXlU9iKnGFgYn4i4 IyB2KoZh541vzSY+l+FWG7mLga7Wjtnr9KK/WsNAV9YrZsuHmvWiisrFsUDhJ7Di kOnN20k/rSRPYPHWBHPZvyTDn8O1UWMeNHxQStiKL9UWfdrTLqwslUwTdYFLdcxt 6STw08rU8EIYZr8PPBA9Qw= Received: from asus-laptop (unknown [183.19.167.3]) by smtp8 (Coremail) with SMTP id DMCowABnbbGJTilg9_SUQg--.63135S2; Mon, 15 Feb 2021 00:23:38 +0800 (CST) User-agent: mu4e 1.4.15; emacs 27.1 From: Zhu Zihao Date: Mon, 15 Feb 2021 00:23:37 +0800 Message-ID: <867dnahb3q.fsf@163.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-CM-TRANSID: DMCowABnbbGJTilg9_SUQg--.63135S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUcApnUUUUU X-Originating-IP: [183.19.167.3] X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/1tbitAo5r1SIkaUcgAAAsc Received-SPF: pass client-ip=220.181.12.12; envelope-from=all_but_last@163.com; helo=m12-12.163.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Spam-Score: -3.36 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=163.com header.s=s110527 header.b=ErscIzXl; dmarc=fail reason="SPF not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 406D32D5B6 X-Spam-Score: -3.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: Y9NZDA9IW+mH --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain This patch update opencc to 1.1.1 and add the python binding build for it. --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCYClOiRUcYWxsX2J1dF9s YXN0QDE2My5jb20ACgkQvkKzUqn2gh8ukAD/UmFi1DqwdA9dgjQ7H+iDdxrNMHZS 050soLPvAArWFA0BAKyUwJwrzGy7OhDrstoG9ZFGlv6DnwJ6fb7cpR533oMK =8Lx6 -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-opencc-Update-to-1.1.1.patch >From bcb056a18920c8e7eb33b1735e4e7cf5499fc2e9 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Sun, 14 Feb 2021 21:52:35 +0800 Subject: [PATCH] gnu: opencc: Update to 1.1.1. * gnu/packages/textutils.scm(opencc): Update to 1.1.1 [source]: Add new patch. [arguments]: Build in source tree. : Disable. : In "patch-3rd-party-references", fix the version of dependency. Add phases "patch-python-binding-installation", "install-python-binding" and "enable-bytecode-determinism". [native-inputs]: Add python-setuptools and python-wheel. * gnu/packages/patches/opencc-py-binding-dont-rebuild.patch: New file. * gnu/local.mk(dist_patch_DATA): Add new entry. --- gnu/local.mk | 1 + .../opencc-py-binding-dont-rebuild.patch | 13 +++++ gnu/packages/textutils.scm | 58 ++++++++++++++++--- 3 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 gnu/packages/patches/opencc-py-binding-dont-rebuild.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7b6cd8e0ae..9d9d394d84 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1419,6 +1419,7 @@ dist_patch_DATA = \ %D%/packages/patches/omake-fix-non-determinism.patch \ %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ + %D%/packages/patches/opencc-py-binding-dont-rebuild.patch \ %D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \ %D%/packages/patches/opencv-rgbd-aarch64-test-fix.patch \ %D%/packages/patches/opendht-fix-jami.patch \ diff --git a/gnu/packages/patches/opencc-py-binding-dont-rebuild.patch b/gnu/packages/patches/opencc-py-binding-dont-rebuild.patch new file mode 100644 index 0000000000..d1140489db --- /dev/null +++ b/gnu/packages/patches/opencc-py-binding-dont-rebuild.patch @@ -0,0 +1,13 @@ +This patch prevents the rebuild of OpenCC while installing the python binding. + +Author: Zhu Zihao +--- a/python/setup.py ++++ b/python/setup.py +@@ -195,7 +195,6 @@ + 'clib/share/opencc/*', + ]}, + cmdclass={ +- 'build_py': BuildPyCommand, + 'bdist_wheel': BDistWheelCommand + }, + diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 34da04d0d8..e10cfd5615 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -60,6 +60,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) #:use-module (gnu packages slang) @@ -1051,36 +1052,75 @@ OpenDocument presentations (*.odp).") (define-public opencc (package (name "opencc") - (version "1.0.5") + (version "1.1.1") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/BYVoid/OpenCC") - (commit (string-append "ver." version)))) + (url "https://github.com/BYVoid/OpenCC") + (commit (string-append "ver." version)))) (file-name (git-file-name name version)) (sha256 (base32 - "1pv5md225qwhbn8ql932zdg6gh1qlx3paiajaks8gfsa07yzvhr4")) + "07y0pvxjlmpcnym229j87qcfwnfm7vi10dad0a20xy6as55a9j3d")) (modules '((guix build utils))) (snippet '(begin ;; TODO: Unbundle tclap, darts-clone, gtest - (delete-file-recursively "deps/rapidjson-0.11") #t)))) + (delete-file-recursively "deps/rapidjson-1.1.0") #t)) + (patches (search-patches "opencc-py-binding-dont-rebuild.patch")))) (build-system cmake-build-system) (arguments - '(#:phases + ;; Required to locate the install script properly. + `(#:out-of-source? #f + #:parallel-build? #f ;occasionally failed. + #:imported-modules + (,@%cmake-build-system-modules + (guix build python-build-system)) + #:modules ((guix build cmake-build-system) + ((guix build python-build-system) #:prefix python:) + (guix build utils)) + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-3rd-party-references (lambda* (#:key inputs #:allow-other-keys) (let ((rapidjson (assoc-ref inputs "rapidjson"))) (substitute* "src/CMakeLists.txt" - (("../deps/rapidjson-0.11") + (("../deps/rapidjson-1.1.0") (string-append rapidjson "/include/rapidjson"))) - #t)))))) + #t))) + (add-before 'configure 'patch-python-binding-installation + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "python/opencc/__init__.py" + (("(_libopenccfile =).*$" _ prefix) + (format #f "~a os.path.join('~a/lib', _libopenccfilename)~%" + prefix out)) + (("(_opencc_share_dir =).*$" _ prefix) + (format #f "~a '~a/share/opencc'~%" prefix out)))) + #t)) + (add-after 'install 'install-python-binding + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dist (string-append + out "/lib/python" + ,(version-major+minor (package-version python)) + "/site-packages"))) + (chdir "python") + (mkdir-p dist) + (setenv "PYTHONPATH" + (string-append dist ":" (getenv "PYTHONPATH"))) + (invoke "python" "setup.py" "install" + "--root=/" "--single-version-externally-managed" + (string-append "--prefix=" out)) + #t))) + (add-before 'install-python-binding 'enable-bytecode-determinism + (assoc-ref python:%standard-phases 'enable-bytecode-determinism))))) (native-inputs `(("python" ,python-wrapper) - ("rapidjson" ,rapidjson))) + ("rapidjson" ,rapidjson) + ("python-setuptools" ,python-setuptools) + ("python-wheel" ,python-wheel))) (home-page "https://github.com/BYVoid/OpenCC") (synopsis "Convert between Traditional Chinese and Simplified Chinese") (description "Open Chinese Convert (OpenCC) converts between Traditional -- 2.30.0 --=-=-= Content-Type: text/plain -- Retrieve my PGP public key: gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F Zihao --=-=-=--