예제 #1
0
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src

sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow',
                          ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

if sys.hexversion < 0x02060000:
    # Fixed os.listdir for Python 2.5.  This module is optional for Python 2.5
    # (only installed if headers/libs are available) and not compiled for later
    # versions.
    utils_ext = Extension('kaa.base._utils', ['src/extensions/utils.c'])
    if utils_ext.has_python_h():
        extensions.append(utils_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
예제 #2
0
파일: setup.py 프로젝트: Dischi/kaa-base
#
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow', ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION
if os.path.isdir('.git'):
    # Fetch all revisions since last tag.  The first item is the current HEAD object name
    # and the last is the tag object name.
    revs = os.popen('git rev-list --all | grep -B9999  `git rev-list --tags --max-count=1`').read().splitlines()
    if len(revs) > 1:
        # We're at least one commit past the last tag, so this is considered a
        # dev release.
예제 #3
0
파일: setup.py 프로젝트: freevo/kaa-imlib2
    setup(name='kaa-' + MODULE, version=VERSION, install_requires=REQUIRES)
    sys.exit(0)


try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)

files = [ 'src/imlib2.c', 'src/image.c', 'src/font.c', 'src/rawformats.c' ]
libraries = []
if not os.uname()[0] in ('FreeBSD', 'Darwin'):
    libraries.append('rt')
imlib2so = Extension('kaa.imlib2._Imlib2module', files,
                     libraries = libraries, config='src/config.h')


if not imlib2so.check_library('imlib2', '1.2.1'):
    print 'Imlib2 >= 1.2.1 not found'
    print 'Download from http://enlightenment.freedesktop.org/'
    sys.exit(1)


if imlib2so.check_cc(['<fcntl.h>'], 'shm_open("foobar");', '-lrt'):
    imlib2so.config('#define HAVE_POSIX_SHMEM')
    print "POSIX shared memory enabled"
else:
    print "POSIX shared memory disabled"

if imlib2so.check_library("librsvg-2.0", "2.10.0"):
예제 #4
0
파일: setup.py 프로젝트: clones/kaa
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)
    
thumbnailer = Extension("kaa.thumb._thumbnailer",
                        ["src/thumbnail.c", "src/png.c" ],
                        config='src/config.h')

if not thumbnailer.check_library('imlib2', '1.1.1'):
    print 'Imlib2 >= 1.1.1 not found'
    print 'Download from http://enlightenment.freedesktop.org/'
    sys.exit(1)

if not thumbnailer.check_library('libpng', '1.2.0'):
    print 'libpng >= 1.2.0 not found'
    sys.exit(1)

if thumbnailer.check_library('epeg', '0.9'):
    print 'epeg extention enabled'
    thumbnailer.config('#define USE_EPEG')
else:
예제 #5
0
    setup(name='kaa-' + MODULE, version=VERSION, install_requires=REQUIRES)
    sys.exit(0)


try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)

files = [ 'src/imlib2.c', 'src/image.c', 'src/font.c', 'src/rawformats.c' ]
libraries = []
if not os.uname()[0] in ('FreeBSD', 'Darwin'):
    libraries.append('rt')
imlib2so = Extension('kaa.imlib2._Imlib2module', files,
                     libraries = libraries, config='src/config.h')


if not imlib2so.check_library('imlib2', '1.2.1'):
    print 'Imlib2 >= 1.2.1 not found'
    print 'Download from http://enlightenment.freedesktop.org/'
    sys.exit(1)


if imlib2so.check_cc(['<fcntl.h>'], 'shm_open("foobar");', '-lrt'):
    imlib2so.config('#define HAVE_POSIX_SHMEM')
    print "POSIX shared memory enabled"
else:
    print "POSIX shared memory disabled"

if imlib2so.check_library("librsvg-2.0", "2.10.0"):
예제 #6
0
파일: setup.py 프로젝트: clones/kaa
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now append 'src/' to the path so we can import distribution.core.  We don't
# want to insert to the front because then any absolute imports will look in
# src/ first, rather than standard Python modules, which is a problem for any
# modules whose name collides (e.g. io)
#sys.path.append('src')
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

shm_ext = Extension('kaa.base.shmmodule', ['src/extensions/shmmodule.c'])
if not shm_ext.has_python_h():
    print('---------------------------------------------------------------------\n'
          'Python headers not found; please install python development package.\n'
          'kaa.db, shm and inotify support will be unavailable\n'
          '---------------------------------------------------------------------')
    time.sleep(2)

else:
    osname = os.popen('uname -s').read().strip().lower()
    if osname == 'darwin':
        print('- kaa.shm not supported on Darwin, not building')
    elif sys.hexversion < 0x03000000:
        # shm not compatible with Python 3 (yet? maybe we should remove
        # this module)
        extensions.append(shm_ext)
예제 #7
0
파일: setup.py 프로젝트: clones/kaa
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)

