From patchwork Tue Aug 20 16:26:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Vong X-Patchwork-Id: 14998 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 68CA1172F7; Tue, 20 Aug 2019 17:28:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 0862C172F5 for ; Tue, 20 Aug 2019 17:28:11 +0100 (BST) Received: from localhost ([::1]:39530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i06zS-0000wv-IG for patchwork@mira.cbaines.net; Tue, 20 Aug 2019 12:28:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45244) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i06zL-0000vz-DZ for guix-patches@gnu.org; Tue, 20 Aug 2019 12:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i06zK-0003R5-2l for guix-patches@gnu.org; Tue, 20 Aug 2019 12:28:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53190) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i06zJ-0003Qq-Ur for guix-patches@gnu.org; Tue, 20 Aug 2019 12:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i06zJ-0001rB-R5 for guix-patches@gnu.org; Tue, 20 Aug 2019 12:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37098] [PATCH 03/20] gnu: Add python2-tegaki-wagomu. References: <864l2bx2yz.fsf@gmail.com> In-Reply-To: <864l2bx2yz.fsf@gmail.com> Resent-From: Alex Vong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Aug 2019 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37098 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37098@debbugs.gnu.org Received: via spool by 37098-submit@debbugs.gnu.org id=B37098.15663184247049 (code B ref 37098); Tue, 20 Aug 2019 16:28:01 +0000 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 Date: Wed, 21 Aug 2019 00:26:48 +0800 Message-ID: <86wof7u7jr.fsf@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From e129c467a7bffd9d304ccf86e0eb317baf1043b7 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. --- 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 --- a/gnu/packages/language.scm +++ b/gnu/packages/language.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2015, 2016 Eric Bavier ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 ng0 +;;; Copyright © 2019 Alex Vong ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,12 +21,17 @@ (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) - #: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)) (define-public perl-lingua-en-findnumber @@ -406,3 +412,70 @@ string can be easily inferred by a human just by reading 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-source +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 -- 2.22.0