-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
60 lines (54 loc) · 1.83 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
"""
Author: RedFantom
License: GNU GPLv3
Copyright (c) 2018-2019 RedFantom
"""
try:
from skbuild import setup
from skbuild.command.build import build
except ImportError:
print("scikit-build is required to build this project")
raise
from shutil import copyfile
import glob
import os
def read(file_name):
with open(file_name) as fi:
contents = fi.read()
return contents
class BuildCommand(build):
"""Intercept the build command to copy modules"""
def run(self):
build.run(self)
if len(glob.glob("./_skbuild/linux*")) != 0:
source = os.path.join("./_skbuild/linux*/cmake-build/*notifications.so*")
else:
source = os.path.join("./_skbuild/cmake-build/*notifications.so*")
target = os.path.join("./examples/notifications/mk_notifications.so")
copyfile(glob.glob(source)[0], target)
setup(
name="masterkeys",
version="0.3.0",
packages=["masterkeys"],
description="MasterKeys Control Library for Linux",
author="RedFantom",
url="https://github.com/RedFantom/masterkeys-linux",
download_url="https://github.com/RedFantom/masterkeys-linux/releases",
license="GNU GPLv3",
classifiers=[
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: C",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Hardware",
],
long_description=read("README.md"),
long_description_content_type="text/markdown",
zip_safe=False,
install_requires=["scikit-build"],
cmdclass={"build": BuildCommand}
)