bugCompact Disc Input and Control Library - Bugs: bug #57140, Use python package pkgconfig...

 
 

bug #57140: Use python package pkgconfig instead of manually parsing pkg-config results

Submitted by:  None
Submitted on:  Tue 29 Oct 2019 09:17:25 PM UTC  
 
Category:  compilation Severity:  5 - Average
Item Group:  pycdio Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 29 Oct 2019 10:24:52 PM UTC, comment #1: 

This is great and we can use this. However here are some things that need changing.

First, since pkgconfig doesn't come with Python, this package needs to be  noted as a dependency (the "install_requres" parameter) in setup.py.

Second, by using this we will limit the range of Python to 2.6+ and 3.3+. I'm okay with that, but again setup.py needs to note that.

As for the mechanics, please fork the code on github
https://github.com/rocky/pycdio and put in a pull request (PR).

Thanks.

Rocky Bernstein <rocky>
Project Administrator
Tue 29 Oct 2019 09:17:25 PM UTC, original submission:  

When trying to build pycdio-2.1.0 on FreeBSD 11.3 with python3.6, the compilation of pycdio_wrap.o fails because it can't find "cdio/cdio.h".

The generated compiler call is "cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -Ib'/usr/local/include' -I/usr/local/include/python3.6m -c swig/pycdio_wrap.c -o build/temp.freebsd-11.3-RELEASE-p3-amd64-3.6/swig/pycdio_wrap.o"
which fails because the parameter "-Ib'/usr/local/include'" is evaluated to "-Ib/usr/local/include".

If the include_dirs list is decoded from utf-8 like the libraries list then the compiler call runs successfully. But a traceback with a TypeError occurs in unixccompiler ("TypeError: must be str, not bytes"). The hint on https://pypi.org/project/pycdio/ to exchange the unixccompiler.py with a recent version didn't help but decoding the runtime_lib_dirs list from utf-8 would help...

Since there was a comment with "FIXME" above the pkg-config subprocess code, i tried to find a more elegant solution and used the pkgconfig python package.

The patch is attached.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47764:  pycdio_setup_py.patch added by None (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rocky (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-29 None Attached File- => Added pycdio_setup_py.patch, #47764

    Back to the top


    Powered by Savane 3.5