Bug#936207: biosig4c++: Python2 removal in sid/bullseye
On Tue, 5 Nov 2019 12:27:42 -0800 Steve Langasek wrote: However, after applying that patch, the package fails to build because: - it tries to invoke python, which is not present. Fixed by setting PYTHON=python3 in MAKEOPTS from debian/rules. - the python3 pkgconfig handling is completely messed up in python/setup.py; it tries to find a pkgconfig file in the system directory (why, when it's part of the same source package we're just building right now?), and when it doesn't find it, under python3 it raises a different exception than ValueError, so the fallback code doesn't work. And if I set PKG_CONFIG_PATH to point at the libbiosig.pc in the parent directory, it just fails later at linking time because ../ isn't on the linker path. I'm stopping my investigation there, it really looks like this needs some upstream cleanup. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ slanga...@ubuntu.com vor...@debian.org Dear Steve, the attached patch should fix this problem. Moreover, the dependency on python-pkgconfig (and pythen3-pkgconfig) becomes obsolote. Kind regards, Alois diff --git a/biosig4c++/python/setup.py b/biosig4c++/python/setup.py index 556d306a..4e046e29 100644 --- a/biosig4c++/python/setup.py +++ b/biosig4c++/python/setup.py @@ -6,23 +6,12 @@ except ImportError: from distutils.extension import Extension import numpy.distutils.misc_util as mu -try: -import pkgconfig -PKG=pkgconfig.parse('libbiosig') -CPATH=PKG['include_dirs'] -LIBS=PKG['libraries'] -LIBDIR=PKG['library_dirs'] -except ValueError: -print('cannot load pkgconfig(libbiosig) - use default location') -CPATH='/usr/local/include' -LIBS='-lbiosig' -LIBDIR='/usr/local/lib' module_biosig = Extension('biosig', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '9')], -include_dirs = [CPATH, mu.get_numpy_include_dirs()[0]], -libraries= LIBS, -library_dirs = LIBDIR, +include_dirs = ['./..', mu.get_numpy_include_dirs()[0]], +libraries= ['biosig'], +library_dirs = ['./..'], sources = ['biosigmodule.c']) setup (name = 'Biosig', @@ -34,6 +23,6 @@ setup (name = 'Biosig', url = 'https://biosig.sourceforge.io', long_description = '''This is the biosig demo package.''', keywords = 'EEG ECG EKG EMG EOG Polysomnography ECoG biomedical signals SCP EDF GDF HEKA CFS ABF', - install_requires=['numpy','pkgconfig','setuptools'], + install_requires=['numpy','setuptools'], ext_modules = [module_biosig])
Bug#936207: biosig4c++: Python2 removal in sid/bullseye
On Tue, 5 Nov 2019 12:27:42 -0800 Steve Langasek wrote: > However, after applying that patch, the package fails to build because: > > - it tries to invoke python, which is not present. Fixed by setting >PYTHON=python3 in MAKEOPTS from debian/rules. > - the python3 pkgconfig handling is completely messed up in >python/setup.py; it tries to find a pkgconfig file in the system >directory (why, when it's part of the same source package we're just >building right now?), and when it doesn't find it, under python3 it >raises a different exception than ValueError, so the fallback code >doesn't work. And if I set PKG_CONFIG_PATH to point at the libbiosig.pc >in the parent directory, it just fails later at linking time because ../ >isn't on the linker path. > > I'm stopping my investigation there, it really looks like this needs some > upstream cleanup. > > -- > Steve Langasek Give me a lever long enough and a Free OS > Debian Developer to set it on, and I can move the world. > Ubuntu Developer https://www.debian.org/ > slanga...@ubuntu.com vor...@debian.org Dear Steve, I'm not sure what debian expects, and what kind of changes you would expect. If there is some documentation about this, please point me to that, and I'll have a look what I can do. If you say the "fallback code" does not work, beause of "rais[ing] a different exception than ValueError", perhaps removing that part (see attached patch_remove-python-setup-pkgconfig-exception.diff ) might solve this. In any case, the installation of biosig-python works if libbiosig is available on the system, in which case one needs to do only pip install numpy pkgconfig pip install Biosig-1.9.1.tar.gz where Biosig-1.9.1.tar.gz is just built in python/dist with this command: cd python && make release I provide the sources also here https://pub.ist.ac.at/~schloegl/biosig/prereleases/Biosig-1.9.1.tar.gz Kind regards, Alois diff --git a/biosig4c++/python/setup.py b/biosig4c++/python/setup.py index 8539a20a..be9e437b 100644 --- a/biosig4c++/python/setup.py +++ b/biosig4c++/python/setup.py @@ -12,17 +12,11 @@ except ImportError: import os import numpy.distutils.misc_util as mu -try: -import pkgconfig -PKG=pkgconfig.parse('libbiosig') -CPATH=PKG['include_dirs'] -LIBS=PKG['libraries'] -LIBDIR=PKG['library_dirs'] -except ValueError: -print('cannot load pkgconfig(libbiosig) - use default location') -CPATH='/usr/local/include' -LIBS='-lbiosig' -LIBDIR='/usr/local/lib' +import pkgconfig +PKG=pkgconfig.parse('libbiosig') +CPATH=PKG['include_dirs'] +LIBS=PKG['libraries'] +LIBDIR=PKG['library_dirs'] module_biosig = Extension('biosig', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '9')],
Bug#936207: biosig4c++: Python2 removal in sid/bullseye
However, after applying that patch, the package fails to build because: - it tries to invoke python, which is not present. Fixed by setting PYTHON=python3 in MAKEOPTS from debian/rules. - the python3 pkgconfig handling is completely messed up in python/setup.py; it tries to find a pkgconfig file in the system directory (why, when it's part of the same source package we're just building right now?), and when it doesn't find it, under python3 it raises a different exception than ValueError, so the fallback code doesn't work. And if I set PKG_CONFIG_PATH to point at the libbiosig.pc in the parent directory, it just fails later at linking time because ../ isn't on the linker path. I'm stopping my investigation there, it really looks like this needs some upstream cleanup. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: PGP signature
Bug#936207: biosig4c++: Python2 removal in sid/bullseye
Package: biosig4c++ Followup-For: Bug #936207 User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu focal ubuntu-patch Attached is a patch to drop python2 support from biosig4c++. It has been uploaded to Ubuntu, since the resulting build failure is currently blocking the octave 5 transition there. Cheers, -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ slanga...@ubuntu.com vor...@debian.org diff -Nru biosig4c++-1.9.3/debian/control biosig4c++-1.9.3/debian/control --- biosig4c++-1.9.3/debian/control 2019-01-20 13:09:35.0 -0800 +++ biosig4c++-1.9.3/debian/control 2019-11-05 11:24:07.0 -0800 @@ -8,11 +8,8 @@ dh-python, d-shlibs, gawk, - python-dev, python3-dev, swig, - python-numpy, - python-pkgconfig, python3-numpy, python3-pkgconfig, zlib1g-dev, @@ -67,17 +64,6 @@ CWFB. save2gdf can be also used to upload or retrieve data from a bscs server. -Package: python-biosig -Architecture: any -Section: python -Depends: ${python:Depends}, - ${shlibs:Depends}, - ${misc:Depends} -Description: Python bindings for BioSig library - This package provides Python bindings for BioSig library. Primary - goal -- I/O interface to variety of biomedical file formats, including - but not limited to SCP-ECG(EN1064), HL7aECG (FDA-XML), GDF, EDF. - Package: python3-biosig Architecture: any Section: python diff -Nru biosig4c++-1.9.3/debian/python-biosig.examples biosig4c++-1.9.3/debian/python-biosig.examples --- biosig4c++-1.9.3/debian/python-biosig.examples 2019-01-20 13:09:35.0 -0800 +++ biosig4c++-1.9.3/debian/python-biosig.examples 1969-12-31 16:00:00.0 -0800 @@ -1,2 +0,0 @@ -python/demo*.py -python/example.py diff -Nru biosig4c++-1.9.3/debian/rules biosig4c++-1.9.3/debian/rules --- biosig4c++-1.9.3/debian/rules 2019-01-20 13:09:35.0 -0800 +++ biosig4c++-1.9.3/debian/rules 2019-11-05 11:24:07.0 -0800 @@ -11,7 +11,7 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: - dh $@ --with python2,python3 + dh $@ --with python3 override_dh_auto_configure: dh_auto_configure @@ -37,11 +37,8 @@ # Manual crafting of installing Octave and Python bindings # TODO: proper -PYTHON=$(shell pyversions -d) PYTHON3=$(shell py3versions -d) -PYDIR=$(shell /bin/ls -d /usr/lib/$(PYTHON)/*-packages) PY3DIR=$(shell if /bin/ls -d /usr/lib/${PYTHON3}/*-packages 2>/dev/null ; then /bin/ls -d /usr/lib/${PYTHON3}/*-packages ; else /bin/ls -d /usr/lib/python3/*-packages ; fi) -PYVER=$(shell pyversions -d -v) PY3VER=$(shell py3versions -d -v) OCTDIR=$(shell octave-config -p LOCALOCTFILEDIR)/biosig @@ -50,8 +47,6 @@ dh_auto_install : I: install Python binding for current Python verion TODO: all - mkdir -p debian/python-biosig$(PYDIR) - cp -a python/build/lib.*-$(PYVER)/biosig.so debian/python-biosig$(PYDIR) mkdir -p debian/python3-biosig$(PY3DIR) cp -a python/build/lib.*-$(PY3VER)/biosig.*.so debian/python3-biosig$(PY3DIR)/biosig.so
Bug#936207: biosig4c++: Python2 removal in sid/bullseye
Severity 936207 serious thanks biosig4c++ build-depends on the python-pkgconfig binary package which is no longer built by the python-pkgconfig source package.