File: 01-fix-python-version-binaries.patch

package info (click to toggle)
python-mido 1.1.18-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 652 kB
  • ctags: 645
  • sloc: python: 3,253; makefile: 136; sh: 4
file content (36 lines) | stat: -rw-r--r-- 1,040 bytes parent folder | download
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
Description: Generates executable files for Python 3 version to avoid collision names.
Author: Josue Ortega <josue@debian.org>
Forwarded: no 
Last-Update: 2016-07-07

--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,13 @@
     os.system("sphinx-build docs docs/_build")
     sys.exit()
 
+py_version_major = sys.version_info[0]
+
+if py_version_major == 3:
+    PY_VERSION = str(py_version_major)
+else:
+    PY_VERSION = ''
+
 setup(
     name='mido',
     version=mido.__version__,
@@ -31,10 +38,10 @@
     package_data={'': ['LICENSE']},
     package_dir={'mido': 'mido'},
     packages = ['mido', 'mido.backends'],
-    scripts = ['bin/mido-play',
-               'bin/mido-ports',
-               'bin/mido-serve',
-               'bin/mido-connect'],
+    scripts = ['bin/mido' + PY_VERSION + '-play',
+               'bin/mido' + PY_VERSION +  '-ports',
+               'bin/mido' + PY_VERSION + '-serve',
+               'bin/mido' + PY_VERSION + '-connect'],
     include_package_data=True,
     install_requires=[],
     license='MIT',