Changeset 5a7c000
- Timestamp:
- Nov 28, 2016, 4:33:48 PM (8 years ago)
- Branches:
- sampler
- Children:
- 8706a42
- Parents:
- c3af14b
- git-author:
- Paul Brossier <piem@piem.org> (10/03/16 16:40:48)
- git-committer:
- Paul Brossier <piem@piem.org> (11/28/16 16:33:48)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rc3af14b r5a7c000 29 29 30 30 build_python: 31 python ./setup.py generate $(ENABLE_DOUBLE) build31 python ./setup.py build_ext $(ENABLE_DOUBLE) 32 32 33 33 test_python: export LD_LIBRARY_PATH=$(PWD)/build/src … … 73 73 74 74 build_python3: 75 python3 ./setup.py generate $(ENABLE_DOUBLE) build75 python3 ./setup.py build_ext $(ENABLE_DOUBLE) 76 76 77 77 clean_python3: -
python/lib/moresetuptools.py
rc3af14b r5a7c000 125 125 distutils.command.clean.clean.run(self) 126 126 127 class GenerateCommand(distutils.cmd.Command): 128 description = 'generate gen/gen-*.c files from ../src/aubio.h' 129 user_options = [ 127 from distutils.command.build_ext import build_ext as _build_ext 128 class build_ext(_build_ext): 129 130 user_options = _build_ext.user_options + [ 130 131 # The format is (long option, short option, description). 131 132 ('enable-double', None, 'use HAVE_AUBIO_DOUBLE=1 (default: 0)'), … … 133 134 134 135 def initialize_options(self): 136 _build_ext.initialize_options(self) 135 137 self.enable_double = False 136 138 137 139 def finalize_options(self): 140 _build_ext.finalize_options(self) 138 141 if self.enable_double: 139 142 self.announce( … … 141 144 level=distutils.log.INFO) 142 145 143 def run(self): 144 self.announce( 'Generating code', level=distutils.log.INFO) 145 generated_object_files = generate_external(header, output_path, usedouble=self.enable_double) 146 def build_extension(self, extension): 147 if self.enable_double: 148 extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] 149 if os.path.isfile('src/aubio.h'): 150 # if aubio headers are found in this directory 151 add_local_aubio_header(extension) 152 # was waf used to build the shared lib? 153 if os.path.isdir(os.path.join('build','src')): 154 # link against build/src/libaubio, built with waf 155 add_local_aubio_lib(extension) 156 else: 157 # add libaubio sources and look for optional deps with pkg-config 158 add_local_aubio_sources(extension, usedouble=self.enable_double) 159 else: 160 # look for aubio headers and lib using pkg-config 161 add_system_aubio(extension) 162 # generate files python/gen/*.c, python/gen/aubio-generated.h 163 extension.sources += generate_external(header, output_path, overwrite = False, 164 usedouble=self.enable_double) 165 return _build_ext.build_extension(self, extension) -
setup.py
rc3af14b r5a7c000 48 48 49 49 if os.path.isfile('src/aubio.h'): 50 # if aubio headers are found in this directory 51 add_local_aubio_header(aubio_extension) 52 # was waf used to build the shared lib? 53 if os.path.isdir(os.path.join('build','src')): 54 # link against build/src/libaubio, built with waf 55 add_local_aubio_lib(aubio_extension) 56 else: 57 # add libaubio sources and look for optional deps with pkg-config 58 add_local_aubio_sources(aubio_extension) 59 __version__ += 'a2' # pypi version 60 else: 61 # look for aubio headers and lib using pkg-config 62 add_system_aubio(aubio_extension) 63 50 if not os.path.isdir(os.path.join('build','src')): 51 __version__ += 'a2' # python only version 64 52 65 53 classifiers = [ … … 77 65 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', 78 66 ] 79 80 from distutils.command.build_ext import build_ext as _build_ext81 class build_ext(_build_ext):82 83 def build_extension(self, extension):84 # generate files python/gen/*.c, python/gen/aubio-generated.h85 extension.sources += generate_external(header, output_path, overwrite = False)86 return _build_ext.build_extension(self, extension)87 67 88 68 distrib = setup(name='aubio', … … 105 85 cmdclass = { 106 86 'clean': CleanGenerated, 107 'generate': GenerateCommand,108 87 'build_ext': build_ext, 109 88 },
Note: See TracChangeset
for help on using the changeset viewer.