# cdrom extension, FIXME: check if it will compile
cdrom = Extension('kaa/metadata/disc/_cdrom', ['src/disc/cdrommodule.c'])

# check for libdvdread
ifoparser = Extension('kaa.metadata.disc._ifoparser', ['src/disc/ifomodule.c'],
                      libraries=[ 'dvdread' ])

try:
    if not ifoparser.check_cc([], '', '-ldvdread'):
        print 'Warning: libdvdread is missing.'
        raise AttributeError()

    if not ifoparser.check_cc(['<dvdread/dvd_reader.h>'], '', '-ldvdread'):
        print 'Warning: libdvdread header file is missing.'
        raise AttributeError()

    ext_modules = [ cdrom, ifoparser ]
예제 #8
0
파일: setup.py 프로젝트: clones/kaa
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
# CHANTABILITY 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.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import setup, Extension
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)
    
ext_modules = []
libvisual = Extension("kaa.player._libvisual", ['src/extensions/libvisual.c'])
if libvisual.check_library("libvisual", "0.2.0"):
    print "+ libvisual support enabled"
    ext_modules.append(libvisual)
else:
    print "- libvisual support disabled"

setup(module = 'player', version = '0.1', ext_modules = ext_modules)
예제 #9
0
파일: setup.py 프로젝트: clones/kaa
            os.unlink(file)
    sys.exit(0)

libcandy_modules = [ 'clutter-reflect-texture' ]

# add /usr/local/lib/pkgconfig because this is where clutter installs
# as default and it may not be in your path
pkgconfig = '/usr/local/lib/pkgconfig'
if os.environ.get('PKG_CONFIG_PATH'):
    pkgconfig += ':' + os.environ.get('PKG_CONFIG_PATH')
os.environ['PKG_CONFIG_PATH'] = pkgconfig

# create libcandy extension, gen_libcandy.c may not exist yet
files = [ 'src/backend/%s.c' % m for m in libcandy_modules ]
files.extend(['src/backend/gen_libcandy.c', 'src/backend/libcandymodule.c'])
libcandy = Extension('kaa/candy/backend/libcandy', files)

# check dependencies
if not libcandy.check_library('clutter-1.0', '1.0.4'):
    print 'clutter-1.0 >= 1.0.4 not found'
    sys.exit(1)
if not libcandy.check_library('pygobject-2.0', '2.16.0'):
    print 'pygobject >= 2.16.0 not found'
    sys.exit(1)

# check for pygobject-codegen to generate python bindings
# should be part of pygobject
pygobject_codegen = kaa.utils.which('pygobject-codegen-2.0')
if not pygobject_codegen:
    print 'pygobject-codegen-2.0 not found, should be part of pygobject'
    sys.exit(1)
예제 #10
0
# We require python 2.5 or later, so complain if that isn't satisfied.
if sys.version.split()[0] < '2.5':
    print "Python 2.5 or later required."
    sys.exit(1)

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError, e:
    print e
    print 'kaa.base not installed'
    sys.exit(1)

thumb_ext = Extension("kaa.beacon.libthumb",
                      ["src/extensions/libthumb.c", "src/extensions/libpng.c"],
                      config='src/extensions/config.h')

if not thumb_ext.check_library('imlib2', '1.1.1'):
    print 'Imlib2 >= 1.1.1 not found'
    print 'Download from http://enlightenment.freedesktop.org/'
    sys.exit(1)

if not thumb_ext.check_library('libpng', '1.2.0'):
    print 'libpng >= 1.2.0 not found'
    sys.exit(1)

if thumb_ext.check_cc([], '', '-ljpeg'):
    thumb_ext.files.append('src/extensions/epeg.c')
    thumb_ext.libraries.append('jpeg')
    thumb_ext.config('#define USE_EPEG')
예제 #11
0
파일: setup.py 프로젝트: charrea6/kaa-base
#
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow', ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

if sys.hexversion < 0x02060000:
    # Fixed os.listdir for Python 2.5.  This module is optional for Python 2.5
    # (only installed if headers/libs are available) and not compiled for later
    # versions.
    utils_ext = Extension('kaa.base._utils', ['src/extensions/utils.c'])
    if utils_ext.has_python_h():
        extensions.append(utils_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
예제 #12
0
파일: setup.py 프로젝트: clones/kaa
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)
    
ext_modules = []
mng = Extension("kaa.candy._mng", ['src/extensions/mng.c'])
if mng.check_cc(["<libmng.h>"], "", "-lmng"):
    ext_modules.append(mng)
    mng.libraries.append("mng")
    print "+ mng support enabled"
else:
    print "- mng support disabled"

svg = Extension("kaa.candy._svg", ['src/extensions/svg.c'])
if svg.check_library("librsvg-2.0", "2.10.0"):
    ext_modules.append(svg)
    print "+ svg support enabled"
else:
    print "- svg support disabled"

예제 #13
0
파일: setup.py 프로젝트: clones/kaa
# dvb module
dvb = Extension('kaa.record._dvb', [ 'src/dvb_tuner.cc', 'src/dvb_device.cc' ])

