[arch-commits] Commit in sunpinyin/repos/community-x86_64 (4 files)

Felix Yan felixonmars at gemini.archlinux.org
Fri Sep 9 17:35:59 UTC 2022


    Date: Friday, September 9, 2022 @ 17:35:59
  Author: felixonmars
Revision: 1297278

archrelease: copy trunk to community-x86_64

Added:
  sunpinyin/repos/community-x86_64/PKGBUILD
    (from rev 1297277, sunpinyin/trunk/PKGBUILD)
Deleted:
  sunpinyin/repos/community-x86_64/PKGBUILD
  sunpinyin/repos/community-x86_64/scons-python3.patch
  sunpinyin/repos/community-x86_64/sunpinyin-use-python3.patch

-----------------------------+
 PKGBUILD                    |   69 ++++++----------
 scons-python3.patch         |   50 ------------
 sunpinyin-use-python3.patch |  171 ------------------------------------------
 3 files changed, 28 insertions(+), 262 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2022-09-09 17:35:40 UTC (rev 1297277)
+++ PKGBUILD	2022-09-09 17:35:59 UTC (rev 1297278)
@@ -1,41 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Thomas Dziedzic < gostrc at gmail >
-
-pkgname=sunpinyin
-pkgver=3.0.0rc1
-_tag=v3.0.0-rc1
-pkgrel=4
-arch=('x86_64')
-pkgdesc="Statistical Language Model based pinyin IME by Sun"
-license=('LGPL')
-url="http://sunpinyin.googlecode.com"
-depends=('sqlite' 'make' 'gcc-libs')
-optdepends=('sunpinyin-data: Statistical language model data from open-gram project for sunpinyin')
-makedepends=('git' 'scons' 'intltool' 'python')
-source=("git://github.com/sunpinyin/sunpinyin.git#tag=$_tag"
-         scons-python3.patch
-         sunpinyin-use-python3.patch)
-md5sums=('SKIP'
-         '268a91412d5e5c8f3e7a092b0daa8220'
-         'a652f3f3260968d18c876f6178d7fbf4')
-
-prepare() {
-  cd "$srcdir/$pkgname"
-
-  patch -p1 -i ../scons-python3.patch
-  patch -p1 -i ../sunpinyin-use-python3.patch
-}
-
-build() {
-  cd "$srcdir/$pkgname"
-  scons \
-    --prefix=/usr
-}
-
-package() {
-  cd "$srcdir/$pkgname"
-  scons \
-    --prefix=/usr \
-    --install-sandbox="$pkgdir" \
-    install
-}

