This repository has been archived by the owner on Jan 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
63 lines (54 loc) · 1.68 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
58
59
60
61
62
63
from os import walk
from os.path import join, sep
from distutils.core import setup
from distutils.cmd import Command
from distutils.extension import Extension
from subprocess import call
from Cython.Distutils import build_ext
class PackageBuild(Command):
description = 'Create Extension Package'
user_options = []
def run(self):
# Call this file and make a distributable .zip file that has our desired
# folder structure
call(['python', 'setup.py', 'install', '--root', 'build/zip', '--install-lib',
'/', '--install-platlib', '/', '--install-data', '/berkelium/data',
'bdist', '--formats=zip'])
def initialize_options(self):
pass
def finalize_options(self):
pass
cmdclass = {
'create_package': PackageBuild,
'build_ext': build_ext
}
ext = Extension(
'berkelium._berkelium',
['berkelium/_berkelium.pyx'],
include_dirs=['../include'],
library_dirs=['berkelium/data'],
libraries=['libberkelium'],
extra_link_args=['-Wl,-rpath=$ORIGIN/data'],
language='c++',
)
# list all files to compile
data_files = []
for root, dirnames, filenames in walk(join('berkelium', 'data')):
for filename in filenames:
fn = join(root, filename)
fn = sep.join(fn.split(sep)[1:])
data_files.append(fn)
setup(
name='berkelium',
version='1.3',
author='Mathieu Virbel',
author_email='[email protected]',
url='http://txzone.net/',
license='LGPL',
description='A webbrowser based on Berkelium project',
ext_modules=[ext],
cmdclass=cmdclass,
packages=['berkelium'],
package_dir={'berkelium': 'berkelium'},
package_data={'berkelium': data_files}
)