Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

Look into LIBRARY_PATH and INCLUDE_PATH environment variables #40

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ class OpenLDAP2:
origfileslist = string_split(origfiles, ',')
LDAP_CLASS.extra_files[i]=(destdir, origfileslist)

# Expand library_dirs and include_dirs from environment variables, makes
# pyldap work with the apt buildpack on Heroku, for example.
def expandvars(name):
return [os.path.expandvars(x)
for x in os.environ.get(name, '').split(':') if x]
LDAP_CLASS.library_dirs += expandvars('LIBRARY_PATH')
LDAP_CLASS.include_dirs += expandvars('INCLUDE_PATH')

# Add "sasl" subdirectory to include_dirs
LDAP_CLASS.include_dirs += [
os.path.join(x, 'sasl') for x in expandvars('INCLUDE_PATH')]

#-- Let distutils/setuptools do the rest
name = 'pyldap'

Expand Down