From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 12:27:04 2019 Received: (at 37098) by debbugs.gnu.org; 20 Aug 2019 16:27:04 +0000 Received: from localhost ([127.0.0.1]:33774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i06yK-0001pB-Py for submit@debbugs.gnu.org; Tue, 20 Aug 2019 12:27:04 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:44823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i06yI-0001ou-Os for 37098@debbugs.gnu.org; Tue, 20 Aug 2019 12:26:59 -0400 Received: by mail-pg1-f175.google.com with SMTP id i18so3520618pgl.11 for <37098@debbugs.gnu.org>; Tue, 20 Aug 2019 09:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=DOJd4yk7BaM2fecWMRh418kGjEPLu0qtSACdcUOhinw=; b=QCNpGFInA8Xzt2fPikzh26pU7//yIztPGhVkftUPlcZ/bDrhQe8gyB7tHI7HrpX4N4 h/b7v3VPa6sUC5Sk1LNnYmQVFFPQNESAGTWZ79+OQV5dMYjpn8x9nkZPEWRV1JEMlbcb 153iCQs9yiSJh4dNlMhnX932F7eftt28OstbY8ZPJdhjAAuY4mhCLDAApCFJbLRoyD6T NSJdROc1YoG5D8CNfgJC0aqqMlngPJ4YhkPJozltU6af+dSvDAH3kpGbFd0cAqsJoFyt jOxF1rH7y1SVeaYP5U0BXuywti0C/fFsjI7uLYPkLb+/n9o/0LLrX2bQGIm0yakt/+JO KFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=DOJd4yk7BaM2fecWMRh418kGjEPLu0qtSACdcUOhinw=; b=ifPbJds5o5QAXF6MLdDJ3so1sj/BdCnVhfIihgDWaGDVafg4Y221XV7lMCMarcfBmC +X+6/pJgzy6rI+Iyymg0qVLsH3PWXLMl94VCwk9Hwgue8NwiWLLybIr737yZ1zusbryN dRF9vLrOS9DD0Kb61BZCRBqn4DCr/WptNQ/BgD48lJ8QzscXEQkA7sz2D71ryqlBDoP9 7QSXck1y+cLFvNh6xypXjiGHVIhU5wJktl6Y2jGW4hS7Gok0iC62kh6vyxKbGC3GDQTj nitjZUGO1Ahs9nlG+jhA31ARqwJkYTa8K4t+t9X9MQZzyb3s0EfA+pHT1zxTuWEeTOJB DUyA== X-Gm-Message-State: APjAAAVR8NGLjx8NLGsZjrkEwcTRnm56LcXiCykj9pNhQeDNgT3YCJPa 0eCEKoOGgNp40pq26KBRSLvTUI2I X-Google-Smtp-Source: APXvYqw2ZvwbNeGPZj3qdADNvKSU+gAp0lqNei3uHOEIspZTz/eOsCDtwT/3AFFZmuKa5dB8ICIbKg== X-Received: by 2002:a63:101b:: with SMTP id f27mr24566360pgl.291.1566318412749; Tue, 20 Aug 2019 09:26:52 -0700 (PDT) Received: from debian (1-64-82-217.static.netvigator.com. [1.64.82.217]) by smtp.gmail.com with ESMTPSA id 6sm23600240pfa.7.2019.08.20.09.26.51 for <37098@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 09:26:51 -0700 (PDT) User-agent: mu4e 1.2.0; emacs 26.2 From: Alex Vong To: 37098@debbugs.gnu.org Subject: [PATCH 03/20] gnu: Add python2-tegaki-wagomu. Date: Wed, 21 Aug 2019 00:26:48 +0800 Message-ID: <86wof7u7jr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 37098 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --==-=-= 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----- iHUEARYIAB0WIQQwb8uPLAHCXSnTBVZh71Au9gJS8gUCXVwfSAAKCRBh71Au9gJS 8pzIAQCzcukzYTAtVmuv8W+5XSRccZYtI2ED22VVawVK5D7VLgEAl4/7YHfVp+OU wHRLFm9QpAcdKUl5to0qimF7E4SWxwo= =/ExA -----END PGP SIGNATURE----- --==-=-=--