]> git.sesse.net Git - vlc/blob - bindings/python/setup.py
implement some minimum size of wx interface at all times. closes ticket #360.
[vlc] / bindings / python / setup.py
1 from distutils.core import setup, Extension
2 import os
3
4 def get_vlcconfig():
5     vlcconfig=None
6     for n in ( 'vlc-config',
7                os.path.sep.join( ('..', '..', 'vlc-config' ))):
8         if os.path.exists(n):
9             vlcconfig=n
10             break
11     if vlcconfig is None:
12         print "*** Warning *** Cannot find vlc-config"
13     elif os.sys.platform == 'win32':
14         # Win32 does not know how to invoke the shell itself.
15         vlcconfig="sh %s" % vlcconfig
16     return vlcconfig
17
18 def get_cflags():
19     vlcconfig=get_vlcconfig()
20     if vlcconfig is None:
21         return []
22     else:
23         cflags=os.popen('%s --cflags' % vlcconfig, 'r').readline().rstrip().split()
24         return cflags
25
26 def get_ldflags():
27     vlcconfig=get_vlcconfig()
28     if vlcconfig is None:
29         return []
30     else:
31         os.environ['top_builddir'] = '../..'
32         ldflags=os.popen('%s --libs vlc builtin' % vlcconfig, 'r').readline().rstrip().split()
33         return ldflags
34
35 # To compile in a local vlc tree
36 vlclocal = Extension('vlc',
37                 sources = ['vlcglue.c',
38                            '../../src/control/init.c'],
39                 include_dirs = ['../../include', '../../', '/usr/win32/include' ],
40                 extra_objects = [ '../../lib/libvlc.a' ],
41                 extra_compile_args = get_cflags(),
42                 extra_link_args = [ '-L../..' ]  + get_ldflags(),
43                 )
44
45 setup (name = 'MediaControl',
46        version = '0.8.2-1',
47        scripts = [ 'vlcdebug.py' ],
48        description = """VLC bindings for python.
49
50 This module provides a MediaControl object, which implements an API
51 inspired from the OMG Audio/Video Stream 1.0 specification. Moreover,
52 the module provides a Object type, which gives a low-level access to
53 the vlc objects and their variables.
54
55 Example session:
56
57 import vlc
58 mc=vlc.MediaControl(['--verbose', '1'])
59 mc.playlist_add_item('movie.mpg')
60
61 # Start the movie at 2000ms
62 p=vlc.Position()
63 p.origin=vlc.RelativePosition
64 p.key=vlc.MediaTime
65 p.value=2000
66 mc.start(p)
67 # which could be abbreviated as
68 # mc.start(2000)
69 # for the default conversion from int is to make a RelativePosition in MediaTime
70
71 # Display some text during 2000ms
72 mc.display_text('Some useless information', 0, 2000)
73
74 # Pause the video
75 mc.pause(0)
76
77 # Get status information
78 mc.get_stream_information()
79
80 # Access lowlevel objets
81 o=vlc.Object(1)
82 o.info()
83 i=o.find_object('input')
84 i.list()
85 i.get('time')
86        """,
87        ext_modules = [ vlclocal ])