-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
66 lines (50 loc) · 1.53 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
64
65
import os
import distutils
from setuptools import setup, Extension, Command
from distutils.command import build as build_module
from distutils.command.install import install
BINUTILS_VERSION = "binutils-2.26"
module = Extension(
name = "bfdpie._bfdpie",
sources = ["bfdpie.c"],
# Include dir is our own binutils
include_dirs= ["tmp/install/include/"],
# Link against what?
library_dirs=["tmp/install/lib/"],
libraries=["bfd", "opcodes", "iberty", "z"],
)
class BuildCommand(distutils.command.build.build):
def run(self):
# Download and compile binutils first
os.system("./bfdpie_build.sh %s" % (BINUTILS_VERSION))
build_module.build.run(self)
setup(
name = "bfdpie",
version = "0.1.14",
description = "A tiny interface around a subset of libBFD. Code based on https://github.com/Groundworkstech/pybfd",
author = "Luka Malisa",
author_email = "luka.malisha@gmail.com",
url = "https://github.com/malisal/bfdpie",
keywords = ["binary", "libbfd"],
platforms=["any"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
packages=["bfdpie"],
package_dir={"bfdpie": "bfdpie"},
ext_modules = [module],
test_suite = "tests",
install_requires = [
"wheel>=0.29.0",
],
package_data = {
"bfdpie" : ["bin/dummy.elf"],
},
cmdclass={
"build": BuildCommand,
}
)