File: setup.py.in

package info (click to toggle)
gyoto 2.0.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,420 kB
  • sloc: cpp: 42,317; sh: 4,512; python: 3,436; xml: 2,865; makefile: 685; ansic: 346
file content (83 lines) | stat: -rw-r--r-- 2,784 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python

# setup.py.in.distutils
#
# Copyright 2012, 2013 Brandon Invergo <brandon@invergo.net>
# Copyright 2014 Thibaut Paumard
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without any warranty.

HOME_LORENE="@HOME_LORENE@"

from setuptools import setup, Extension
import platform
import re

import numpy
try:
    numpy_include = numpy.get_include()
except AttributeError:
    numpy_include = numpy.get_numpy_include()


if platform.system() == 'Linux':
    doc_dir = '@prefix@/share/doc/@PACKAGE_TARNAME@'
else:
    try:
        from win32com.shell import shellcon, shell
        homedir = shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0)
        appdir = '@PACKAGE_TARNAME@'
        doc_dir = os.path.join(homedir, appdir)
    except:
        pass

gyoto_lib_dirs=['../lib/.libs']
gyoto_libs=['gyoto@FEATURES@']
for libspec in ('@CFITSIO_LIBS@', '@XERCES_LIBS@', '@UDUNITS_LIBS@'):
    libspec=re.split('[ \t]', libspec)
    for comp in libspec:
        if re.match('-L', comp):
            gyoto_lib_dirs.append(re.sub('^-L', '', comp))
        elif re.match('-l', comp):
            gyoto_libs.append(re.sub('^-l', '', comp))

gyoto_module = Extension('gyoto/_core',
                         sources=['core_wrap.cxx'],
                         include_dirs=[numpy_include, '@abs_srcdir@'],
                         library_dirs=gyoto_lib_dirs,
                         libraries=gyoto_libs
                         )

gyoto_std_module = Extension('gyoto/_std',
                         sources=['std_wrap.cxx'],
                         include_dirs=[numpy_include, '@abs_srcdir@'],
                         library_dirs=gyoto_lib_dirs,
                         libraries=gyoto_libs
                         )

gyoto_lorene_module = Extension('gyoto/_lorene',
                         sources=['lorene_wrap.cxx'],
                         include_dirs=[numpy_include, '@abs_srcdir@'],
                         library_dirs=gyoto_lib_dirs,
                         libraries=gyoto_libs
                         )

pymodules = ["gyoto.__init__", "gyoto.core", "gyoto.std", "gyoto_std",
             "gyoto._namespaces", "gyoto.astrobj", "gyoto.metric",
             "gyoto.spectrum", "gyoto.spectrometer", "gyoto.animate", "gyoto.util"]
extmodules= [gyoto_module, gyoto_std_module]

if HOME_LORENE != "":
    pymodules.append("gyoto.lorene")
    pymodules.append("gyoto_lorene")
    extmodules.append(gyoto_lorene_module)

setup(name='@PACKAGE_NAME@',
      version='@PACKAGE_VERSION@',
      author_email='@PACKAGE_BUGREPORT@',
      py_modules=pymodules,
      ext_modules=extmodules
     )