This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
57 lines (49 loc) · 1.93 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from distutils.core import setup, Extension
from distutils import sysconfig
from os import getenv, walk, path
import subprocess
# Remove the "-Wstrict-prototypes" compiler option, which isn't valid for C++.
cfg_vars = sysconfig.get_config_vars()
opt = cfg_vars["OPT"]
cfg_vars["OPT"] = " ".join( flag for flag in opt.split() if flag != '-Wstrict-prototypes' )
xrdlibdir = getenv( 'XRD_LIBDIR' ) or '/usr/lib'
xrdincdir = getenv( 'XRD_INCDIR' ) or '/usr/include/xrootd'
print 'XRootD library dir:', xrdlibdir
print 'XRootD include dir:', xrdincdir
sources = list()
depends = list()
for dirname, dirnames, filenames in walk('src'):
for filename in filenames:
if filename.endswith('.cc'):
sources.append(path.join(dirname, filename))
elif filename.endswith('.hh'):
depends.append(path.join(dirname, filename))
p = subprocess.Popen(["./genversion.sh"], stdout=subprocess.PIPE)
version, err = p.communicate()
print version
setup( name = 'pyxrootd',
version = version,
author = 'XRootD Developers',
author_email = '[email protected]',
url = 'http://xrootd.org',
license = 'LGPLv3+',
description = "XRootD Python bindings",
long_description = "XRootD Python bindings",
packages = ['pyxrootd', 'XRootD', 'XRootD.client'],
package_dir = {'pyxrootd' : 'src',
'XRootD' : 'libs',
'XRootD.client': 'libs/client'},
ext_modules = [
Extension(
'pyxrootd.client',
sources = sources,
depends = depends,
libraries = ['XrdCl', 'XrdUtils', 'dl'],
extra_compile_args = ['-g'],
include_dirs = [xrdincdir],
library_dirs = [xrdlibdir]
)
]
)
# Make the docs
# call(["make", "-C", "docs", "html"])