git: 4c690987cad8 - main - chinese/sunpinyin: fix build with python3 scons
Dmitry Marakasov
amdmi3 at FreeBSD.org
Wed May 26 15:08:33 UTC 2021
The branch main has been updated by amdmi3:
URL: https://cgit.FreeBSD.org/ports/commit/?id=4c690987cad8a48974cc94682c2543c99495101e
commit 4c690987cad8a48974cc94682c2543c99495101e
Author: Dmitry Marakasov <amdmi3 at FreeBSD.org>
AuthorDate: 2021-05-26 14:27:25 +0000
Commit: Dmitry Marakasov <amdmi3 at FreeBSD.org>
CommitDate: 2021-05-26 15:05:36 +0000
chinese/sunpinyin: fix build with python3 scons
Approved by: portmgr blanket
---
chinese/sunpinyin/Makefile | 2 +-
chinese/sunpinyin/files/patch-SConstruct | 23 ++++++++++++++++++++---
chinese/sunpinyin/files/patch-src_SConscript | 11 +++++++++++
3 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/chinese/sunpinyin/Makefile b/chinese/sunpinyin/Makefile
index d1653b64a375..238cf87beb5d 100644
--- a/chinese/sunpinyin/Makefile
+++ b/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
diff --git a/chinese/sunpinyin/files/patch-SConstruct b/chinese/sunpinyin/files/patch-SConstruct
index ffd859c026ff..561817e520f1 100644
--- a/chinese/sunpinyin/files/patch-SConstruct
+++ b/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),
]
diff --git a/chinese/sunpinyin/files/patch-src_SConscript b/chinese/sunpinyin/files/patch-src_SConscript
new file mode 100644
index 000000000000..b579ebd107b8
--- /dev/null
+++ b/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
More information about the dev-commits-ports-all
mailing list