forked from jbaiter/chdkptp.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
36 lines (31 loc) · 1.19 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
import os
import subprocess
from setuptools.command.install import install as InstallCommand
from setuptools import setup
CHDKPTP_PATH = os.path.abspath(os.path.join('.', 'chdkptp', 'vendor',
'chdkptp'))
CHDKPTP_PATCH = os.path.abspath(os.path.join('.', 'chdkptp_module.diff'))
class CustomInstall(InstallCommand):
def run(self):
subprocess.check_call(['patch', '-d', CHDKPTP_PATH, '-i',
CHDKPTP_PATCH, '-p', '1'])
os.symlink(os.path.join(CHDKPTP_PATH, 'config-sample-linux.mk'),
os.path.join(CHDKPTP_PATH, 'config.mk'))
subprocess.check_call(['make', '-C', CHDKPTP_PATH])
InstallCommand.run(self)
setup(
name='chdkptp.py',
version="0.1.3",
description=("Python bindings for chdkptp"),
author="Johannes Baiter",
url="http://github.com/jbaiter/chdkptp-py.git",
author_email="[email protected]",
license='GPL',
packages=['chdkptp'],
package_data={"chdkptp": ["vendor/chdkptp/chdkptp.so",
"vendor/chdkptp/lua/*.lua"]},
install_requires=[
"lupa >= 1.1",
],
cmdclass={'install': CustomInstall}
)