[ffmpeg] Update to 6.1 release
by Leigh Scott
commit 2e44690623554e1096b5bef2a4d7714611f49749
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sat Nov 11 14:19:13 2023 +0000
Update to 6.1 release
...ter-vf_libplacebo-remove-deprecated-field.patch | 73 ---------------------
..._libplacebo-wrap-deprecated-opts-in-FF_AP.patch | 76 ----------------------
...peg_filter-initialize-the-o-to-silence-th.patch | 30 ---------
ffmpeg.spec | 12 ++--
sources | 4 +-
5 files changed, 7 insertions(+), 188 deletions(-)
---
diff --git a/ffmpeg.spec b/ffmpeg.spec
index b0d25aa..77d5fa1 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -111,7 +111,7 @@ ExclusiveArch: armv7hnl
Summary: Digital VCR and streaming server
Name: ffmpeg%{?flavor}
-Version: 6.0.1
+Version: 6.1
Release: 1%{?date:.%{?date}%{?date:git}%{?rel}}%{?dist}
License: %{ffmpeg_license}
URL: https://ffmpeg.org/
@@ -122,11 +122,6 @@ Source0: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz
Source1: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc
Source2: https://ffmpeg.org/ffmpeg-devel.asc
%endif
-Patch0: 0001-avfilter-vf_libplacebo-wrap-deprecated-opts-in-FF_AP.patch
-Patch1: 0001-avfilter-vf_libplacebo-remove-deprecated-field.patch
-# Backport fix for segfault when passing non-existent filter option
-# See: https://bugzilla.rpmfusion.org/show_bug.cgi?id=6773
-Patch2: 0001-fftools-ffmpeg_filter-initialize-the-o-to-silence-th.patch
Conflicts: %{name}-free
Provides: %{name}-bin = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@@ -226,7 +221,7 @@ BuildRequires: texinfo
%{?_with_vpl:BuildRequires: pkgconfig(vpl) >= 2.6}
%{?_with_wavpack:BuildRequires: wavpack-devel}
%{!?_without_vidstab:BuildRequires: vid.stab-devel}
-%{!?_without_vulkan:BuildRequires: vulkan-loader-devel pkgconfig(shaderc)}
+%{!?_without_vulkan:BuildRequires: pkgconfig(shaderc) pkgconfig(vulkan) >= 1.3.255}
%{!?_without_x264:BuildRequires: x264-devel >= 0.0.0-0.31}
%{!?_without_x265:BuildRequires: x265-devel}
%{!?_without_xvid:BuildRequires: xvidcore-devel}
@@ -535,6 +530,9 @@ strip %{buildroot}%{_libdir}/%{name}/libavcodec.so.*
%changelog
+* Sat Nov 11 2023 Leigh Scott <leigh123linux(a)gmail.com> - 6.1-1
+- Update to 6.1 release
+
* Fri Nov 10 2023 Leigh Scott <leigh123linux(a)gmail.com> - 6.0.1-1
- Update to 6.0.1 release
diff --git a/sources b/sources
index 851955a..190b948 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (ffmpeg-6.0.1.tar.xz) = 8a86b2db4a9abb68bb86d770ba1babb76c8b8313cfb0258ae70c88e736a93b99c342a6ecda94b739e8e7c103bed75d4afd756dd94e08c6255f424ef62c264741
-SHA512 (ffmpeg-6.0.1.tar.xz.asc) = 314f9ef996b85bc93c9fb823d582697c7415ac35f56bfc9cd906893491c8076df90bd852cf6e5e757b1fa94bd415ed108488c1220add49eb1f4854fc253c178c
+SHA512 (ffmpeg-6.1.tar.xz) = 72f47924806b9b128672bd268aa2c8fc2c9b8491899a772b6f82421daa2b67de45a4bdd71f6071825814e599a73adb1e42682e202a12fc055e9a224c7d5baa4a
+SHA512 (ffmpeg-6.1.tar.xz.asc) = e4885270869cc6a1681bc3f76f344f77c4858c490a517e45a758d15214ce67c3c2113a1caa8ca65eb6447b68d822fa1dd730081345bcc0928faaf82bb76037ba
1 year
[lpf-cleartype-fonts] Use fontforge and remove obsolete macros
by Sérgio M. Basto
commit 8552cc9fb075d27b66104c39d1e73d3c99f2e717
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sat Nov 11 03:02:47 2023 +0000
Use fontforge and remove obsolete macros
61-cleartype-calibri.conf | 4 +-
61-cleartype-cambria.conf | 4 +-
61-cleartype-candara.conf | 4 +-
61-cleartype-consolas.conf | 4 +-
61-cleartype-constantia.conf | 4 +-
61-cleartype-corbel.conf | 4 +-
cleartype-fonts.spec.in | 201 +++++++++++++++++++++++--------------------
lpf-cleartype-fonts.spec | 5 +-
8 files changed, 123 insertions(+), 107 deletions(-)
---
diff --git a/61-cleartype-calibri.conf b/61-cleartype-calibri.conf
index 7014271..b274e35 100644
--- a/61-cleartype-calibri.conf
+++ b/61-cleartype-calibri.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
diff --git a/61-cleartype-cambria.conf b/61-cleartype-cambria.conf
index 45df8bf..9366092 100644
--- a/61-cleartype-cambria.conf
+++ b/61-cleartype-cambria.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
diff --git a/61-cleartype-candara.conf b/61-cleartype-candara.conf
index 3d3b7a9..9b84790 100644
--- a/61-cleartype-candara.conf
+++ b/61-cleartype-candara.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
diff --git a/61-cleartype-consolas.conf b/61-cleartype-consolas.conf
index 643b431..53f50c8 100644
--- a/61-cleartype-consolas.conf
+++ b/61-cleartype-consolas.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
diff --git a/61-cleartype-constantia.conf b/61-cleartype-constantia.conf
index d9e577b..02007bf 100644
--- a/61-cleartype-constantia.conf
+++ b/61-cleartype-constantia.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
diff --git a/61-cleartype-corbel.conf b/61-cleartype-corbel.conf
index 4b465b4..56ad63b 100644
--- a/61-cleartype-corbel.conf
+++ b/61-cleartype-corbel.conf
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<?xml version="1.0" encoding='UTF-8'?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
diff --git a/cleartype-fonts.spec.in b/cleartype-fonts.spec.in
index 5903e9b..34a2617 100644
--- a/cleartype-fonts.spec.in
+++ b/cleartype-fonts.spec.in
@@ -1,15 +1,104 @@
+%global debug_package %{nil}
%global fontname cleartype
%global fontdir %{_datadir}/fonts/%{fontname}
-Summary: Microsoft ClearType fonts for better Windows Compatibility
+#%%global foundry Microsoft
+
+%global fontlicense non-redistributable, no modifications permitted
+%global fontlicenses eula.txt
+
+%global fontfamily1 %{fontname} Calibri
+%global fontsummary1 %{fontname} Calibri ttf font
+%global fontpkgheader1 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts1 CALIBR*.TTF
+%global fontconfs1 %{SOURCE10}
+%global fontdescription1 %{expand:
+%{common_description}
+Microsoft Calibri font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
+%global fontfamily2 %{fontname} Cambria
+%global fontsummary2 %{fontname} Cambria ttf font
+%global fontpkgheader2 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts2 CAMBRI*.TTF
+%global fontconfs2 %{SOURCE11}
+%global fontdescription2 %{expand:
+%{common_description}
+Microsoft Cambria font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
+%global fontfamily3 %{fontname} Candara
+%global fontsummary3 %{fontname} Trebuchet ttf font
+%global fontpkgheader3 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts3 CANDAR*.TTF
+%global fontconfs3 %{SOURCE12}
+%global fontdescription3 %{expand:
+%{common_description}
+Microsoft Candara font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
+%global fontfamily4 %{fontname} Consolas
+%global fontsummary4 %{fontname} verdana ttf font
+%global fontpkgheader4 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts4 CONSOL*.TTF
+%global fontconfs4 %{SOURCE13}
+%global fontdescription4 %{expand:
+%{common_description}
+Microsoft Consolas font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
+%global fontfamily5 %{fontname} Constantia
+%global fontsummary5 %{fontname} Andale Mono ttf font
+%global fontpkgheader5 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts5 CONSTAN*.TTF
+%global fontconfs5 %{SOURCE14}
+%global fontdescription5 %{expand:
+%{common_description}
+Microsoft Constantia font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
+%global fontfamily6 %{fontname} Corbel
+%global fontsummary6 %{fontname} corbel ttf font
+%global fontpkgheader6 %{expand:
+Obsoletes: %{name}-common < 1.0-5
+}
+
+%global fonts6 CORBEL*.TTF
+%global fontconfs6 %{SOURCE15}
+%global fontdescription6 %{expand:
+%{common_description}
+Microsoft Corbel font, part of the ClearType collection made available
+in the PowerPointViewer package, still available on the Microsoft website.
+}
+
Name: %{fontname}-fonts
Version: 1.0
-Release: 3%{?dist}
+Release: 5%{?dist}
+Summary: Microsoft ClearType fonts for better Windows Compatibility
-URL: http://mscorefonts2.sourceforge.net/
License: non-redistributable, no modifications permitted
+URL: http://mscorefonts2.sourceforge.net/
Group: User Interface/X
-BuildArch: noarch
Source1: http://sourceforge.net/projects/mscorefonts2/files/cabs/PowerPointViewer.exe
Source10: 61-%{fontname}-calibri.conf
Source11: 61-%{fontname}-cambria.conf
@@ -29,6 +118,9 @@ Requires: %{fontname}-corbel-fonts
BuildRequires: cabextract
BuildRequires: fontpackages-devel
+BuildArch: noarch
+
+%fontpkg -a
%description
Cleartype fonts made available to the public in the PowerPoint Viewer
@@ -43,115 +135,36 @@ some cases pdf files produced on Windows hosts are better rendered with
these fonts installed.
-%package common
-Summary: Common support files
-
-%description common
-Common support files for %{fontname}-fonts packages including licenses.
-
-
-%package -n %{fontname}-calibri-fonts
-Summary: %{fontname} Calibri ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-calibri-fonts
-Microsoft Calibri font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n calibri -f *-%{fontname}-calibri.conf CALIBR*.TTF
-
-
-%package -n %{fontname}-cambria-fonts
-Summary: %{fontname} Cambria ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-cambria-fonts
-Microsoft Cambria font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n cambria -f *-%{fontname}-cambria.conf CAMBRI*.TTF
-
-
-%package -n %{fontname}-candara-fonts
-Summary: %{fontname} Trebuchet ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-candara-fonts
-Microsoft Candara font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n candara -f *-%{fontname}-candara.conf CANDAR*.TTF
-
-
-%package -n %{fontname}-consolas-fonts
-Summary: %{fontname} verdana ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-consolas-fonts
-Microsoft Consolas font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n consolas -f *-%{fontname}-consolas.conf CONSOL*.TTF
-
-
-%package -n %{fontname}-constantia-fonts
-Summary: %{fontname} Andale Mono ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-constantia-fonts
-Microsoft Constantia font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n constantia -f *-%{fontname}-constantia.conf CONSTAN*.TTF
-
-
-%package -n %{fontname}-corbel-fonts
-Summary: %{fontname} corbel ttf font
-Requires: %{name}-common = %{version}-%{release}
-
-%description -n %{fontname}-corbel-fonts
-Microsoft Corbel font, part of the ClearType collection made available
-in the PowerPointViewer package, still available on the Microsoft website.
-
-%_font_pkg -n corbel -f *-%{fontname}-corbel.conf CORBEL*.TTF
-
-
%prep
%setup -cT
cabextract %{SOURCE1}
cabextract ppviewer.cab
touch -r eula.txt timestamp
+iconv -f utf-16 -t utf-8 eula.txt > eula.tmp && mv -f eula.tmp eula.txt
sed -i 's/\r//' eula.txt
-iconv -f utf-16 -t utf-8 < eula.txt > eula.tmp && mv -f eula.tmp eula.txt
touch -r timestamp eula.txt
+%forgesetup -a
-%build
+%build
+%fontbuild -a
%install
-install -d $RPM_BUILD_ROOT/%{fontdir}
-install -m 644 -p *.TTF $RPM_BUILD_ROOT/%{fontdir}
-install -m 0755 -d $RPM_BUILD_ROOT%{_fontconfig_templatedir} \
- $RPM_BUILD_ROOT%{_fontconfig_confdir}
-for fontconf in \
- %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15}
-do
- install -m 0644 -p $fontconf %{buildroot}%{_fontconfig_templatedir}
- basename=$( basename $fontconf )
- ln -s %{_fontconfig_templatedir}/$basename \
- %{buildroot}%{_fontconfig_confdir}/$basename
-done
+%fontinstall -a
+%check
+%fontcheck -a
-%files common
-%doc eula.txt
-
+%fontfiles -a
%files
%changelog
+* Sat Nov 11 2023 Sérgio Basto <sergio(a)serjux.com> - 1.0-5
+- Use fontforge and remove obsolete macros
+
* Sun Nov 07 2021 Sérgio Basto <sergio(a)serjux.com> - 1.0-3
- retag it again
diff --git a/lpf-cleartype-fonts.spec b/lpf-cleartype-fonts.spec
index c07f7fa..8b07ed8 100644
--- a/lpf-cleartype-fonts.spec
+++ b/lpf-cleartype-fonts.spec
@@ -1,6 +1,6 @@
Name: lpf-cleartype-fonts
Version: 1.0
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Bootstrap package building cleartype-fonts using lpf
License: MIT
@@ -57,6 +57,9 @@ cleartype-fonts non-redistributable package.
%changelog
+* Sat Nov 11 2023 Sérgio Basto <sergio(a)serjux.com> - 1.0-5
+- Use fontforge and remove obsolete macros
+
* Sun Feb 19 2023 Leigh Scott <leigh123linux(a)gmail.com> - 1.0-4
- Bump
1 year
[discord] Update the app summary/description
by Sérgio M. Basto
commit 61eba3f2439413f50dbf98835952061c6f1b7be6
Author: Ige <2759573-Igetin(a)users.noreply.gitlab.com>
Date: Fri Nov 10 23:32:17 2023 +0200
Update the app summary/description
Remove the references to gaming specifically, to reflect
the application’s current general-purpose branding and status
discord.spec | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/discord.spec b/discord.spec
index 64a6911..86285ac 100644
--- a/discord.spec
+++ b/discord.spec
@@ -8,7 +8,7 @@
Name: discord
Version: 0.0.34
Release: 1%{?dist}
-Summary: All-in-one voice and text chat for gamers
+Summary: All-in-one voice and text chat
# License Information: https://bugzilla.rpmfusion.org/show_bug.cgi?id=4441#c14
License: Proprietary
@@ -41,8 +41,7 @@ Recommends: libXScrnSaver
%endif
%description
-Linux Release for Discord, a free proprietary VoIP application designed for
-gaming communities.
+Linux Release for Discord, a free proprietary VoIP application
%prep
%autosetup -n Discord
1 year
[kodi] Add another Python 3.12 fix (RFBZ#6783)
by Michael Cronenworth
commit e0b778d4b156bdf5786d756b996f70c762359cb3
Author: Michael Cronenworth <mike(a)cchtml.com>
Date: Fri Nov 10 15:59:39 2023 -0600
Add another Python 3.12 fix (RFBZ#6783)
kodi-20-python-312.patch | 370 +++++++++++++++++++++++++++++++++++++++++++++++
kodi.spec | 8 +-
2 files changed, 377 insertions(+), 1 deletion(-)
---
diff --git a/kodi-20-python-312.patch b/kodi-20-python-312.patch
new file mode 100644
index 0000000..480394f
--- /dev/null
+++ b/kodi-20-python-312.patch
@@ -0,0 +1,370 @@
+From 4bf9de87e700f0de56ef698a8d8d6eb7d4ff9050 Mon Sep 17 00:00:00 2001
+From: repojohnray <8113421+repojohnray(a)users.noreply.github.com>
+Date: Wed, 11 Jan 2023 00:10:48 +0100
+Subject: [PATCH] CPythonInvoker: code cleanup
+
+---
+ xbmc/interfaces/python/AddonPythonInvoker.cpp | 32 ++++---------
+ xbmc/interfaces/python/AddonPythonInvoker.h | 3 +-
+ xbmc/interfaces/python/PythonInvoker.cpp | 48 ++++++-------------
+ xbmc/interfaces/python/PythonInvoker.h | 14 ++++--
+ xbmc/interfaces/python/XBPython.cpp | 20 ++++++++
+ .../python/HTTPPythonWsgiInvoker.cpp | 35 +++++---------
+ .../python/HTTPPythonWsgiInvoker.h | 3 +-
+ 7 files changed, 71 insertions(+), 84 deletions(-)
+
+diff --git a/xbmc/interfaces/python/AddonPythonInvoker.cpp b/xbmc/interfaces/python/AddonPythonInvoker.cpp
+index b6158a8db612b..30b82a2df40e3 100644
+--- a/xbmc/interfaces/python/AddonPythonInvoker.cpp
++++ b/xbmc/interfaces/python/AddonPythonInvoker.cpp
+@@ -84,45 +84,33 @@ PyObject* PyInit_Module_xbmcvfs(void);
+
+ using namespace PythonBindings;
+
+-typedef struct
++namespace
+ {
+- const char *name;
+- CPythonInvoker::PythonModuleInitialization initialization;
+-} PythonModule;
+-
+-static PythonModule PythonModules[] =
++// clang-format off
++const _inittab PythonModules[] =
+ {
+ { "xbmcdrm", PyInit_Module_xbmcdrm },
+ { "xbmcgui", PyInit_Module_xbmcgui },
+ { "xbmc", PyInit_Module_xbmc },
+ { "xbmcplugin", PyInit_Module_xbmcplugin },
+ { "xbmcaddon", PyInit_Module_xbmcaddon },
+- { "xbmcvfs", PyInit_Module_xbmcvfs }
++ { "xbmcvfs", PyInit_Module_xbmcvfs },
++ { nullptr, nullptr }
+ };
++// clang-format on
++} // namespace
+
+ CAddonPythonInvoker::CAddonPythonInvoker(ILanguageInvocationHandler *invocationHandler)
+ : CPythonInvoker(invocationHandler)
+ {
+- PyImport_AppendInittab("xbmcdrm", PyInit_Module_xbmcdrm);
+- PyImport_AppendInittab("xbmcgui", PyInit_Module_xbmcgui);
+- PyImport_AppendInittab("xbmc", PyInit_Module_xbmc);
+- PyImport_AppendInittab("xbmcplugin", PyInit_Module_xbmcplugin);
+- PyImport_AppendInittab("xbmcaddon", PyInit_Module_xbmcaddon);
+- PyImport_AppendInittab("xbmcvfs", PyInit_Module_xbmcvfs);
+ }
+
+ CAddonPythonInvoker::~CAddonPythonInvoker() = default;
+
+-std::map<std::string, CPythonInvoker::PythonModuleInitialization> CAddonPythonInvoker::getModules() const
++void CAddonPythonInvoker::GlobalInitializeModules(void)
+ {
+- static std::map<std::string, PythonModuleInitialization> modules;
+- if (modules.empty())
+- {
+- for (const PythonModule& pythonModule : PythonModules)
+- modules.insert(std::make_pair(pythonModule.name, pythonModule.initialization));
+- }
+-
+- return modules;
++ if (PyImport_ExtendInittab(const_cast<_inittab*>(PythonModules)))
++ CLog::Log(LOGWARNING, "CAddonPythonInvoker(): unable to extend inittab");
+ }
+
+ const char* CAddonPythonInvoker::getInitializationScript() const
+diff --git a/xbmc/interfaces/python/AddonPythonInvoker.h b/xbmc/interfaces/python/AddonPythonInvoker.h
+index a8460712ea09d..dfc6c9b25e955 100644
+--- a/xbmc/interfaces/python/AddonPythonInvoker.h
++++ b/xbmc/interfaces/python/AddonPythonInvoker.h
+@@ -16,8 +16,9 @@ class CAddonPythonInvoker : public CPythonInvoker
+ explicit CAddonPythonInvoker(ILanguageInvocationHandler *invocationHandler);
+ ~CAddonPythonInvoker() override;
+
++ static void GlobalInitializeModules(void);
++
+ protected:
+ // overrides of CPythonInvoker
+- std::map<std::string, PythonModuleInitialization> getModules() const override;
+ const char* getInitializationScript() const override;
+ };
+diff --git a/xbmc/interfaces/python/PythonInvoker.cpp b/xbmc/interfaces/python/PythonInvoker.cpp
+index 55c5181403bde..8da7becdcf059 100644
+--- a/xbmc/interfaces/python/PythonInvoker.cpp
++++ b/xbmc/interfaces/python/PythonInvoker.cpp
+@@ -64,10 +64,6 @@ extern "C" FILE* fopen_utf8(const char* _Filename, const char* _Mode);
+ using namespace XFILE;
+ using namespace std::chrono_literals;
+
+-#define PythonModulesSize sizeof(PythonModules) / sizeof(PythonModule)
+-
+-CCriticalSection CPythonInvoker::s_critical;
+-
+ static const std::string getListOfAddonClassesAsString(
+ XBMCAddon::AddonClass::Ref<XBMCAddon::Python::PythonLanguageHook>& languageHook)
+ {
+@@ -277,6 +273,7 @@ bool CPythonInvoker::execute(const std::string& script, std::vector<std::wstring
+ }
+
+ PySys_SetObject("argv", sysArgv);
++ Py_DECREF(sysArgv);
+
+ CLog::Log(LOGDEBUG, "CPythonInvoker({}, {}): entering source directory {}", GetId(), m_sourceFile,
+ scriptDir);
+@@ -570,6 +567,9 @@ void CPythonInvoker::onExecutionDone()
+ "shutting down the Interpreter",
+ GetId(), m_sourceFile);
+
++ // PyErr_Clear() is required to prevent the debug python library to trigger an assert() at the Py_EndInterpreter() level
++ PyErr_Clear();
++
+ Py_EndInterpreter(m_threadState);
+
+ // If we still have objects left around, produce an error message detailing what's been left behind
+@@ -619,10 +619,6 @@ void CPythonInvoker::onExecutionFailed()
+ void CPythonInvoker::onInitialization()
+ {
+ XBMC_TRACE;
+- {
+- GilSafeSingleLock lock(s_critical);
+- initializeModules(getModules());
+- }
+
+ // get a possible initialization script
+ const char* runscript = getInitializationScript();
+@@ -641,15 +637,14 @@ void CPythonInvoker::onPythonModuleInitialization(void* moduleDict)
+
+ PyObject* moduleDictionary = (PyObject*)moduleDict;
+
+- PyObject* pyaddonid = PyUnicode_FromString(m_addon->ID().c_str());
+- PyDict_SetItemString(moduleDictionary, "__xbmcaddonid__", pyaddonid);
++ PyDict_SetItemString(moduleDictionary, "__xbmcaddonid__",
++ PyObjectPtr(PyUnicode_FromString(m_addon->ID().c_str())).get());
+
+ ADDON::CAddonVersion version = m_addon->GetDependencyVersion("xbmc.python");
+- PyObject* pyxbmcapiversion = PyUnicode_FromString(version.asString().c_str());
+- PyDict_SetItemString(moduleDictionary, "__xbmcapiversion__", pyxbmcapiversion);
++ PyDict_SetItemString(moduleDictionary, "__xbmcapiversion__",
++ PyObjectPtr(PyUnicode_FromString(version.asString().c_str())).get());
+
+- PyObject* pyinvokerid = PyLong_FromLong(GetId());
+- PyDict_SetItemString(moduleDictionary, "__xbmcinvokerid__", pyinvokerid);
++ PyDict_SetItemString(moduleDictionary, "__xbmcinvokerid__", PyLong_FromLong(GetId()));
+
+ CLog::Log(LOGDEBUG,
+ "CPythonInvoker({}, {}): instantiating addon using automatically obtained id of \"{}\" "
+@@ -683,25 +678,6 @@ void CPythonInvoker::onError(const std::string& exceptionType /* = "" */,
+ }
+ }
+
+-void CPythonInvoker::initializeModules(
+- const std::map<std::string, PythonModuleInitialization>& modules)
+-{
+- for (const auto& module : modules)
+- {
+- if (!initializeModule(module.second))
+- CLog::Log(LOGWARNING, "CPythonInvoker({}, {}): unable to initialize python module \"{}\"",
+- GetId(), m_sourceFile, module.first);
+- }
+-}
+-
+-bool CPythonInvoker::initializeModule(PythonModuleInitialization module)
+-{
+- if (module == NULL)
+- return false;
+-
+- return module() != nullptr;
+-}
+-
+ void CPythonInvoker::getAddonModuleDeps(const ADDON::AddonPtr& addon, std::set<std::string>& paths)
+ {
+ for (const auto& it : addon->GetDependencies())
+@@ -721,3 +697,9 @@ void CPythonInvoker::getAddonModuleDeps(const ADDON::AddonPtr& addon, std::set<s
+ }
+ }
+ }
++
++void CPythonInvoker::PyObjectDeleter::operator()(PyObject* p) const
++{
++ assert(Py_REFCNT(p) == 2);
++ Py_DECREF(p);
++}
+diff --git a/xbmc/interfaces/python/PythonInvoker.h b/xbmc/interfaces/python/PythonInvoker.h
+index dd093ed73acd6..e4ad95e8b44e6 100644
+--- a/xbmc/interfaces/python/PythonInvoker.h
++++ b/xbmc/interfaces/python/PythonInvoker.h
+@@ -31,8 +31,6 @@ class CPythonInvoker : public ILanguageInvoker
+
+ bool IsStopping() const override { return m_stop || ILanguageInvoker::IsStopping(); }
+
+- typedef PyObject* (*PythonModuleInitialization)();
+-
+ protected:
+ // implementation of ILanguageInvoker
+ bool execute(const std::string& script, const std::vector<std::string>& arguments) override;
+@@ -42,7 +40,6 @@ class CPythonInvoker : public ILanguageInvoker
+ void onExecutionFailed() override;
+
+ // custom virtual methods
+- virtual std::map<std::string, PythonModuleInitialization> getModules() const = 0;
+ virtual const char* getInitializationScript() const = 0;
+ virtual void onInitialization();
+ // actually a PyObject* but don't wanna draw Python.h include into the header
+@@ -59,8 +56,6 @@ class CPythonInvoker : public ILanguageInvoker
+ CCriticalSection m_critical;
+
+ private:
+- void initializeModules(const std::map<std::string, PythonModuleInitialization>& modules);
+- bool initializeModule(PythonModuleInitialization module);
+ void getAddonModuleDeps(const ADDON::AddonPtr& addon, std::set<std::string>& paths);
+ bool execute(const std::string& script, std::vector<std::wstring>& arguments);
+ FILE* PyFile_AsFileWithMode(PyObject* py_file, const char* mode);
+@@ -73,4 +68,13 @@ class CPythonInvoker : public ILanguageInvoker
+ bool m_systemExitThrown = false;
+
+ static CCriticalSection s_critical;
++
++private:
++ struct PyObjectDeleter
++ {
++ void operator()(PyObject* p) const;
++ };
++
++public:
++ typedef std::unique_ptr<PyObject, PyObjectDeleter> PyObjectPtr;
+ };
+diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp
+index ee8ed93ff56ed..96b04200adea2 100644
+--- a/xbmc/interfaces/python/XBPython.cpp
++++ b/xbmc/interfaces/python/XBPython.cpp
+@@ -34,6 +34,10 @@
+ #include "platform/Environment.h"
+ #endif
+
++#ifdef HAS_WEB_INTERFACE
++#include "network/httprequesthandler/python/HTTPPythonWsgiInvoker.h"
++#endif
++
+ #include <algorithm>
+
+ // Only required for Py3 < 3.7
+@@ -50,6 +54,14 @@ XBPython::~XBPython()
+ {
+ XBMC_TRACE;
+ CServiceBroker::GetAnnouncementManager()->RemoveAnnouncer(this);
++
++#if PY_VERSION_HEX >= 0x03070000
++ if (Py_IsInitialized())
++ {
++ PyThreadState_Swap(PyInterpreterState_ThreadHead(PyInterpreterState_Main()));
++ Py_Finalize();
++ }
++#endif
+ }
+
+ #define LOCK_AND_COPY(type, dest, src) \
+@@ -518,6 +530,14 @@ bool XBPython::OnScriptInitialized(ILanguageInvoker* invoker)
+ Py_OptimizeFlag = 1;
+ #endif
+
++ // *::GlobalInitializeModules() functions call PyImport_ExtendInittab(). PyImport_ExtendInittab() should
++ // be called before Py_Initialize() as required by the Python documentation.
++ CAddonPythonInvoker::GlobalInitializeModules();
++
++#ifdef HAS_WEB_INTERFACE
++ CHTTPPythonWsgiInvoker::GlobalInitializeModules();
++#endif
++
+ Py_Initialize();
+
+ #if PY_VERSION_HEX < 0x03070000
+diff --git a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
+index ac047a7530057..a28fb80115ce8 100644
+--- a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
++++ b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.cpp
+@@ -75,26 +75,23 @@ PyObject* PyInit_Module_xbmcwsgi(void);
+
+ using namespace PythonBindings;
+
+-typedef struct
++namespace
+ {
+- const char *name;
+- CPythonInvoker::PythonModuleInitialization initialization;
+-} PythonModule;
+-
+-static PythonModule PythonModules[] =
++// clang-format off
++const _inittab PythonModules[] =
+ {
+ { "xbmc", PyInit_Module_xbmc },
+ { "xbmcaddon", PyInit_Module_xbmcaddon },
+- { "xbmcwsgi", PyInit_Module_xbmcwsgi }
++ { "xbmcwsgi", PyInit_Module_xbmcwsgi },
++ { nullptr, nullptr }
+ };
++// clang-format on
++} // namespace
+
+ CHTTPPythonWsgiInvoker::CHTTPPythonWsgiInvoker(ILanguageInvocationHandler* invocationHandler, HTTPPythonRequest* request)
+ : CHTTPPythonInvoker(invocationHandler, request),
+ m_wsgiResponse(NULL)
+ {
+- PyImport_AppendInittab("xbmc", PyInit_Module_xbmc);
+- PyImport_AppendInittab("xbmcaddon", PyInit_Module_xbmcaddon);
+- PyImport_AppendInittab("xbmcwsgi", PyInit_Module_xbmcwsgi);
+ }
+
+ CHTTPPythonWsgiInvoker::~CHTTPPythonWsgiInvoker()
+@@ -103,6 +100,12 @@ CHTTPPythonWsgiInvoker::~CHTTPPythonWsgiInvoker()
+ m_wsgiResponse = NULL;
+ }
+
++void CHTTPPythonWsgiInvoker::GlobalInitializeModules(void)
++{
++ if (PyImport_ExtendInittab(const_cast<_inittab*>(PythonModules)))
++ CLog::Log(LOGWARNING, "CHTTPPythonWsgiInvoker(): unable to extend inittab");
++}
++
+ HTTPPythonRequest* CHTTPPythonWsgiInvoker::GetRequest()
+ {
+ if (m_request == NULL || m_wsgiResponse == NULL)
+@@ -303,18 +306,6 @@ void CHTTPPythonWsgiInvoker::executeScript(FILE* fp, const std::string& script,
+ }
+ }
+
+-std::map<std::string, CPythonInvoker::PythonModuleInitialization> CHTTPPythonWsgiInvoker::getModules() const
+-{
+- static std::map<std::string, PythonModuleInitialization> modules;
+- if (modules.empty())
+- {
+- for (const PythonModule& pythonModule : PythonModules)
+- modules.insert(std::make_pair(pythonModule.name, pythonModule.initialization));
+- }
+-
+- return modules;
+-}
+-
+ const char* CHTTPPythonWsgiInvoker::getInitializationScript() const
+ {
+ return RUNSCRIPT;
+diff --git a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
+index 3ec34c0eba93b..64a3c53fee4ab 100644
+--- a/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
++++ b/xbmc/network/httprequesthandler/python/HTTPPythonWsgiInvoker.h
+@@ -29,13 +29,14 @@ class CHTTPPythonWsgiInvoker : public CHTTPPythonInvoker
+ CHTTPPythonWsgiInvoker(ILanguageInvocationHandler* invocationHandler, HTTPPythonRequest* request);
+ ~CHTTPPythonWsgiInvoker() override;
+
++ static void GlobalInitializeModules(void);
++
+ // implementations of CHTTPPythonInvoker
+ HTTPPythonRequest* GetRequest() override;
+
+ protected:
+ // overrides of CPythonInvoker
+ void executeScript(FILE* fp, const std::string& script, PyObject* moduleDict) override;
+- std::map<std::string, PythonModuleInitialization> getModules() const override;
+ const char* getInitializationScript() const override;
+
+ private:
diff --git a/kodi.spec b/kodi.spec
index d9db047..2754b02 100644
--- a/kodi.spec
+++ b/kodi.spec
@@ -39,7 +39,7 @@
Name: kodi
Version: 20.2
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Media center
License: GPLv2+ and GPLv3+ and LGPLv2+ and BSD and MIT
@@ -80,6 +80,8 @@ Patch3: https://github.com/xbmc/xbmc/pull/23453.patch#/fmt10_buildfix.patch
# Add initializer for tp_watched
Patch4: https://github.com/xbmc/xbmc/commit/2c84ee54a75770e291f38d4ebb2c31c8f2c3b...
+# Python 3.12 support
+Patch5: https://github.com/xbmc/xbmc/commit/4bf9de87e700f0de56ef698a8d8d6eb7d4ff9...
%ifarch x86_64
%global _with_crystalhd 1
@@ -306,6 +308,7 @@ This package contains FirewallD files for Kodi.
%if 0%{?fedora} && 0%{?fedora} > 38
%patch -P 3 -p1 -b.fmt
%patch -P 4 -p1 -b.initializer
+%patch -P 5 -p1 -b.python-312
%endif
# Fix up Python shebangs
@@ -436,6 +439,9 @@ rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/kodi-wiiremote.1
%changelog
+* Fri Nov 10 2023 Michael Cronenworth <mike(a)cchtml.com> - 20.2-7
+- Another upstream python-3.12 fix (RFBZ#6783)
+
* Tue Oct 31 2023 Leigh Scott <leigh123linux(a)gmail.com> - 20.2-6
- Use upstream python-3.12 fix
1 year