forked from msoos/cryptominisat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py.in
89 lines (79 loc) · 3.25 KB
/
setup.py.in
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
84
85
86
87
88
89
#
# CryptoMiniSat
#
# Copyright (c) 2009-2014, Mate Soos. All rights reserved.
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.
import sys
from distutils.core import setup, Extension
from distutils import sysconfig
def _init_posix(init):
"""
Forces g++ instead of gcc on most systems
credits to eric jones ([email protected]) (found at Google Groups)
"""
def wrapper():
init()
config_vars = sysconfig.get_config_vars() # by reference
if config_vars["MACHDEP"].startswith("sun"):
# Sun needs forced gcc/g++ compilation
config_vars['CC'] = 'gcc'
config_vars['CXX'] = 'g++'
# FIXME raises hardening-no-fortify-functions lintian warning.
else:
# Non-Sun needs linkage with g++
config_vars['LDSHARED'] = 'g++ -shared -g -W -Wall -Wno-deprecated'
config_vars['CFLAGS'] = '-g -W -Wall -Wno-deprecated'
config_vars['OPT'] = '-g -W -Wall -Wno-deprecated'
return wrapper
sysconfig._init_posix = _init_posix(sysconfig._init_posix)
version = '${CPACK_PACKAGE_VERSION}'
ext_kwds = dict(
name = "pycryptosat",
sources = ["${CMAKE_CURRENT_SOURCE_DIR}/pycryptosat.cpp"],
define_macros = [],
#extra_compile_args = ['--std=c++11', '-I${PROJECT_SOURCE_DIR}'],
extra_compile_args = ['-I${PROJECT_SOURCE_DIR}'],
language = "c++",
library_dirs=['.', '/usr/local/lib', '${PROJECT_BINARY_DIR}/lib'],
libraries = ['cryptominisat4']
)
setup(
name = "pycryptosat",
version = version,
author = "Mate Soos",
author_email = "[email protected]",
url = "https://github.com/msoos/cryptominisat",
license = "LGPLv2",
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Utilities",
],
ext_modules = [Extension(**ext_kwds)],
py_modules = ['test_pycryptosat'],
description = "bindings to CryptoMiniSat (a SAT solver)",
long_description = open('${CMAKE_CURRENT_SOURCE_DIR}/README.rst').read(),
)