Why are devel/py-setuptools missing -I${LOCALBASE}/include ?

Kubilay Kocak koobs at FreeBSD.org
Thu Sep 20 09:35:47 UTC 2018


On 20/09/2018 6:55 pm, Axel Rau wrote:
> Hi all,

Hi Axel,


> while doing a
>   pip install ldap0
> I get

Standard warning first up: use of pip install as root (without --user)
to install third party packages directly into the system site-packages
environment is completely unsupported, and *will* break the python
environment if mixing with ports/packages. The pkg-message for
devel/py-pip contains this warning too.

> - - -
>    In file included from _libldap0/LDAPObject.c:8:
>     _libldap0/errors.h:7:10: fatal error: 'lber.h' file not found
>     #include "lber.h"
>              ^~~~~~~~
>     1 error generated.
>     error: command ‚clang' failed with exit status 1
> - - -
> 
> Shouldn’t setuptools take care of this?

No. `pythonX.Y-config` on the other hand (provided by each lang/python??
port) can provide the *FLAGS that the python environment was built
in/for, *if* a consumer chooses to use it. However, this is most often
used only by non-Python-library softwares that want to depend on the
python shared library.

The options from here, depending on the specific package are:

- Try CFLAGS/LDFLAGS to pass the -I/-L paths.
- Try using the --include-dirs, --libraries and --library-dirs (-L)
arguments to the setuptools build_ext command (see pythonX.Y setup.py
build_ext --help for more)

Or, just use the net/py-ldap0 port [1], which already does the right
thing (it appears the ldap0 package uses a non-standard INCLUDE variable
to pass things into it)

Hope that helps. If you have questions and need any more help, we're
always available on #freebsd-python on freenode IRC if you need us.

[1] https://www.freshports.org/net/py-ldap0/

> Thanks, Axel 
> ---
> PGP-Key:29E99DD6  ☀  computing @ chaos claudius
> 


More information about the freebsd-python mailing list