[packages/hfst] - updated to 3.15.1 - added python3 patch (fix tagger_aux module, as hfst-tagger is now built for py

qboosh qboosh at pld-linux.org
Sun Oct 20 11:28:03 CEST 2019


commit f1919dce444d5eb4e69e213482226df7813c77fc
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 20 11:31:34 2019 +0200

    - updated to 3.15.1
    - added python3 patch (fix tagger_aux module, as hfst-tagger is now built for python3)

 hfst-pc.patch      | 10 +++++-----
 hfst-python3.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hfst.spec          | 16 ++++++++++------
 3 files changed, 69 insertions(+), 11 deletions(-)
---
diff --git a/hfst.spec b/hfst.spec
index 518fd08..ebf9f73 100644
--- a/hfst.spec
+++ b/hfst.spec
@@ -6,15 +6,16 @@
 Summary:	Helsinki Finite-State Transducer (library and application suite)
 Summary(pl.UTF-8):	Helsinki Finite-State Transducer (biblioteka i zestaw aplikacji)
 Name:		hfst
-Version:	3.15.0
-Release:	2
+Version:	3.15.1
+Release:	1
 License:	LGPL v3 (library), GPL v3 (tools)
 Group:		Applications/Text
 #Source0Download: https://github.com/hfst/hfst/releases
-Source0:	https://github.com/hfst/hfst/releases/download/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	a2a458f23f7f07b176a64f5bd007fb63
+Source0:	https://github.com/hfst/hfst/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	31b046a2c42c5f169dd1a973b82677f4
 Patch0:		%{name}-pc.patch
 Patch1:		build.patch
+Patch2:		%{name}-python3.patch
 URL:		http://www.ling.helsinki.fi/kieliteknologia/tutkimus/hfst/
 # bundled library is used
 #BuildRequires:	SFST-devel
@@ -126,6 +127,7 @@ Wiązanie Pythona 3 do biblioteki HFST.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -194,8 +196,10 @@ rm -rf $RPM_BUILD_ROOT
 %files tagger
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/hfst_tagger_compute_data_statistics.py
-%{py_sitescriptdir}/hfst_tagger_compute_data_statistics.py[co]
-%{py_sitescriptdir}/tagger_aux.py[co]
+%{py3_sitescriptdir}/hfst_tagger_compute_data_statistics.py
+%{py3_sitescriptdir}/tagger_aux.py
+%{py3_sitescriptdir}/__pycache__/hfst_tagger_compute_data_statistics.cpython-*.py[co]
+%{py3_sitescriptdir}/__pycache__/tagger_aux.cpython-*.py[co]
 %{_mandir}/man1/hfst_tagger_compute_data_statistics.py.1*
 
 %files devel
diff --git a/hfst-pc.patch b/hfst-pc.patch
index 5836ab8..3ae9569 100644
--- a/hfst-pc.patch
+++ b/hfst-pc.patch
@@ -1,8 +1,8 @@
---- hfst-3.14.0/libhfst/hfst.pc.in~	2017-03-08 12:58:26.000000000 +0100
-+++ hfst-3.14.0/libhfst/hfst.pc.in	2018-07-06 09:12:26.281756872 +0200
-@@ -7,4 +7,4 @@ Name: hfst
+--- hfst-3.15.1/libhfst/hfst.pc.in.orig	2019-10-18 20:34:51.360631767 +0200
++++ hfst-3.15.1/libhfst/hfst.pc.in	2019-10-18 20:57:42.283204842 +0200
+@@ -7,4 +7,4 @@
  Description: Finite-state transducer library bridge for multiple FLOSS packages
  Version: @LIBHFST_VERSION@
  Libs: -L${libdir} -l at LIBHFST_NAME@
--Cflags: -I${includedir}/hfst/ @GLIB_CFLAGS@
-+Cflags: -I${includedir}/hfst @GLIB_CFLAGS@
+-Cflags: -I${includedir}/hfst/
++Cflags: -I${includedir}/hfst
diff --git a/hfst-python3.patch b/hfst-python3.patch
new file mode 100644
index 0000000..f9c79e1
--- /dev/null
+++ b/hfst-python3.patch
@@ -0,0 +1,54 @@
+--- hfst-3.15.1/tools/src/hfst-tagger/src/build_model_src/tagger_aux.py.orig	2019-09-03 14:18:06.000000000 +0200
++++ hfst-3.15.1/tools/src/hfst-tagger/src/build_model_src/tagger_aux.py	2019-10-20 08:31:18.809679816 +0200
+@@ -17,6 +17,8 @@
+ #   You should have received a copy of the GNU General Public License
+ #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
++from __future__ import print_function
++
+ import math
+ import collections
+ import string
+@@ -212,7 +214,7 @@
+         for count in object_counter.itervalues():
+             max_object_count = max(max_object_count, count)
+ 
+-        print "PENALTY_WEIGHT=" + str(get_penalty(1, max_object_count + 1))
++        print("PENALTY_WEIGHT=" + str(get_penalty(1, max_object_count + 1)))
+ 
+     for pair, penalty in penalty_map.iteritems():
+         if type(pair[0]) == type(u"") or type(pair[0]) == type(""):
+@@ -234,13 +236,13 @@
+                 s = string.join([p[0] + appended_suffix,
+                                  p[1],
+                                  str(penalty)],"\t")
+-                print s.encode("utf-8")
++                print(s.encode("utf-8"))
+             else:
+                 
+                 s = string.join([p[1] + appended_suffix,
+                                  p[0],
+                                  str(penalty)],"\t")
+-                print s.encode("utf-8")
++                print(s.encode("utf-8"))
+         else:
+             for entry in pair[0]:
+                 e = list(entry)
+@@ -256,9 +258,9 @@
+                     pass
+                 
+                 s = e[0] + "\t" + e[1] + "\t"
+-                print s.encode("utf-8"),
++                print(s.encode("utf-8"), end='')
+ 
+-            print penalty
++            print(penalty)
+ 
+ def print_penalties(object_counter, total_count, appended_suffix):
+ 
+@@ -274,4 +276,4 @@
+ 
+         s = o + appended_suffix + "T\t" + str(penalty)
+ 
+-        print s.encode("utf-8")
++        print(s.encode("utf-8"))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hfst.git/commitdiff/f1919dce444d5eb4e69e213482226df7813c77fc



More information about the pld-cvs-commit mailing list