From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:37308) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i06Gp-0004b3-Pm for guix-patches@gnu.org; Tue, 20 Aug 2019 11:42:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i06Go-00030V-Bv for guix-patches@gnu.org; Tue, 20 Aug 2019 11:42:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53033) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i06Go-00030B-8q for guix-patches@gnu.org; Tue, 20 Aug 2019 11:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i06Go-0000US-5T for guix-patches@gnu.org; Tue, 20 Aug 2019 11:42:02 -0400 Subject: [bug#37102] [PATCH 03/20] gnu: Add python2-tegaki-wagomu. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:37278) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i06GY-0004aY-4f for guix-patches@gnu.org; Tue, 20 Aug 2019 11:41:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i06GW-0002is-Ee for guix-patches@gnu.org; Tue, 20 Aug 2019 11:41:46 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:41492) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i06GW-0002iK-7h for guix-patches@gnu.org; Tue, 20 Aug 2019 11:41:44 -0400 Received: by mail-pg1-x52a.google.com with SMTP id x15so3464701pgg.8 for ; Tue, 20 Aug 2019 08:41:44 -0700 (PDT) Received: from debian (1-64-82-217.static.netvigator.com. [1.64.82.217]) by smtp.gmail.com with ESMTPSA id w189sm19682123pfb.35.2019.08.20.08.41.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 08:41:42 -0700 (PDT) From: Alex Vong Date: Tue, 20 Aug 2019 23:41:39 +0800 Message-ID: <86zhk3vo7g.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37102@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0003-gnu-Add-python2-tegaki-wagomu.patch Content-Transfer-Encoding: quoted-printable From=20e129c467a7bffd9d304ccf86e0eb317baf1043b7 Mon Sep 17 00:00:00 2001 From: Alex Vong Date: Thu, 8 Aug 2019 13:42:46 +0800 Subject: [PATCH 03/20] gnu: Add python2-tegaki-wagomu. * gnu/packages/language.scm (python2-tegaki-wagomu, remove-pre-compiled-files-modules): New variables. (remove-pre-compiled-files, tegaki-release-uri): New procedures. =2D-- gnu/packages/language.scm | 75 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm index 73376feecb..cc685437c9 100644 =2D-- a/gnu/packages/language.scm +++ b/gnu/packages/language.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2015, 2016 Eric Bavier ;;; Copyright =C2=A9 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2018 ng0 +;;; Copyright =C2=A9 2019 Alex Vong ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,12 +21,17 @@ =20 (define-module (gnu packages language) #:use-module (gnu packages) + #:use-module (gnu packages glib) #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (gnu packages perl-check) + #:use-module (gnu packages swig) #:use-module (gnu packages web) #:use-module (guix packages) #:use-module (guix build-system perl) =2D #:use-module ((guix licenses) #:select (gpl2 gpl3 perl-license)) + #:use-module (guix build-system python) + #:use-module ((guix licenses) #:select (gpl2 gpl2+ gpl3 perl-license)) #:use-module (guix download)) =20 (define-public perl-lingua-en-findnumber @@ -406,3 +412,70 @@ string can be easily inferred by a human just by readi= ng the identifier.") (description "This module is a rather incomplete implementation of work done by Gudrun Putze-Meier.") (license perl-license))) + +(define* (tegaki-release-uri proj version + #:optional (ext "tar.gz")) + (string-append "https://github.com/tegaki/tegaki/releases/download" + "/v" version "/" proj "-" version "." ext)) + +(define remove-pre-compiled-files + (lambda exts + "Return snippet for removing pre-compiled files matching one of the +extensions in EXTS." + `(begin (for-each delete-file + (find-files "." + (lambda (name _) + (any (cut string-suffix? <> name) + (map (cut string-append "." <>) + ',exts))))) + #t))) + +;;; modules required for the above snippet +(define remove-pre-compiled-files-modules + '((guix build utils) + (srfi srfi-1) + (srfi srfi-26))) + +(define-public python2-tegaki-wagomu + (package + (name "python2-tegaki-wagomu") + (version "0.3.1") + (source + (origin + (method url-fetch) + (uri (tegaki-release-uri "tegaki-wagomu" version)) + (sha256 + (base32 + "1pzdiq4zy1nyylaj9i6v2h4h0r05klahskzpafpp367p4rysi1x9")) + (modules remove-pre-compiled-files-modules) + (snippet (remove-pre-compiled-files "pyc")))) + (build-system python-build-system) + (arguments + `(#:python ,python-2 ; only Python 2 is supported + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-recognizer + (lambda* (#:key inputs #:allow-other-keys) + ;; fix missing module and function + (substitute* "tegakiwagomu.py" + (("import Results,") + "import ") + (("def _recognize") + "def recognize") + (("Results\\(candidates\\)") + "candidates")) + #t))))) + (inputs + `(("glib" ,glib))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("swig" ,swig))) + (home-page "https://tegaki.github.io/") + (synopsis + "Chinese and Japanese Handwriting Recognition (Recognition engine)") + (description + "Tegaki is an ongoing project which aims to develop a free and open-s= ource +modern implementation of handwriting recognition software, specifically +designed for Chinese (simplified and traditional) and Japanese, and that is +suitable for both the desktop and mobile devices.") + (license gpl2+))) ; all files =2D-=20 2.22.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQwb8uPLAHCXSnTBVZh71Au9gJS8gUCXVwUswAKCRBh71Au9gJS 8qTGAP9Or/HHbdy2fLc2SnappLD4RyygQZBnmecIyONHoVsk5gEAu7PIaKnYAgqy 1smVCaY+81kNbJE2eb6yPEBu+cvXRAk= =XACZ -----END PGP SIGNATURE----- --==-=-=--