unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#37103] [PATCH 04/20] gnu: Add python2-tegaki-python.
@ 2019-08-20 15:46 Alex Vong
  0 siblings, 0 replies; only message in thread
From: Alex Vong @ 2019-08-20 15:46 UTC (permalink / raw)
  To: 37103


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: 0004-gnu-Add-python2-tegaki-python.patch --]
[-- Type: text/x-diff, Size: 3657 bytes --]

From e606e1f60f125a402eb13dc807d141b0c9b65fdb Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Thu, 8 Aug 2019 13:49:19 +0800
Subject: [PATCH 04/20] gnu: Add python2-tegaki-python.

* gnu/packages/language.scm (python2-tegaki-python): New variable.
---
 gnu/packages/language.scm | 54 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 52 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm
index cc685437c9..2ef4fed721 100644
--- a/gnu/packages/language.scm
+++ b/gnu/packages/language.scm
@@ -22,6 +22,7 @@
 (define-module (gnu packages language)
   #:use-module (gnu packages)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -31,8 +32,10 @@
   #:use-module (guix packages)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
-  #:use-module ((guix licenses) #:select (gpl2 gpl2+ gpl3 perl-license))
-  #:use-module (guix download))
+  #:use-module ((guix licenses)
+                #:select (bsd-3 gpl2 gpl2+ gpl3 perl-license zpl2.1))
+  #:use-module (guix download)
+  #:use-module (guix utils))
 
 (define-public perl-lingua-en-findnumber
   (package
@@ -479,3 +482,50 @@ 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
+
+(define-public python2-tegaki-python
+  (package
+    (inherit python2-tegaki-wagomu)
+    (name "python2-tegaki-python")
+    (version "0.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (tegaki-release-uri "tegaki-python" version))
+       (sha256
+        (base32
+         "0x93k7pw9nh0ywd97pr8pm7jv3f94nw044i5k0zvzhdpsjqvak7p"))
+       (modules remove-pre-compiled-files-modules)
+       (snippet (remove-pre-compiled-files "pyc"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments python2-tegaki-wagomu)
+       ((#:phases _)
+        `(modify-phases %standard-phases
+           (add-after 'unpack 'pre-configure
+             (lambda* (#:key inputs #:allow-other-keys)
+               ;; Always convert string to unicode to avoid the following error
+               ;; when running "tegaki-build" in python2-tegaki-tools:
+               ;;
+               ;; sqlite3.ProgrammingError: You must not use 8-bit bytestrings
+               ;; unless you use a text_factory that can interpret 8-bit
+               ;; bytestrings (like text_factory = str).
+               ;; It is highly recommended that you instead just switch your
+               ;; application to Unicode strings.
+               (substitute* "tegaki/charcol.py"
+                 (("sqlite3.OptimizedUnicode")
+                  "lambda s: unicode(s, 'utf-8')"))
+               (substitute* "tegaki/engine.py"
+                 (("/usr(/local)?")
+                  (assoc-ref inputs "python2-tegaki-wagomu")))
+               #t))))))
+    ;; override inherited inputs
+    (inputs '())
+    (native-inputs '())
+    (propagated-inputs
+     `(("python2-tegaki-wagomu" ,python2-tegaki-wagomu)
+       ("python2-zinnia" ,python2-zinnia)))
+    (synopsis
+     "Chinese and Japanese Handwriting Recognition (Base python library)")
+    (license (list gpl2+ ; all files except...
+                   bsd-3 ; dictutils.py
+                   zpl2.1)))) ; minjson.py
-- 
2.22.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-20 15:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 15:46 [bug#37103] [PATCH 04/20] gnu: Add python2-tegaki-python Alex Vong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).