Copied: sunpinyin/repos/community-x86_64/PKGBUILD (from rev 1297277, sunpinyin/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2022-09-09 17:35:59 UTC (rev 1297278)
@@ -0,0 +1,28 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+
+pkgname=sunpinyin
+pkgver=3.0.0rc2
+_tag=3.0.0-rc2
+pkgrel=1
+arch=(x86_64)
+pkgdesc="Statistical Language Model based pinyin IME by Sun"
+license=(LGPL)
+url="http://sunpinyin.googlecode.com"
+depends=(sqlite make gcc-libs)
+makedepends=(git scons intltool python)
+optdepends=('sunpinyin-data: Statistical language model data from open-gram project for sunpinyin')
+source=("https://github.com/sunpinyin/sunpinyin/archive/v$_tag/sunpinyin-$_tag.tar.gz")
+sha512sums=('a2f189100c0070c82613fc8bb0d8bb7e7def25ea62075074f181b786e7bf8c7527fccaae879db7c9c73c29657b45da1b6f9d2cd2630088b17448eabad545c3d8')
+
+build() {
+  cd $pkgname-$_tag
+  scons --prefix=/usr
+}
+
+package() {
+  cd $pkgname-$_tag
+  scons --prefix=/usr \
+        --install-sandbox="$pkgdir" \
+        install
+}

Deleted: scons-python3.patch
===================================================================
--- scons-python3.patch	2022-09-09 17:35:40 UTC (rev 1297277)
+++ scons-python3.patch	2022-09-09 17:35:59 UTC (rev 1297278)
@@ -1,50 +0,0 @@
---- sunpinyin/SConstruct.orig	2019-07-26 18:43:44.176969620 +0000
-+++ sunpinyin/SConstruct	2019-07-26 18:44:16.680683795 +0000
-@@ -1,6 +1,7 @@
- import platform
- import os
- import sys
-+from functools import reduce
- 
- 
- version = "2.0.4"
-@@ -227,7 +227,7 @@
- def PassVariables(envvar, env):
-     for (x, y) in envvar:
-         if x in os.environ:
--            print 'Warning: you\'ve set %s in the environmental variable!' % x
-+            print ('Warning: you\'ve set %s in the environmental variable!' % x)
-             env[y] = os.environ[x]
- 
- env = CreateEnvironment()
---- sunpinyin/wrapper/ibus/SConstruct.orig	2019-07-26 18:47:21.482881594 +0000
-+++ sunpinyin/wrapper/ibus/SConstruct	2019-07-26 18:47:44.303156268 +0000
-@@ -36,7 +36,7 @@
- def PassVariables(envvar, env):
-     for (x, y) in envvar:
-         if x in os.environ:
--            print 'Warning: you\'ve set %s in the environmental variable!' % x
-+            print ('Warning: you\'ve set %s in the environmental variable!' % x)
-             env[y] = os.environ[x]
- 
- env = Environment(ENV=os.environ,
-@@ -141,7 +141,7 @@
-     libexec_target = env.Install(bin_dir, ['ibus-engine-sunpinyin', 
-                                            'setup/ibus-setup-sunpinyin'])
-     for exec_bin in libexec_target:
--        env.AddPostAction(exec_bin, Chmod(str(exec_bin), 0755))
-+        env.AddPostAction(exec_bin, Chmod(str(exec_bin), '0755'))
-         
-     setup_target = env.Install(data_dir + '/setup',
-                                ['setup/setup.xml',
---- sunpinyin/src/SConscript.orig	2019-07-26 18:52:28.323285506 +0000
-+++ sunpinyin/src/SConscript	2019-07-26 18:52:51.890242437 +0000
-@@ -53,7 +53,7 @@
- })
- env.Command('sunpinyin-dictgen', 'sunpinyin-dictgen.mk', [
-     Copy("$TARGET", "$SOURCE"),
--    Chmod("$TARGET", 0755),
-+    Chmod("$TARGET", '0755'),
- ])
- 
- # -*- indent-tabs-mode: nil -*- vim:et:ts=4

Deleted: sunpinyin-use-python3.patch
===================================================================
--- sunpinyin-use-python3.patch	2022-09-09 17:35:40 UTC (rev 1297277)
+++ sunpinyin-use-python3.patch	2022-09-09 17:35:59 UTC (rev 1297278)
@@ -1,171 +0,0 @@
-commit d0693ba9f2686ffa46328da129ffef345258fa12
-Author: Peng Wu <alexepico at gmail.com>
-Date:   Thu Jul 26 15:08:41 2018 +0800
-
-    Use python3
-
-Index: sunpinyin-20190805/SConstruct
-===================================================================
---- sunpinyin-20190805.orig/SConstruct
-+++ sunpinyin-20190805/SConstruct
-@@ -299,11 +299,11 @@ def CheckPKG(context, name):
- 
- def CheckPython(context):
-     context.Message('Checking for Python library...')
--    ret = context.TryAction('python-config --prefix')[0]
-+    ret = context.TryAction('python3-config --prefix')[0]
-     context.Result(ret)
-     if ret:
--        context.env.MergeFlags(['!python-config --includes',
--                                '!python-config --libs'])
-+        context.env.MergeFlags(['!python3-config --includes',
-+                                '!python3-config --libs'])
-     return ret
- 
- 
-Index: sunpinyin-20190805/python/pinyin_info_gen.py
-===================================================================
---- sunpinyin-20190805.orig/python/pinyin_info_gen.py
-+++ sunpinyin-20190805/python/pinyin_info_gen.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python 
-+#!/usr/bin/python3
- 
- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- # 
-@@ -38,60 +38,60 @@
- from pinyin_data import *
- 
- def fmt_str_array (name, var) :
--    print 'static const char *%s[] = { %s };' % (name, ', '.join ('"%s"' % s for s in var))
-+    print('static const char *%s[] = { %s };' % (name, ', '.join ('"%s"' % s for s in var)))
- 
- def fmt_array_size (name):
--    print 'static const unsigned num_%s = sizeof(%s) / sizeof(*%s);' % (name, name, name)
-+    print('static const unsigned num_%s = sizeof(%s) / sizeof(*%s);' % (name, name, name))
- 
- def fmt_str_pair_array (name, var) :
--    print 'static const char *%s[] = {' % name
-+    print('static const char *%s[] = {' % name)
-     for s1, s2 in var:
--        print '    %-7s %s' % ('"%s",' % s1, '"%s",' % s2)
--    print '};'
-+        print('    %-7s %s' % ('"%s",' % s1, '"%s",' % s2))
-+    print('};')
- 
- def fmt_pair_array_size (name):
--    print 'static const unsigned num_%s = sizeof(%s) / sizeof(*%s) / 2;' % (name, name, name)
-+    print('static const unsigned num_%s = sizeof(%s) / sizeof(*%s) / 2;' % (name, name, name))
- 
- fmt_str_array ('initials', initials)
- fmt_array_size ('initials')
--print ''
-+print('')
- 
- fmt_str_array('finals', finals)
- fmt_array_size ('finals')
--print ''
-+print('')
- 
- fmt_str_array('fuzzy_finals', inner_fuzzy_finals)
- fmt_array_size ('fuzzy_finals')
--print ''
-+print('')
- 
- fmt_str_pair_array ('fuzzy_pairs', fuzzy_pairs)
- fmt_pair_array_size ('fuzzy_pairs')
--print ''
-+print('')
- 
- fmt_str_pair_array ('auto_correction_pairs', sorted(auto_correction_pairs.items()))
- fmt_pair_array_size ('auto_correction_pairs')
--print ''
-+print('')
- 
--print 'static const unsigned fuzzy_finals_map [] = {'
-+print('static const unsigned fuzzy_finals_map [] = {')
- for s in inner_fuzzy_finals:
--    print '    %-7s %-7s %-7s /* %-4s -> %-4s len %d */' % ('0x%02x,' % finals.index(s), '0x%02x,' % valid_syllables[s[1:]], '%d,' % (len(s)-1,),  s, s[1:], len(s)-1)
--print '};\n'
-+    print('    %-7s %-7s %-7s /* %-4s -> %-4s len %d */' % ('0x%02x,' % finals.index(s), '0x%02x,' % valid_syllables[s[1:]], '%d,' % (len(s)-1,),  s, s[1:], len(s)-1))
-+print('};\n')
- 
--print 'static const TPyTabEntry pinyin_table[] = {'
-+print('static const TPyTabEntry pinyin_table[] = {')
- for syllable, hex_syllable in sorted(valid_syllables.items()):
--    print '    { %-9s %s },' % ('"%s",' % syllable, '0x%05x' % hex_syllable)
--print '};\n'
-+    print('    { %-9s %s },' % ('"%s",' % syllable, '0x%05x' % hex_syllable))
-+print('};\n')
- 
--print 'static const unsigned fuzzy_pre_syllables [] = {'
-+print('static const unsigned fuzzy_pre_syllables [] = {')
- for s in fuzzy_pre_syllables:
--    print '    %-11s %-7s %-11s /* %s */' % ('0x%05x,' % valid_syllables[s[:-1]], "'%s'," % s[-1], '0x%05x,' % valid_syllables[s], s)
--print '    0x0,'
--print '};\n'
-+    print('    %-11s %-7s %-11s /* %s */' % ('0x%05x,' % valid_syllables[s[:-1]], "'%s'," % s[-1], '0x%05x,' % valid_syllables[s], s))
-+print('    0x0,')
-+print('};\n')
- 
--print 'static const unsigned fuzzy_pro_syllables [] = {'
-+print('static const unsigned fuzzy_pro_syllables [] = {')
- for s in fuzzy_pro_syllables:
--    print '    %-11s %-7s %-11s /* %s */' % ('0x%05x,' % valid_syllables[s], "'%s'," % s[0], '0x%05x,' % valid_syllables[s[1:]], s)
--print '    0x0,'
--print '};\n'
-+    print('    %-11s %-7s %-11s /* %s */' % ('0x%05x,' % valid_syllables[s], "'%s'," % s[0], '0x%05x,' % valid_syllables[s[1:]], s))
-+print('    0x0,')
-+print('};\n')
- 
- # -*- indent-tabs-mode: nil -*- vim:et:ts=4
-Index: sunpinyin-20190805/python/quanpin_trie_gen.py
-===================================================================
---- sunpinyin-20190805.orig/python/quanpin_trie_gen.py
-+++ sunpinyin-20190805/python/quanpin_trie_gen.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python 
-+#!/usr/bin/python3
- 
- # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- # 
-@@ -42,7 +42,7 @@ import sys
- orig_trie = trie.Trie ()
- pytrie = trie.DATrie ()
- 
--for syllable, hex_syllable in pinyin_data.valid_syllables.items():
-+for syllable, hex_syllable in list(pinyin_data.valid_syllables.items()):
-     orig_trie.add(syllable[::-1], hex_syllable)
- 
- pytrie.construct_from_trie (orig_trie)
-Index: sunpinyin-20190805/python/trie.py
-===================================================================
---- sunpinyin-20190805.orig/python/trie.py
-+++ sunpinyin-20190805/python/trie.py
-@@ -133,7 +133,7 @@ class DATrie (object):
- 
-         trie = Trie()
-         for w in words:
--            trie.add (w, itval.next() if itval else -1)
-+            trie.add (w, next(itval) if itval else -1)
- 
-         self.construct_from_trie (trie, values!=None)
- 
-@@ -161,7 +161,7 @@ class DATrie (object):
-                 if progress_cb:
-                     progress_cb ()
- 
--        for i in xrange (self.chr_encoder (max(trie.root.trans))+1):
-+        for i in range (self.chr_encoder (max(trie.root.trans))+1):
-             if self.check[i] == -1:
-                 self.check[i] = 0
- 
-@@ -272,7 +272,7 @@ def test ():
-         v, l = match_longest (datrie, s+'b')
-         assert (len(s) == l and valid_syllables[s] == v)
- 
--    print 'test executed successfully'
-+    print('test executed successfully')
- 
- if __name__ == "__main__":
-     test ()



More information about the arch-commits mailing list