#16 Cross compiling pyscard

v1.0 (example)

Hi, recently tried to cross-compile pyscard using Yocto(openembedded) system. Pyscard uses distutils, but it is hardcoded to /usr/include/PCSC include path in setup.py:
platform_include_dirs = ['/usr/include/PCSC']

This breaks cross compilation, because it needs to be linked to sysroot, which is different path.
I am not really python module installation specialist, so I can't suggest a fix which is correct for distutils.

Embedded systems are becoming really popular (especially Linux+NFC), so this fix would be a great boost for this library.

Thank you.


  • Hi Chocis,

    you can append other directories to the include path as follow:
    platform_includ_dirs=['/usr/include/PCSC', '/mypath1/include', '/mypath2/include' ]

    what is the exact yocto release you are concerned about, so that I can also have a closer look?

    thanks and best regards


    • chocis

      Yes I can append that way, but that would be my system specific configuration.
      What I would lik to do is to create an universal recipe for Yocto(openembedded)[dora branch], that would work out of the box.
      I was able to fix this with ugly hack - parsing include path from paramters and appending it to platform_include_dirs, but I am 95% sure that it isn't the correct way.
      Maybe should take a look, how other python libraries with C binding does cross compiling.

  • Hi Chocis,

    the best way to support is to add the Yocto platform to the setup.py file. This is the place where the build/install script checks for the platform to build (e.g. win32, macosx-10.6) and sets up the proper environment (e.g. platform_includ_dirs).

    You have to identify the Yocto release you are trying to build from the python get_platform() call, and then set up the appropriate environment for the build.

    please send me the setup.py script when done, as well as the references to the yocto toolchain you are using so that I can eventually have a look on how it builds.

    best regards,


    • status: open --> closed-accepted
    • assigned_to: Ludovic Rousseau
  • You should not have issues when compiling pyscard using the system /usr/include/PCSC/* files even if you use a pcsc-lite for another architecture.

    If that is not the case please open a new bug report or reopen this one.