public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kevin Kofler <Kevin@tigcc.ticalc.org>
To: git-commits@fedoraproject.org
Subject: [rpms/kig] epel10: enable Python 3 support, drop Python 2 support where it was enabled
Date: Tue, 04 Aug 2026 19:44:46 GMT	[thread overview]
Message-ID: <178587268693.1.4859241986329736142.rpms-kig-9de469768409@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/kig
            Branch : epel10
            Commit : 9de46976840965384f41684a0f63e41f6531168e
            Author : Kevin Kofler <Kevin@tigcc.ticalc.org>
            Date   : 2019-10-29T14:07:31+01:00
            Stats  : +44/-12 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/kig/c/9de46976840965384f41684a0f63e41f6531168e?branch=epel10

            Log:
            enable Python 3 support, drop Python 2 support where it was enabled

* Tue Oct 29 2019 Kevin Kofler <Kevin@tigcc.ticalc.org> - 19.08.1-3
- enable Python 3 support, drop Python 2 support where it was enabled

Note that F30 shipped without Python support at all because the
"temporary workaround" was never dropped, so this is not an
incompatible change there.

As for F29, it is only 1 month away from its EOL, so I would just not
upgrade kig there at all at this point. (It currently has 18.12.2.)

---
diff --git a/kig-19.08.1-python3.patch b/kig-19.08.1-python3.patch
new file mode 100644
index 0000000..d6554d6
--- /dev/null
+++ b/kig-19.08.1-python3.patch
@@ -0,0 +1,28 @@
+From c0aa768f28219ce8b3c275a6d13ad69757e3c7af Mon Sep 17 00:00:00 2001
+From: Yuri Chornoivan <yurchor@ukr.net>
+Date: Tue, 22 Oct 2019 20:42:51 +0300
+Subject: Try to fix Python 3 build
+
+---
+ scripting/python_scripter.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/scripting/python_scripter.cc b/scripting/python_scripter.cc
+index e60a90c..62a7409 100644
+--- a/scripting/python_scripter.cc
++++ b/scripting/python_scripter.cc
+@@ -390,7 +390,11 @@ PythonScripter::PythonScripter()
+   // the newstring stuff is to prevent warnings about conversion from
+   // const char* to char*..
+   char* s = newstring( "kig" );
++#if PY_VERSION_HEX >= 0x03000000
++  PyImport_AppendInittab( s, PyInit_kig );
++#else
+   PyImport_AppendInittab( s, initkig );
++#endif
+   //  we can't delete this yet, since python keeps a pointer to it..
+   // This means we have a small but harmless memory leak here, but it
+   // doesn't hurt at all, since it could only be freed at the end of
+-- 
+cgit v1.1
+

diff --git a/kig.spec b/kig.spec
index a2bf16e..96d06e9 100644
--- a/kig.spec
+++ b/kig.spec
@@ -2,7 +2,7 @@
 Name:    kig
 Summary: Interactive Geometry 
 Version: 19.08.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 License: GPLv2+
 URL:     https://cgit.kde.org/%{name}.git
@@ -21,14 +21,15 @@ Source0: http://download.kde.org/%{stable}/applications/%{version}/src/%{name}-%
 # https://git.reviewboard.kde.org/r/126549/
 Patch1: 0001-explicitly-use-QLibrary-to-load-libpython-like-pykde.patch
 
+# upstream patches
+# fix build with Python 3
+# https://commits.kde.org/kig/c0aa768f28219ce8b3c275a6d13ad69757e3c7af
+Patch100: kig-19.08.1-python3.patch
+
 BuildRequires: boost-devel
-%if 0%{?fedora} > 28 && 0%{?fedora} < 30
-# requires newer/fixed FindBoost.cmake
-%global boost 1
-BuildRequires: boost-python2-devel
-%endif
-BuildRequires: python2
-BuildRequires: python2-rpm-macros
+BuildRequires: boost-python3-devel
+BuildRequires: python3
+BuildRequires: python3-rpm-macros
 
 BuildRequires: desktop-file-utils
 BuildRequires: gettext
@@ -62,14 +63,16 @@ Conflicts: kdeedu-math < 4.7.0-10
 %prep
 %autosetup -p1
 
-sed -ie "s|^#!/usr/bin/env python|#!%{__python2}|" pykig/pykig.py
+sed -ie "s|^#!/usr/bin/env python|#!%{__python3}|" pykig/pykig.py
 
 
 %build
 mkdir %{_target_platform}
 pushd %{_target_platform}
 %{cmake_kf5} .. \
-  -DPYTHON_EXECUTABLE:PATH=%{__python2}
+  -DPYTHON_EXECUTABLE:PATH=%{__python3} \
+  -DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}m \
+  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}m.so
 popd
 
 %make_build -C %{_target_platform}
@@ -102,13 +105,14 @@ desktop-file-validate %{buildroot}%{_kf5_datadir}/applications/org.kde.%{name}.d
 %{_kf5_datadir}/kxmlgui5/%{name}/
 #{_kf5_datadir}/sounds/%{name}*
 %{_kf5_qtplugindir}/kigpart.so
-%if 0%{?boost}
 %{_kf5_datadir}/katepart5/syntax/python-kig.xml
-%endif
 %{_mandir}/man1/kig.1*
 
 
 %changelog
+* Tue Oct 29 2019 Kevin Kofler <Kevin@tigcc.ticalc.org> - 19.08.1-3
+- enable Python 3 support, drop Python 2 support where it was enabled
+
 * Sat Oct 19 2019 Kevin Kofler <Kevin@tigcc.ticalc.org> - 19.08.1-2
 - rebuild in Rawhide after unretirement
 

                 reply	other threads:[~2026-08-04 19:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178587268693.1.4859241986329736142.rpms-kig-9de469768409@fedoraproject.org \
    --to=kevin@tigcc.ticalc.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox