Browse Source

chinese/sunpinyin: fix build with python3 scons

Approved by:	portmgr blanket
main
Dmitry Marakasov 3 weeks ago
parent
commit
4c690987ca
  1. 2
      chinese/sunpinyin/Makefile
  2. 23
      chinese/sunpinyin/files/patch-SConstruct
  3. 11
      chinese/sunpinyin/files/patch-src_SConscript

2
chinese/sunpinyin/Makefile

@ -18,7 +18,7 @@ NOT_FOR_ARCHS_REASON= ./config.h:119:3: can not detect the endianness!
LIB_DEPENDS= libsqlite3.so:databases/sqlite3
USES= gmake iconv perl5 pkgconfig python:2.7 scons:python2 shebangfix
USES= gmake iconv perl5 pkgconfig python:2.7 scons shebangfix
USE_GITHUB= yes
GH_TAGNAME= a8bd811

23
chinese/sunpinyin/files/patch-SConstruct

@ -1,6 +1,14 @@
--- SConstruct.orig 2014-11-14 14:17:48 UTC
+++ SConstruct
@@ -215,10 +215,11 @@ def CreateEnvironment():
@@ -1,6 +1,7 @@
import platform
import os
import sys
+from functools import reduce
version = "2.0.4"
@@ -215,10 +216,11 @@ def CreateEnvironment():
make = 'gmake'
tar = 'gtar'
libln_builder = Builder(action='cd ${TARGET.dir} && ln -s ${SOURCE.name} ${TARGET.name}')
@ -15,7 +23,16 @@
env.Append(BUILDERS={'InstallAsSymlink': libln_builder})
env['ENDIANNESS'] = "be" if sys.byteorder == "big" else "le"
return env
@@ -375,7 +376,6 @@ def DoConfigure():
@@ -227,7 +229,7 @@ def CreateEnvironment():
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()
@@ -375,7 +377,6 @@ def DoConfigure():
conf.CheckFunc('getopt_long')
conf.CheckFunc('getpagesize')
conf.CheckFunc('get_opt')
@ -23,7 +40,7 @@
conf.CheckCHeader('inttypes.h')
conf.CheckCHeader('locale.h')
conf.CheckCHeader('libintl.h')
@@ -463,7 +463,7 @@ def DoInstall():
@@ -463,7 +464,7 @@ def DoInstall():
lib_target_bin),
]

11
chinese/sunpinyin/files/patch-src_SConscript

@ -0,0 +1,11 @@
--- src/SConscript.orig 2014-11-14 14:17:48 UTC
+++ src/SConscript
@@ -53,7 +53,7 @@ env.Substfile('sunpinyin-dictgen.mk.in', SUBST_DICT={
})
env.Command('sunpinyin-dictgen', 'sunpinyin-dictgen.mk', [
Copy("$TARGET", "$SOURCE"),
- Chmod("$TARGET", 0755),
+ Chmod("$TARGET", 0o755),
])
# -*- indent-tabs-mode: nil -*- vim:et:ts=4
Loading…
Cancel
Save