Hi,

Attached to this email you will find the patch against current debian package 
in unstable.


--
Francisco Moya Fernandez      Computer Architecture and Networks Group
Assistant Professor
[EMAIL PROTECTED]                      School of Computer Science
Fax:(+34 926) 29 53 54                University of Castilla-La Mancha
Tel:(+34 926) 29 54 83                      http://www.inf-cr.uclm.es/



-----Mensaje original-----
De: Loïc Minier [mailto:[EMAIL PROTECTED]
Enviado el: mar 12/02/2008 17:21
Para: FRANCISCO MOYA FERNANDEZ; [EMAIL PROTECTED]
Asunto: Re: Bug#463725: vlc: Please, enable python bindings
 
        Hi,

On Sat, Feb 02, 2008, FRANCISCO MOYA FERNANDEZ wrote:
> Please, enable MediaControl python bindings. Attached to this report 
> you will find a diff which adds a patch from Fedora Core 8 to fix
> compilation issues of the python extension when libtool libraries are 
> used.

 Could you please attach a patch instead?

   Thanks!
-- 
Loïc Minier


diff -Nru vlc-0.8.6.c/debian/changelog vlc-0.8.6.c+python/debian/changelog
--- vlc-0.8.6.c/debian/changelog	2008-02-12 18:22:14.000000000 +0100
+++ vlc-0.8.6.c+python/debian/changelog	2008-02-02 03:40:23.000000000 +0100
@@ -1,3 +1,15 @@
+vlc (0.8.6.c-6.2) unstable; urgency=low
+
+  * Fixed compliance with Python policy
+
+ -- Francisco Moya <[EMAIL PROTECTED]>  Sat, 02 Feb 2008 03:40:22 +0100
+
+vlc (0.8.6.c-6.1) unstable; urgency=low
+
+  * Added support for python bindings (patch taken from Fedora)
+
+ -- Francisco Moya <[EMAIL PROTECTED]>  Fri, 01 Feb 2008 22:54:34 +0100
+
 vlc (0.8.6.c-6) unstable; urgency=high
 
   [ Nico Golde ]
diff -Nru vlc-0.8.6.c/debian/control vlc-0.8.6.c+python/debian/control
--- vlc-0.8.6.c/debian/control	2008-02-12 18:22:14.000000000 +0100
+++ vlc-0.8.6.c+python/debian/control	2008-02-02 02:14:21.000000000 +0100
@@ -76,7 +76,8 @@
                libsdl-image1.2-dev,
                libnotify-dev,
                libgtk2.0-dev,
-               python-dev,
+	       python-all-dev,
+	       python-support,
                libfaad-dev,
                libjack-dev
 Standards-Version: 3.7.3
@@ -366,3 +367,16 @@
  DivX, MOV, WMV, QuickTime, mp3, Ogg/Vorbis files, DVDs, VCDs, and multimedia
  streams from various network sources.
 
+Package: python-vlc
+Section: python
+Architecture: any
+Depends: ${shlibs:Depends}, ${python:Depends}
+Provides: ${python:Provides}
+Description: multimedia player and streamer library (Python bindings)
+ This package contains the binary module required by python
+ applications using VLC features.
+ .
+ VLC is the VideoLAN project's media player. It plays MPEG, MPEG2, MPEG4,
+ DivX, MOV, WMV, QuickTime, mp3, Ogg/Vorbis files, DVDs, VCDs, and multimedia
+ streams from various network sources.
+
diff -Nru vlc-0.8.6.c/debian/patches/400_python_fedora.diff vlc-0.8.6.c+python/debian/patches/400_python_fedora.diff
--- vlc-0.8.6.c/debian/patches/400_python_fedora.diff	1970-01-01 01:00:00.000000000 +0100
+++ vlc-0.8.6.c+python/debian/patches/400_python_fedora.diff	2008-02-02 02:59:14.000000000 +0100
@@ -0,0 +1,189 @@
+Index: vlc-0.8.6.c/bindings/mediacontrol-python/Makefile.am
+===================================================================
+--- vlc-0.8.6.c.orig/bindings/mediacontrol-python/Makefile.am	2008-02-02 02:56:12.000000000 +0100
++++ vlc-0.8.6.c/bindings/mediacontrol-python/Makefile.am	2008-02-02 02:57:44.000000000 +0100
+@@ -3,6 +3,7 @@
+ ###############################################################################
+ 
+ EXTRA_DIST = vlcglue.c vlcglue.h setup.py vlcwrapper.py
++PYTHON = python
+ 
+ if BUILD_PYTHON
+ 
+@@ -13,12 +14,12 @@
+ endif
+ 
+ all:
+-	srcdir="$(srcdir)" top_builddir="$(top_builddir)" python "$(srcdir)/setup.py" build $(COMPILERARG) "--build-base=$(top_builddir)/bindings/mediacontrol-python" "--build-temp=$(top_builddir)/bindings/mediacontrol-python"
++	srcdir="$(srcdir)" top_builddir="$(top_builddir)" $(PYTHON) "$(srcdir)/setup.py" build $(COMPILERARG) "--build-base=$(top_builddir)/bindings/mediacontrol-python" "--build-temp=$(top_builddir)/bindings/mediacontrol-python"
+ 
+ # FIXME: python setup.py install does not have any option to install from a different build directory
+ # so this will not work in a separate builddir
+ install:
+-	python $(srcdir)/setup.py install
++	$(PYTHON) $(srcdir)/setup.py install
+ 
+ clean:
+ 	$(RM) -rf build
+Index: vlc-0.8.6.c/bindings/mediacontrol-python/setup.py
+===================================================================
+--- vlc-0.8.6.c.orig/bindings/mediacontrol-python/setup.py	2008-02-02 02:53:12.000000000 +0100
++++ vlc-0.8.6.c/bindings/mediacontrol-python/setup.py	2008-02-02 02:56:26.000000000 +0100
+@@ -13,6 +13,23 @@
+     top_builddir = os.path.join( '..', '..' )
+     os.environ['top_builddir'] = top_builddir
+ 
++# Determine the extra link args. Normally, vlc-config should take care
++# of this and return the right path values, from a development tree or
++# an installed version.
++libtool=False
++linkargs=[]
++d=os.path.join(top_builddir, 'src', '.libs')
++if os.path.exists(d):
++    # We are in a development tree, which was compiled with libtool
++    libtool=True
++    linkargs=[ '-L' + d ]
++else:
++    d=os.path.join(top_builddir, 'src')
++    # We are in a development tree, which was compiled without libtool
++    if os.path.exists(d):
++        linkargs=[ '-L' + d ]
++
++# For out-of-tree compilations
+ try:
+     srcdir=os.environ['srcdir']
+ except KeyError:
+@@ -21,16 +38,6 @@
+ if not srcdir:
+     srcdir = '.'
+ 
+-#if os.sys.platform in ('win32', 'darwin'):
+-    # Do not use PIC version on win32 and Mac OS X
+-if True:
+-    # PIC version seems to be disabled on all platforms
+-    vlclib=os.path.join( top_builddir, 'src', 'libvlc.a' )
+-    picflag=''
+-else:
+-    vlclib=os.path.join( top_builddir, 'src', 'libvlc_pic.a' )
+-    picflag='pic'
+-
+ def get_vlcconfig():
+     vlcconfig=None
+     for n in ( 'vlc-config',
+@@ -58,7 +65,7 @@
+     if vlcconfig is None:
+         return []
+     else:
+-        cflags=os.popen('%s --cflags' % vlcconfig, 'r').readline().rstrip().split()
++        cflags=os.popen('%s --cflags vlc' % vlcconfig, 'r').readline().rstrip().split()
+         return cflags
+ 
+ def get_ldflags():
+@@ -69,11 +76,15 @@
+ 	ldflags = []
+ 	if os.sys.platform == 'darwin':
+ 	    ldflags = "-read_only_relocs warning".split()
+-        ldflags.extend(os.popen('%s --libs vlc %s builtin' % (vlcconfig,
+-							      picflag), 
++        ldflags.extend(os.popen('%s --libs external' % vlcconfig,
+ 				'r').readline().rstrip().split())
+ 	if os.sys.platform == 'darwin':
+ 	    ldflags.append('-lstdc++')
++        if not libtool:
++            # vlc-config is broken and gives a -lvlc-control which
++            # does not exist if libtool is disabled.
++            ldflags.remove('-lvlc-control')
++        return ldflags
+         return ldflags
+ 
+ # To compile in a local vlc tree
+@@ -81,12 +92,11 @@
+                 sources = [ os.path.join( srcdir, 'vlcglue.c'),
+                             os.path.join( srcdir, '../../src/control/mediacontrol_init.c')],
+                 include_dirs = [ top_builddir,
+-		                 os.path.join( srcdir, '../../include'),
+-		                 os.path.join( srcdir, '../../', '/usr/win32/include') ],
+-
+-                extra_objects = [ vlclib ],
++                                 os.path.join( srcdir, '..', '..', 'include' ),
++                                 srcdir, '/usr/win32/include' ],
++                extra_objects = [ ],
+                 extra_compile_args = get_cflags(),
+-		extra_link_args = [ '-L' + top_builddir ]  + get_ldflags(),
++		extra_link_args = linkargs + get_ldflags(),
+                 )
+ 
+ setup (name = 'MediaControl',
+@@ -96,12 +106,13 @@
+        license = "GPL", 
+        description = """VLC bindings for python.
+ 
+-This module provides a MediaControl object, which implements an API
+-inspired from the OMG Audio/Video Stream 1.0 specification. Moreover,
+-the module provides a Object type, which gives a low-level access to
+-the vlc objects and their variables.
+-
+-Documentation can be found on the VLC wiki : 
++This module provides bindings for the native libvlc API of the VLC
++video player. Documentation can be found on the VLC wiki :
++http://wiki.videolan.org/index.php/ExternalAPI
++
++This module also provides a MediaControl object, which implements an
++API inspired from the OMG Audio/Video Stream 1.0 specification.
++Documentation can be found on the VLC wiki :
+ http://wiki.videolan.org/index.php/PythonBinding
+ 
+ Example session:
+@@ -128,12 +139,5 @@
+ 
+ # Get status information
+ mc.get_stream_information()
+-
+-# Access lowlevel objets
+-o=vlc.Object(1)
+-o.info()
+-i=o.find_object('input')
+-i.list()
+-i.get('time')
+        """,
+        ext_modules = [ vlclocal ])
+Index: vlc-0.8.6.c/vlc-config.in.in
+===================================================================
+--- vlc-0.8.6.c.orig/vlc-config.in.in	2008-02-02 02:53:12.000000000 +0100
++++ vlc-0.8.6.c/vlc-config.in.in	2008-02-02 02:56:26.000000000 +0100
+@@ -324,7 +324,7 @@
+   fi
+   if test "${echo_external}" = yes; then
+     for module in `echo "${builtins}"`; do
+-      ldflags="${ldflags} @libdir@/vlc/lib${module}.a"
++      ldflags="${ldflags} `find ${top_builddir} -name \"lib${module}.a\"` "
+     done
+     for module in `echo "${builtins}"`; do
+       register_flags "${module}"
+Index: vlc-0.8.6.c/bindings/mediacontrol-python/Makefile.in
+===================================================================
+--- vlc-0.8.6.c.orig/bindings/mediacontrol-python/Makefile.in	2008-02-02 02:53:12.000000000 +0100
++++ vlc-0.8.6.c/bindings/mediacontrol-python/Makefile.in	2008-02-02 02:58:54.000000000 +0100
+@@ -311,6 +311,7 @@
+ uudecode = @uudecode@
+ 
+ EXTRA_DIST = vlcglue.c vlcglue.h setup.py vlcwrapper.py
++PYTHON = python
+ subdir = bindings/mediacontrol-python
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ mkinstalldirs = $(SHELL) $(top_srcdir)/autotools/mkinstalldirs
+@@ -462,12 +463,12 @@
+ @BUILD_PYTHON_TRUE@@HAVE_WIN32_FALSE@	COMPILERARG = 
+ 
+ @[EMAIL PROTECTED]:
[EMAIL PROTECTED]@	srcdir="$(srcdir)" top_builddir="$(top_builddir)" python "$(srcdir)/setup.py" build $(COMPILERARG) "--build-base=$(top_builddir)/bindings/mediacontrol-python" "--build-temp=$(top_builddir)/bindings/mediacontrol-python"
[EMAIL PROTECTED]@	srcdir="$(srcdir)" top_builddir="$(top_builddir)" $(PYTHON) "$(srcdir)/setup.py" build $(COMPILERARG) "--build-base=$(top_builddir)/bindings/mediacontrol-python" "--build-temp=$(top_builddir)/bindings/mediacontrol-python"
+ 
+ # FIXME: python setup.py install does not have any option to install from a different build directory
+ # so this will not work in a separate builddir
+ @[EMAIL PROTECTED]:
[EMAIL PROTECTED]@	python $(srcdir)/setup.py install
[EMAIL PROTECTED]@	$(PYTHON) $(srcdir)/setup.py install --root $(DESTDIR)
+ 
+ @[EMAIL PROTECTED]:
+ @BUILD_PYTHON_TRUE@	$(RM) -rf build
diff -Nru vlc-0.8.6.c/debian/patches/series vlc-0.8.6.c+python/debian/patches/series
--- vlc-0.8.6.c/debian/patches/series	2008-02-12 18:22:14.000000000 +0100
+++ vlc-0.8.6.c+python/debian/patches/series	2008-02-01 22:53:29.000000000 +0100
@@ -7,6 +7,7 @@
 104_notify.diff
 200_osdmenu_paths.diff
 300_manpage_syntax.diff
+400_python_fedora.diff
 sec-httpd_formatstring.diff
 sec-vlcopt_support.diff
 sec-rtsp_remote_dos.diff
diff -Nru vlc-0.8.6.c/debian/python-vlc.install vlc-0.8.6.c+python/debian/python-vlc.install
--- vlc-0.8.6.c/debian/python-vlc.install	1970-01-01 01:00:00.000000000 +0100
+++ vlc-0.8.6.c+python/debian/python-vlc.install	2008-02-02 02:32:34.000000000 +0100
@@ -0,0 +1,2 @@
+usr/lib/python*
+usr/bin/vlcwrapper.py usr/share/doc/python-vlc/examples
diff -Nru vlc-0.8.6.c/debian/rules vlc-0.8.6.c+python/debian/rules
--- vlc-0.8.6.c/debian/rules	2008-02-12 18:22:14.000000000 +0100
+++ vlc-0.8.6.c+python/debian/rules	2008-02-02 02:54:40.000000000 +0100
@@ -4,6 +4,8 @@
 DEB_BUILD_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+PYDEF=$(shell pyversions -d)
+PYVERS=$(shell pyversions -r)
 
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 confflags := --build=$(DEB_BUILD_GNU_TYPE)
@@ -74,6 +76,7 @@
 	--enable-notify \
 	--enable-faad \
 	--enable-mediacontrol-bindings \
+	--enable-mediacontrol-python-bindings \
 	--disable-x264 \
 	$(NULL)
 
@@ -108,6 +111,11 @@
 	cp src/.libs/libvlc.a src/libvlc.a
 	./configure --mandir=$${prefix}/share/man $(confflags)
 	$(MAKE)
+	for PYTHON in $(PYVERS); do \
+		if test $$PYTHON != $(PYDEF) ; then \
+			$(MAKE) -C bindings/mediacontrol-python all PYTHON=$$PYTHON ; \
+		fi ; \
+	done
 ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 	# Check which plugins were built and whether they load properly.
@@ -126,6 +134,11 @@
 	rm -f build-stamp
 	# Clean VLC
 	[ ! -f Makefile ] || $(MAKE) distclean
+	[ ! -f Makefile ] || for PYTHON in $(PYVERS); do \
+		if test $$PYTHON != $(PYDEF) ; then \
+			$(MAKE) -C bindings/mediacontrol-python clean PYTHON=$$PYTHON ; \
+		fi ; \
+	done
 	rm -f src/libvlc.a
 	# Clean zsh completion stuff
 	rm -f extras/zsh
@@ -144,6 +157,13 @@
 	dh_clean -k
 	dh_installdirs
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/
+	for PYTHON in $(PYVERS); do \
+		if test $$PYTHON != $(PYDEF) ; then \
+			$(MAKE) -C bindings/mediacontrol-python install \
+				DESTDIR=$(CURDIR)/debian/tmp/ \
+				PYTHON=$$PYTHON ; \
+		fi ; \
+	done
 	cp src/libvlc.a debian/tmp/usr/lib
 	# Clean up libtool crap
 	find debian/tmp -name '*.la' -exec rm '{}' ';'

Reply via email to