On Tue, 5 Nov 2019 12:27:42 -0800 Steve Langasek
<steve.langa...@canonical.com> 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')],

Reply via email to