Skip to content

Commit 050cfc7

Browse files
committed
fixed ordering of build_ext
1 parent ed8aa0b commit 050cfc7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.mediawiki

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<a href="https://travis-ci.org/vishnubob/python-midi"><img src="https://travis-ci.org/vishnubob/python-midi.svg?branch=master" /></a>
1+
<a href="https://travis-ci.org/vishnubob/python-midi"><img src="https://travis-ci.org/vishnubob/python-midi.svg?branch=master" alt='Build Statis' /></a>
2+
<a href='https://coveralls.io/github/vishnubob/python-midi?branch=master'><img src='https://coveralls.io/repos/vishnubob/python-midi/badge.svg?branch=master&service=github' alt='Coverage Status' /></a>
23

34
=Python MIDI=
45

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python
22

33
import os
4-
from distutils.core import setup, Extension
4+
from setuptools import setup, Extension
5+
import setuptools.command.install
56

67
__base__ = {
78
'name':'midi',
@@ -16,6 +17,13 @@
1617
'scripts':['scripts/mididump.py', 'scripts/mididumphw.py', 'scripts/midiplay.py'],
1718
}
1819

20+
# this kludge ensures we run the build_ext first before anything else
21+
# otherwise, we will be missing generated files during the copy
22+
class Install_Command_build_ext_first(setuptools.command.install.install):
23+
def run(self):
24+
self.run_command("build_ext")
25+
return setuptools.command.install.install.run(self)
26+
1927
def setup_alsa(ns):
2028
# scan for alsa include directory
2129
dirs = ["/usr/include", "/usr/local/include"]
@@ -44,6 +52,7 @@ def setup_alsa(ns):
4452
ns['py_modules'].append('midi.sequencer.sequencer')
4553
ns['py_modules'].append('midi.sequencer.sequencer_alsa')
4654
ns['ext_package'] = 'midi.sequencer'
55+
ns['cmdclass'] = {'install': Install_Command_build_ext_first}
4756

4857
def configure_platform():
4958
from sys import platform

0 commit comments

Comments
 (0)