[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/20: gnu: Add python2-tegaki-wagomu.
From: |
guix-commits |
Subject: |
03/20: gnu: Add python2-tegaki-wagomu. |
Date: |
Tue, 17 Sep 2019 01:34:22 -0400 (EDT) |
alexvong1995 pushed a commit to branch master
in repository guix.
commit 410387ad058f94be5e633a84642d2133b1c8f77a
Author: Alex Vong <address@hidden>
Date: Thu Aug 8 13:42:46 2019 +0800
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 73376fe..cc68543 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2015, 2016 Eric Bavier <address@hidden>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <address@hidden>
;;; Copyright © 2018 ng0 <address@hidden>
+;;; Copyright © 2019 Alex Vong <address@hidden>
;;;
;;; 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
- 01/20: gnu: Add zinnia., (continued)
- 01/20: gnu: Add zinnia., guix-commits, 2019/09/17
- 06/20: gnu: Add python2-tegaki-tools., guix-commits, 2019/09/17
- 08/20: gnu: Add tegaki-zinnia-japanese., guix-commits, 2019/09/17
- 14/20: gnu: Add tegaki-zinnia-traditional-chinese., guix-commits, 2019/09/17
- 18/20: gnu: Add tegaki-wagomu-japanese-joyo., guix-commits, 2019/09/17
- 12/20: gnu: Add tegaki-zinnia-simplified-chinese., guix-commits, 2019/09/17
- 16/20: gnu: Add tegaki-wagomu-japanese., guix-commits, 2019/09/17
- 15/20: gnu: Add tegaki-zinnia-traditional-chinese-light., guix-commits, 2019/09/17
- 05/20: gnu: Add python2-tegaki-pygtk., guix-commits, 2019/09/17
- 04/20: gnu: Add python2-tegaki-python., guix-commits, 2019/09/17
- 03/20: gnu: Add python2-tegaki-wagomu.,
guix-commits <=
- 09/20: gnu: Add tegaki-zinnia-japanese-light., guix-commits, 2019/09/17
- 10/20: gnu: Add tegaki-zinnia-japanese-kyoiku., guix-commits, 2019/09/17
- 07/20: gnu: Add python2-tegaki-recognize., guix-commits, 2019/09/17
- 11/20: gnu: Add tegaki-zinnia-japanese-joyo., guix-commits, 2019/09/17
- 17/20: gnu: Add tegaki-wagomu-japanese-kyoiku., guix-commits, 2019/09/17
- 19/20: gnu: Add tegaki-wagomu-simplified-chinese., guix-commits, 2019/09/17
- 20/20: gnu: Add tegaki-wagomu-traditional-chinese., guix-commits, 2019/09/17
- 13/20: gnu: Add tegaki-zinnia-simplified-chinese-light., guix-commits, 2019/09/17