diff options
author | joerg <joerg@pkgsrc.org> | 2020-05-31 20:49:32 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2020-05-31 20:49:32 +0000 |
commit | 3a12f273afbd3bb33cb31b8be3a0fd7ede82c05e (patch) | |
tree | e0bc14018181a75968f2f01ae058c9afa1ca87b9 /math/z3 | |
parent | 6c32e5f95c513f5d2207a302c9f0738f5978d8b8 (diff) | |
download | pkgsrc-3a12f273afbd3bb33cb31b8be3a0fd7ede82c05e.tar.gz |
Explicitly read files as unicode for Python 3. The content is converted
using the system locale with Python 3.6 otherwise, falling back to
ASCII.
Diffstat (limited to 'math/z3')
-rw-r--r-- | math/z3/distinfo | 5 | ||||
-rw-r--r-- | math/z3/patches/patch-scripts_mk__genfile__common.py | 44 | ||||
-rw-r--r-- | math/z3/patches/patch-scripts_mk__util.py | 20 |
3 files changed, 62 insertions, 7 deletions
diff --git a/math/z3/distinfo b/math/z3/distinfo index 302345a9410..5b60225360d 100644 --- a/math/z3/distinfo +++ b/math/z3/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.8 2018/12/18 06:46:39 kamil Exp $ +$NetBSD: distinfo,v 1.9 2020/05/31 20:49:33 joerg Exp $ SHA1 (z3-4.8.3.tar.gz) = bc713372c9be6808306a8e0844caf27c0a10ee2c RMD160 (z3-4.8.3.tar.gz) = 3b8bc18719725c0d110ca52f7e692519cbac341e SHA512 (z3-4.8.3.tar.gz) = 34a2dca0083ed469fdaf5ac062dda26248633245607ddd9ef90629c5f76ae30f87bfa4191c04ba9be7a617bf182a1bd00b59fd2274699e12ece69b86088c8044 Size (z3-4.8.3.tar.gz) = 4119116 bytes -SHA1 (patch-scripts_mk__util.py) = 59c17bbcd05be21089a89ae304662b69bd2a571d +SHA1 (patch-scripts_mk__genfile__common.py) = ecedf747f4a5b4cb410898a6cb65eed2aad46d27 +SHA1 (patch-scripts_mk__util.py) = 79106c08ce39901d13eaab5a18173fcb0479dc96 diff --git a/math/z3/patches/patch-scripts_mk__genfile__common.py b/math/z3/patches/patch-scripts_mk__genfile__common.py new file mode 100644 index 00000000000..ece04ec0e1e --- /dev/null +++ b/math/z3/patches/patch-scripts_mk__genfile__common.py @@ -0,0 +1,44 @@ +$NetBSD: patch-scripts_mk__genfile__common.py,v 1.1 2020/05/31 20:49:34 joerg Exp $ + +--- scripts/mk_genfile_common.py.orig 2018-11-19 20:21:17.000000000 +0000 ++++ scripts/mk_genfile_common.py +@@ -622,7 +622,8 @@ def mk_gparams_register_modules_internal + reg_mod_descr_pat = re.compile('[ \t]*REG_MODULE_DESCRIPTION\(\'([^\']*)\', *\'([^\']*)\'\)') + for h_file in sorted_headers_by_component(h_files_full_path): + added_include = False +- with open(h_file, 'r') as fin: ++ py3args = { 'encoding': 'UTF-8' } if sys.version_info.major >= 3 else {} ++ with open(h_file, 'r', **py3args) as fin: + for line in fin: + m = reg_pat.match(line) + if m: +@@ -696,7 +697,8 @@ def mk_install_tactic_cpp_internal(h_fil + for h_file in sorted_headers_by_component(h_files_full_path): + added_include = False + try: +- with open(h_file, 'r') as fin: ++ py3args = { 'encoding': 'UTF-8' } if sys.version_info.major >= 3 else {} ++ with open(h_file, 'r', **py3args) as fin: + for line in fin: + if tactic_pat.match(line): + if not added_include: +@@ -764,7 +766,8 @@ def mk_mem_initializer_cpp_internal(h_fi + finalizer_pat = re.compile('[ \t]*ADD_FINALIZER\(\'([^\']*)\'\)') + for h_file in sorted_headers_by_component(h_files_full_path): + added_include = False +- with open(h_file, 'r') as fin: ++ py3args = { 'encoding': 'UTF-8' } if sys.version_info.major >= 3 else {} ++ with open(h_file, 'r', **py3args) as fin: + for line in fin: + m = initializer_pat.match(line) + if m: +@@ -806,7 +809,8 @@ def mk_pat_db_internal(inputFilePath, ou + """ + Generate ``g_pattern_database[]`` declaration header file. + """ +- with open(inputFilePath, 'r') as fin: ++ py3args = { 'encoding': 'UTF-8' } if sys.version_info.major >= 3 else {} ++ with open(inputFilePath, 'r', **py3args) as fin: + with open(outputFilePath, 'w') as fout: + fout.write('static char const g_pattern_database[] =\n') + for line in fin: diff --git a/math/z3/patches/patch-scripts_mk__util.py b/math/z3/patches/patch-scripts_mk__util.py index 67c64545952..5d567969de9 100644 --- a/math/z3/patches/patch-scripts_mk__util.py +++ b/math/z3/patches/patch-scripts_mk__util.py @@ -1,8 +1,18 @@ -$NetBSD: patch-scripts_mk__util.py,v 1.5 2018/12/18 06:46:39 kamil Exp $ +$NetBSD: patch-scripts_mk__util.py,v 1.6 2020/05/31 20:49:34 joerg Exp $ ---- scripts/mk_util.py.orig 2018-12-15 09:28:53.381588998 +0000 +--- scripts/mk_util.py.orig 2018-11-19 20:21:17.000000000 +0000 +++ scripts/mk_util.py -@@ -2001,7 +2001,7 @@ class JavaDLLComponent(Component): +@@ -803,7 +803,8 @@ def extract_c_includes(fname): + # We should generate and error for any occurrence of #include that does not match the previous pattern. + non_std_inc_pat = re.compile(".*#include.*") + +- f = open(fname, 'r') ++ py3args = { 'encoding': 'UTF-8' } if sys.version_info.major >= 3 else {} ++ f = open(fname, 'r', **py3args) + linenum = 1 + for line in f: + m1 = std_inc_pat.match(line) +@@ -2001,7 +2002,7 @@ class JavaDLLComponent(Component): out.write('\t$(SLINK) $(SLINK_OUT_FLAG)libz3java$(SO_EXT) $(SLINK_FLAGS) %s$(OBJ_EXT) libz3$(LIB_EXT)\n' % os.path.join('api', 'java', 'Native')) else: @@ -11,7 +21,7 @@ $NetBSD: patch-scripts_mk__util.py,v 1.5 2018/12/18 06:46:39 kamil Exp $ os.path.join('api', 'java', 'Native')) out.write('%s.jar: libz3java$(SO_EXT) ' % self.package_name) deps = '' -@@ -2694,7 +2694,8 @@ def mk_config(): +@@ -2694,7 +2695,8 @@ def mk_config(): check_ar() CXX = find_cxx_compiler() CC = find_c_compiler() @@ -21,7 +31,7 @@ $NetBSD: patch-scripts_mk__util.py,v 1.5 2018/12/18 06:46:39 kamil Exp $ EXE_EXT = '' LIB_EXT = '.a' if GPROF: -@@ -2822,6 +2823,7 @@ def mk_config(): +@@ -2822,6 +2824,7 @@ def mk_config(): config.write('SLINK_FLAGS=%s\n' % SLIBFLAGS) config.write('SLINK_EXTRA_FLAGS=%s\n' % SLIBEXTRAFLAGS) config.write('SLINK_OUT_FLAG=-o \n') |