# fdsplitter module
fdsplitter = Extension('kaa.record._fdsplitter', [ 'src/fdsplitter.cc' ] )

# filter module
files = [ 'src/fp_filewriter.cc', 'src/fp_remux.cc', 'src/fp_udpsend.cc',
          'src/remux.cc', 'src/ringbuffer.cc', 'src/filter.cc']
filter = Extension('kaa.record._filter', files)

# list of all modules
ext_modules = [ dvb, filter, fdsplitter ]

# vbi module
vbi = Extension('kaa.record._vbi', ['src/vbi.cc'])
if not vbi.check_cc(['"libzvbi.h"'], '', '-lzvbi'):
    print 'libzvbi not found, disable vbi support'
else:
    vbi.libraries.append('zvbi')
    ext_modules.append(vbi)
    
setup(module      = 'record',
      version     = '0.1.0',
      license     = 'GPL',
      summary     = 'Python library for recording from different types of tv cards to different outputs.',
      rpminfo     = {
          'requires':       'python-kaa-base >= 0.1.2',
          'build_requires': 'python-kaa-base >= 0.1.2'
      },
      ext_modules = ext_modules
예제 #14
0
파일: setup.py 프로젝트: clones/kaa
# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)

# NOTE: this is no python module!
# It is a gstreamer plugin not in the gstreamer plugin path.
# When kaa.record2 is init, this module will be added to
# gstreaner on runtime.
tuner = Extension('kaa.record2._gstrecord',
                  [ 'gst/gstdvbtuner.c', 'gst/gsttssplitter.c',
                    'gst/gstmain.c' ],
                  config='gst/config.h')
tuner.config('#define VERSION "0.1"')
tuner.config('#define PACKAGE "kaa.record"')

if not tuner.check_library('gstreamer-0.10', '0.1'):
    print 'gstreamer 0.10 not found'
    sys.exit(1)

setup(module      = 'record2',
      version     = '0.1',
      ext_modules = [ tuner ]
)
예제 #15
0
#
# So to avoid any problems, remove anything kaa from the path, since we don't
# need it.
[sys.path.remove(x) for x in sys.path[:] if '/kaa' in x and x != os.getcwd()]

# Now import the src directory and masquerade it as kaa and kaa.base modules so
# we can import distribution.core.
import src
sys.modules['kaa'] = sys.modules['kaa.base'] = src

# And now import it from the source tree.
from kaa.distribution.core import Extension, setup

extensions = []

objectrow_ext = Extension('kaa.base._objectrow',
                          ['src/extensions/objectrow.c'])
if objectrow_ext.has_python_h():
    extensions.append(objectrow_ext)

# Automagically construct version.  If installing from a git clone, the
# version is based on the number of revisions since the last tag.  Otherwise,
# if PKG-INFO exists, assume it's a dist tarball and pull the version from
# that.
version = VERSION
if os.path.isdir('.git'):
    # Fetch all revisions since last tag.  The first item is the current HEAD object name
    # and the last is the tag object name.
    revs = os.popen(
        'git rev-list --all | grep -B9999  `git rev-list --tags --max-count=1`'
    ).read().splitlines()
    if len(revs) > 1:
예제 #16
0
파일: setup.py 프로젝트: clones/kaa
# We require python 2.5 or later, so complain if that isn't satisfied.
if sys.version.split()[0] < '2.5':
    print "Python 2.5 or later required."
    sys.exit(1)

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError, e:
    print e
    print 'kaa.base not installed'
    sys.exit(1)


thumb_ext = Extension("kaa.beacon.libthumb",
    ["src/extensions/libthumb.c", "src/extensions/libpng.c" ], config='src/extensions/config.h')

if not thumb_ext.check_library('imlib2', '1.1.1'):
    print 'Imlib2 >= 1.1.1 not found'
    print 'Download from http://enlightenment.freedesktop.org/'
    sys.exit(1)

if not thumb_ext.check_library('libpng', '1.2.0'):
    print 'libpng >= 1.2.0 not found'
    sys.exit(1)

if thumb_ext.check_cc([], '', '-ljpeg'):
    thumb_ext.files.append('src/extensions/epeg.c')
    thumb_ext.libraries.append('jpeg')
    thumb_ext.config('#define USE_EPEG')
else:
예제 #17
0
파일: setup.py 프로젝트: clones/kaa
# python imports
import sys

try:
    # kaa base imports
    from kaa.distribution.core import Extension, setup
except ImportError:
    print 'kaa.base not installed'
    sys.exit(1)

ext_modules = []

ofa = Extension('kaa.netsearch.ofa', [ 'src/ofa.cc' ])
if not ofa.check_library('libofa', '0.9'):
    print 'libofa >= 0.9 not found'
    print 'building without musicdns support'
else:
    ext_modules.append(ofa)

setup(module      = 'netsearch',
      version     = '0.1',
      ext_modules = ext_modules
)