4040input_c = Extension ('evdev._input' , sources = ['evdev/input.c' ], extra_compile_args = cflags )
4141uinput_c = Extension ('evdev._uinput' , sources = ['evdev/uinput.c' ], extra_compile_args = cflags )
4242ecodes_c = Extension ('evdev._ecodes' , sources = ['evdev/ecodes.c' ], extra_compile_args = cflags )
43- iprops_c = Extension ('evdev.iprops' , sources = ['evdev/iprops.c' ], extra_compile_args = cflags )
4443
4544#-----------------------------------------------------------------------------
4645kw = {
5857 'classifiers' : classifiers ,
5958
6059 'packages' : ['evdev' ],
61- 'ext_modules' : [input_c , uinput_c , ecodes_c , iprops_c ],
60+ 'ext_modules' : [input_c , uinput_c , ecodes_c ],
6261 'include_package_data' : False ,
6362 'zip_safe' : True ,
6463 'cmdclass' : {},
@@ -107,48 +106,6 @@ def create_ecodes(headers=None):
107106 check_call (cmd , cwd = "%s/evdev" % here , shell = True )
108107
109108
110- #-----------------------------------------------------------------------------
111- def create_iprops (headers = None ):
112- if not headers :
113- headers = [
114- '/usr/include/linux/input.h' ,
115- '/usr/include/linux/input-event-codes.h' ,
116- '/usr/include/linux/uinput.h' ,
117- ]
118-
119- headers = [header for header in headers if os .path .isfile (header )]
120- if not headers :
121- msg = '''\
122- The 'linux/input.h' and 'linux/input-event-codes.h' include files
123- are missing. You will have to install the kernel header files in
124- order to continue:
125-
126- yum install kernel-headers-$(uname -r)
127- apt-get install linux-headers-$(uname -r)
128- emerge sys-kernel/linux-headers
129- pacman -S kernel-headers
130-
131- In case they are installed in a non-standard location, you may use
132- the '--evdev-headers' option to specify one or more colon-separated
133- paths. For example:
134-
135- python setup.py \\
136- build \\
137- build_iprops --evdev-headers path/input.h:path/input-event-codes.h \\
138- build_ext --include-dirs path/ \\
139- install
140- '''
141-
142- sys .stderr .write (textwrap .dedent (msg ))
143- sys .exit (1 )
144-
145- from subprocess import check_call
146-
147- print ('writing iprops.c (using %s)' % ' ' .join (headers ))
148- cmd = '%s geniprops.py %s > iprops.c' % (sys .executable , ' ' .join (headers ))
149- check_call (cmd , cwd = "%s/evdev" % here , shell = True )
150-
151-
152109#-----------------------------------------------------------------------------
153110class build_ecodes (Command ):
154111 description = 'generate ecodes.c'
@@ -168,24 +125,6 @@ def run(self):
168125 create_ecodes (self .evdev_headers )
169126
170127
171- class build_iprops (Command ):
172- description = 'generate iprops.c'
173-
174- user_options = [
175- ('evdev-headers=' , None , 'colon-separated paths to input subsystem headers' ),
176- ]
177-
178- def initialize_options (self ):
179- self .evdev_headers = None
180-
181- def finalize_options (self ):
182- if self .evdev_headers :
183- self .evdev_headers = self .evdev_headers .split (':' )
184-
185- def run (self ):
186- create_iprops (self .evdev_headers )
187-
188-
189128class build_ext (_build_ext .build_ext ):
190129 def has_ecodes (self ):
191130 ecodes_path = os .path .join (here , 'evdev/ecodes.c' )
@@ -194,25 +133,17 @@ def has_ecodes(self):
194133 print ('ecodes.c already exists ... skipping build_ecodes' )
195134 return not res
196135
197- def has_iprops (self ):
198- iprops_path = os .path .join (here , 'evdev/iprops.c' )
199- res = os .path .exists (iprops_path )
200- if res :
201- print ('iprops.c already exists ... skipping build_iprops' )
202- return not res
203-
204136 def run (self ):
205137 for cmd_name in self .get_sub_commands ():
206138 self .run_command (cmd_name )
207139 _build_ext .build_ext .run (self )
208140
209- sub_commands = [('build_ecodes' , has_ecodes ), ( 'build_iprops' , has_iprops ) ] + _build_ext .build_ext .sub_commands
141+ sub_commands = [('build_ecodes' , has_ecodes )] + _build_ext .build_ext .sub_commands
210142
211143
212144#-----------------------------------------------------------------------------
213145kw ['cmdclass' ]['build_ext' ] = build_ext
214146kw ['cmdclass' ]['build_ecodes' ] = build_ecodes
215- kw ['cmdclass' ]['build_iprops' ] = build_iprops
216147
217148
218149#-----------------------------------------------------------------------------
0 commit comments