setup.py :  » Media-Sound-Audio » Python-Audio-Tools » audiotools-2.14 » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Media Sound Audio » Python Audio Tools 
Python Audio Tools » audiotools 2.14 » setup.py
#!/usr/bin/python

#Audio Tools, a module and set of tools for manipulating audio data
#Copyright (C) 2007-2010  Brian Langenberger

#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

VERSION = '2.14'

import sys

if (sys.version_info < (2,5,0,'final',0)):
    print >>sys.stderr,"*** Python 2.5.0 or better required"
    sys.exit(1)

from distutils.core import setup,Extension
import subprocess,re

def pkg_config(package, option):
    sub = subprocess.Popen(["pkg-config",option,package],
                           stdout=subprocess.PIPE)
    spaces = re.compile('\s+',re.DOTALL)
    args = spaces.split(sub.stdout.read().strip())
    sub.stdout.close()
    sub.wait()
    return args

cdiomodule = Extension('audiotools.cdio',
                    sources = ['src/cdiomodule.c'],
                    libraries = ['cdio','cdio_paranoia',
                                 'cdio_cdda','m'])

resamplemodule = Extension('audiotools.resample',
                            sources = ['src/resample.c'])

pcmmodule = Extension('audiotools.pcm',
                      sources = ['src/pcm.c'])

replaygainmodule = Extension('audiotools.replaygain',
                             sources = ['src/replaygain.c'])

decodersmodule = Extension('audiotools.decoders',
                           sources = ['src/array.c',
                                      'src/bitstream_r.c',
                                      'src/decoders/flac.c',
                                      'src/decoders.c'],
                           define_macros = [("VERSION",VERSION)])

encodersmodule = Extension('audiotools.encoders',
                           sources = ['src/array.c',
                                      'src/bitstream_w.c',
                                      'src/pcmreader.c',
                                      'src/md5.c',
                                      'src/encoders/flac.c',
                                      'src/encoders/flac_lpc.c',
                                      'src/encoders.c'],
                           define_macros = [("VERSION",VERSION)])

extensions = [cdiomodule,
              resamplemodule,
              pcmmodule,
              replaygainmodule,
              decodersmodule,
              encodersmodule]


#This is an ALSA extension module, not quite ready for use.
#It chokes on a large number of hi-def PCM combinations
#which makes it not yet suitable for general use.
# try:
#     if (subprocess.call(["pkg-config","--exists","alsa"]) == 0):
#         #ALSA available
#         extensions.append(Extension(
#             'audiotools.alsa',
#             sources = ['src/alsa.c'],
#             include_dirs = [f[2:] for f in pkg_config('alsa','--cflags') if
#                             (f.startswith('-I'))],
#             libraries = [f[2:] for f in pkg_config('alsa','--libs') if
#                          (f.startswith('-l'))],
#             library_dirs = [f[2:] for f in pkg_config('alsa','--libs') if
#                             (f.startswith('-L'))]))

# except OSError:
#     pass #pkg-config not available

# try:
#     if (subprocess.call(["pkg-config","--exists","libpulse"]) == 0):
#         #libpulse available
#         extensions.append(Extension(
#             'audiotools.pulse',
#             sources = ['src/pulse.c'],
#             include_dirs = [f[2:] for f in
#                             pkg_config('libpulse-simple','--cflags') if
#                             (f.startswith('-I'))],
#             libraries = [f[2:] for f in
#                          pkg_config('libpulse-simple','--libs') if
#                          (f.startswith('-l'))],
#             library_dirs = [f[2:] for f in
#                             pkg_config('libpulse-simple','--libs') if
#                             (f.startswith('-L'))]
#             ))

# except OSError:
#     pass #pkg-config not available

setup (name = 'Python Audio Tools',
       version = VERSION,
       description = 'A collection of audio handling utilities',
       author = 'Brian Langenberger',
       author_email = 'tuffy@users.sourceforge.net',
       url='http://audiotools.sourceforge.net',
       packages = ["audiotools",
                   "audiotools.construct",
                   "audiotools.construct.lib"],
       ext_modules = extensions,
       data_files = [("/etc",["audiotools.cfg"]),
                     ("share/audiotools",["glade/coverview.glade"]),
                     ("share/audiotools",["glade/editxmcd.glade"])],
       scripts = ["cd2track","cd2xmcd","cdinfo",
                  "track2track","track2xmcd","trackrename","trackinfo",
                  "tracklength","track2cd","trackcmp","trackplay",
                  "tracktag","editxmcd","audiotools-config",
                  "trackcat","tracksplit",
                  "tracklint",
                  "coverdump","coverview","record2track"])
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.