Coder Social home page Coder Social logo

Use pkgconfig about python-chardet HOT 4 CLOSED

jayvdb avatar jayvdb commented on July 20, 2024
Use pkgconfig

from python-chardet.

Comments (4)

jayvdb avatar jayvdb commented on July 20, 2024

peterjc/backports.lzma#11 and python-lz4/python-lz4#76 use package pkgconfig to simplify this.

from python-chardet.

Joungkyun avatar Joungkyun commented on July 20, 2024

I tested it as follows:

    import pkgconfig

    pkg = pkgconfig.parse ('chardet')
    libdir.append (pkg['library_dirs'])
    incdir.append (pkg['include_dirs'])

However, in the test, an error occurs as follows:

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I[u'/usr/include/chardet'] -I/usr/include/python2.7 -c src/chardet.c -o build/temp.linux-x86_64-2.7/src/chardet.o
src/chardet.c:18:21: fatal error: chardet.h: can not found
 #include <chardet.h>
                     ^
compilation terminated.
error: command 'gcc' failed with exit status 1

When using the PKGConfig module, additional parsing is more required, and the code complexity seems to be higher.

-I[u'/usr/include/chardet'] -> -I/usr/include/chardet

from python-chardet.

jayvdb avatar jayvdb commented on July 20, 2024

That is because each library can have more than one directory for includes and libs. No parsing is needed.
Use

    libdir += pkg['library_dirs'])
    incdir += pkg['include_dirs'])

from python-chardet.

Joungkyun avatar Joungkyun commented on July 20, 2024

That is because each library can have more than one directory for includes and libs. No parsing is needed.
Use

    libdir += pkg['library_dirs'])
    incdir += pkg['include_dirs'])

sound good. thanks

from python-chardet.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.