From ac0b12cf025e71117fdf3fd1f97d4d52c8b0ab51881f6b5e3ba69b5eb038e726 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Feb 2024 08:14:18 +0000 Subject: [PATCH] Accepting request 1148321 from home:dgarcia:branches:multimedia:libs - Add patch waflib_python312.patch to support python3.12 gh#aubio/aubio#394, https://gitlab.com/ita1024/waf/-/commit/d2060dfd8af4edb5824153ff24e207b39ecd67a2 - Fix fdupes call for all python flavors - Remove shebang from non executable scripts - More specific %python_sitearch in files OBS-URL: https://build.opensuse.org/request/show/1148321 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/aubio?expand=0&rev=49 --- aubio.spec | 2 +- python-aubio.changes | 9 +++++++++ python-aubio.spec | 19 +++++++++++++------ waflib_python312.patch | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 waflib_python312.patch diff --git a/aubio.spec b/aubio.spec index 5fa6441..05eebd8 100644 --- a/aubio.spec +++ b/aubio.spec @@ -1,7 +1,7 @@ # # spec file for package aubio # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/python-aubio.changes b/python-aubio.changes index bdd416b..28ac724 100644 --- a/python-aubio.changes +++ b/python-aubio.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Feb 20 18:19:12 UTC 2024 - Daniel Garcia + +- Add patch waflib_python312.patch to support python3.12 + gh#aubio/aubio#394, https://gitlab.com/ita1024/waf/-/commit/d2060dfd8af4edb5824153ff24e207b39ecd67a2 +- Fix fdupes call for all python flavors +- Remove shebang from non executable scripts +- More specific %python_sitearch in files + ------------------------------------------------------------------- Wed Apr 21 03:03:19 UTC 2021 - Steve Kowalik diff --git a/python-aubio.spec b/python-aubio.spec index 14e1831..ff236be 100644 --- a/python-aubio.spec +++ b/python-aubio.spec @@ -1,7 +1,7 @@ # # spec file for package python-aubio # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python36 1 Name: python-aubio Version: 0.4.9 @@ -26,6 +25,9 @@ License: GPL-3.0-or-later URL: http://aubio.org/ Source: http://aubio.org/pub/aubio-%{version}.tar.bz2 Source1: http://aubio.org/pub/aubio-%{version}.tar.bz2.asc +# PATCH-FIX-UPSTREAM waflib_python312.patch gh#aubio/aubio#394 +# https://gitlab.com/ita1024/waf/-/commit/d2060dfd8af4edb5824153ff24e207b39ecd67a2 +Patch1: waflib_python312.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy-devel} BuildRequires: %{python_module pytest} @@ -34,7 +36,7 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-numpy Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -45,17 +47,21 @@ aubio is a library to label music and sounds. It listens to audio signals and at Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio. %prep -%setup -q -n aubio-%{version} +%autosetup -p 1 -n aubio-%{version} %build %python_build %install %python_install -%python_expand %fdupes %{buildroot}/%{python_sitearch} +%python_expand %fdupes %{buildroot}/%{$python_sitearch} %python_clone -a %{buildroot}/%{_bindir}/aubio %python_clone -a %{buildroot}/%{_bindir}/aubiocut +%{python_expand # Remove shebang from non executable scripts +find %{buildroot}/%{$python_sitearch} -type f -name "*.py" -exec sed -i "1{/#!.*python/d}" {} \; +} + %check # the two tests fail on 32bit due to precision issue %pytest_arch -k 'not (test_meltohz or test_hztomel)' @@ -71,6 +77,7 @@ Its features include segmenting a sound file before each of its attacks, perform %doc README.md ChangeLog AUTHORS %python_alternative %{_bindir}/aubio %python_alternative %{_bindir}/aubiocut -%{python_sitearch}/* +%{python_sitearch}/aubio +%{python_sitearch}/aubio-%{version}*-info %changelog diff --git a/waflib_python312.patch b/waflib_python312.patch new file mode 100644 index 0000000..87f1f2d --- /dev/null +++ b/waflib_python312.patch @@ -0,0 +1,36 @@ +Index: aubio-0.4.9/waflib/Context.py +=================================================================== +--- aubio-0.4.9.orig/waflib/Context.py ++++ aubio-0.4.9/waflib/Context.py +@@ -2,9 +2,17 @@ + # encoding: utf-8 + # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file + +-import os,re,imp,sys ++import os, re, sys + from waflib import Utils,Errors,Logs + import waflib.Node ++ ++if sys.hexversion > 0x3040000: ++ import types ++ class imp(object): ++ new_module = lambda x: types.ModuleType(x) ++else: ++ import imp ++ + HEXVERSION=0x2000e00 + WAFVERSION="2.0.14" + WAFREVISION="907519cab9c1c8c7e4f7d4e468ed6200b9250d58" +Index: aubio-0.4.9/waflib/Tools/python.py +=================================================================== +--- aubio-0.4.9.orig/waflib/Tools/python.py ++++ aubio-0.4.9/waflib/Tools/python.py +@@ -399,7 +399,7 @@ def configure(conf): + v.PYC=getattr(Options.options,'pyc',1) + v.PYO=getattr(Options.options,'pyo',1) + try: +- v.PYTAG=conf.cmd_and_log(conf.env.PYTHON+['-c',"import imp;print(imp.get_tag())"]).strip() ++ v.PYTAG = conf.cmd_and_log(conf.env.PYTHON + ['-c', "import sys\ntry:\n print(sys.implementation.cache_tag)\nexcept AttributeError:\n import imp\n print(imp.get_tag())\n"]).strip() + except Errors.WafError: + pass + def options(opt):