Update to 1.3

- Fix use of distutils (RHBZ#2220578) (RHBZ#2154948)
- Use %autorelease and %autosetup
- Migrate to SPDX license tag
- Drop AUTHORS and include path (merged upstream)
This commit is contained in:
Sandro 2023-07-20 01:27:40 +02:00
parent cb4cf88539
commit 79a7b7639a
No known key found for this signature in database
GPG Key ID: 68D0FF74FE9F382A
5 changed files with 29 additions and 55 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/cangjie-1.0.tar.xz
/cangjie-1.1.tar.xz
/cangjie-1.2.tar.xz
/pycangjie-1.3.tar.gz

View File

@ -1,43 +0,0 @@
From 5ba4e199a715cf5f935418d2bbf7f1930a24cb39 Mon Sep 17 00:00:00 2001
From: Mathieu Bridon <bochecha@daitauha.fr>
Date: Mon, 2 Mar 2015 13:34:16 +0800
Subject: [PATCH] build: Explicitly set the include path
This fixes build with Cython 0.22
https://bugs.gentoo.org/show_bug.cgi?id=541022
---
Makefile.am | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6762b97..c0cc699 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,19 +47,19 @@ pkgpyexecdir = $(pyexecdir)/cangjie
src/cangjie/_core.c: src/cangjie/_core.pyx src/cangjie/_core.pxd
$(MKDIR_P) src/cangjie
- $(CYTHON) -3 --verbose -o $@ $(srcdir)/src/cangjie/_core.pyx
+ $(CYTHON) -3 --verbose -o $@ -I $(srcdir)/src/cangjie $(srcdir)/src/cangjie/_core.pyx
src/cangjie/errors.c: src/cangjie/errors.pyx src/cangjie/_core.pxd
$(MKDIR_P) src/cangjie
- $(CYTHON) -3 --verbose -o $@ $(srcdir)/src/cangjie/errors.pyx
+ $(CYTHON) -3 --verbose -o $@ -I $(srcdir)/src/cangjie $(srcdir)/src/cangjie/errors.pyx
src/cangjie/filters.c: src/cangjie/filters.pyx src/cangjie/_core.pxd
$(MKDIR_P) src/cangjie
- $(CYTHON) -3 --verbose -o $@ $(srcdir)/src/cangjie/filters.pyx
+ $(CYTHON) -3 --verbose -o $@ -I $(srcdir)/src/cangjie $(srcdir)/src/cangjie/filters.pyx
src/cangjie/versions.c: src/cangjie/versions.pyx src/cangjie/_core.pxd
$(MKDIR_P) src/cangjie
- $(CYTHON) -3 --verbose -o $@ $(srcdir)/src/cangjie/versions.pyx
+ $(CYTHON) -3 --verbose -o $@ -I $(srcdir)/src/cangjie $(srcdir)/src/cangjie/versions.pyx
# -- Testing -------------------------
TESTS = tests/run_tests
--
2.4.3

14
39.patch Normal file
View File

@ -0,0 +1,14 @@
diff --git a/configure.ac b/configure.ac
index a4ed069..9ab152a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,8 @@ CYTHON_MIN_VERSION=0.14
AC_MSG_CHECKING(for cython version)
CYTHON_VERSION=`$CYTHON --version 2>&1 | cut -d" " -f3`
AC_MSG_RESULT($CYTHON_VERSION)
-$PYTHON -c "from distutils.version import StrictVersion as ver; import sys; sys.exit(0 if ver(\"$CYTHON_VERSION\") >= ver(\"$CYTHON_MIN_VERSION\") else 1)"
+# Version is strict. See: https://github.com/pypa/packaging/issues/520#issuecomment-1067119795
+$PYTHON -c "from packaging.version import Version as ver; import sys; sys.exit(0 if ver(\"$CYTHON_VERSION\") >= ver(\"$CYTHON_MIN_VERSION\") else 1)"
AS_IF([test $? = 1], [AC_MSG_ERROR([Please use cython >= $CYTHON_MIN_VERSION])])
AC_SUBST(CYTHON)

View File

@ -1,30 +1,32 @@
%global module_name cangjie
%global forgeurl https://github.com/Cangjians/pycangjie
Name: python3-%{module_name}
Summary: Python bindings to libcangjie
Version: 1.2
Release: %autorelease
License: LGPLv3+
Version: 1.3
Release: %{autorelease}
%forgemeta
License: LGPL-3.0-only
URL: http://cangjians.github.io/projects/pycangjie
Source0: http://cangjians.github.io/downloads/pycangjie/%{module_name}-%{version}.tar.xz
Source0: %{forgesource}
# Replace use of distutils (removed from Python3.12)
# https://patch-diff.githubusercontent.com/raw/Cangjians/pycangjie/pull/39
Patch0: https://patch-diff.githubusercontent.com/raw/Cangjians/pycangjie/pull/39.patch
Patch0: 0001-build-Explicitly-set-the-include-path.patch
BuildRequires: make
BuildRequires: make
BuildRequires: autoconf automake libtool
BuildRequires: python3-Cython
BuildRequires: python3-devel
BuildRequires: libcangjie-devel >= 1.2
%description
Python bindings to libcangjie, the library implementing Cangjie and Quick
input methods.
%prep
%setup -q -n %{module_name}-%{version}
%patch0 -p1
%autosetup -p1 -n pycangjie-%{version}
%build
@ -44,7 +46,7 @@ make check
%files
%doc AUTHORS COPYING README.md docs/*.md
%doc COPYING README.md docs/*.md
%{python3_sitearch}/%{module_name}

View File

@ -1 +1 @@
bcdd86b5cc9c2deef95214e0852a1ee0 cangjie-1.2.tar.xz
SHA512 (pycangjie-1.3.tar.gz) = 6fb1178b38acf73073cafed7942ddd93591083cc9a327b8aa42f430fa312fb429da6cd75bef2ffd30c5657e91aca5d8a4fa2e0f8c0585cc7581a799c4316487c