-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
73 lines (66 loc) · 2.26 KB
/
Copy pathsetup.py
File metadata and controls
73 lines (66 loc) · 2.26 KB
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
# setup.py
#
# A ridicolously simple Python binding for libalsaplayer
#
# Author: Leonardo
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
#
#
## {{{ http://code.activestate.com/recipes/502261/ (r1)
#!/usr/bin/env python
from distutils.core import setup
from distutils.extension import Extension
from subprocess import Popen, PIPE
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
p = Popen(
"pkg-config --libs --cflags".split() + list(packages),
stdout=PIPE
)
for token in p.communicate()[0].decode().strip().split():
kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
return kw
setup(
name="alsapyer",
version="0.2",
description="A ridicolously simple Python binding for libalsaplayer",
author="Leonardo",
author_email="leonardo@perpli.me",
url="http://github.com/leofiore/alsapyer",
license="WTFPL",
ext_modules=[
Extension("alsapyer", ["alsapyer/alsapyer.c"],
**pkgconfig('alsaplayer')),
],
long_description="""
This is a simple and lightweight python binding for libalsaplayer.
alsapyer is written in C, and do not requires any third party library
except libalsaplayer itself.
It maps 1:1 all the alsaplayer exposed functions, so if you already
used it you're ready for shine.
""",
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: C",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules"
]
)
## end of http://code.activestate.com/recipes/502261/ }}}