From d82fdd94ad99147df08477e85d6b7893fb58620f1b62cc5c322892c1f2bb5344 Mon Sep 17 00:00:00 2001 From: Dave Plater Date: Mon, 1 Aug 2016 13:17:28 +0000 Subject: [PATCH] Accepting request 416395 from home:plater Fix build in 42.2 and other changes OBS-URL: https://build.opensuse.org/request/show/416395 OBS-URL: https://build.opensuse.org/package/show/multimedia:xine/xine-lib?expand=0&rev=90 --- precheckin_cripple_tarball.sh | 8 +- xine-lib-1.2.6-crippled.tar.xz | 4 +- xine-lib-crippled-ffmpeg3.0.patch | 44 +++++++++++ xine-lib-without-ffmpeg.patch | 43 ++++++++--- xine-lib.changes | 11 +++ xine-lib.spec | 123 +++++++++++++++--------------- 6 files changed, 158 insertions(+), 75 deletions(-) create mode 100644 xine-lib-crippled-ffmpeg3.0.patch diff --git a/precheckin_cripple_tarball.sh b/precheckin_cripple_tarball.sh index 4a7f05a..0af748a 100644 --- a/precheckin_cripple_tarball.sh +++ b/precheckin_cripple_tarball.sh @@ -55,10 +55,10 @@ pushd $tmp/$tarbase >/dev/null || exit 1 # # Cripple source # - +# combined/ffmpeg echo 1>&2 "Crippling..." -c_subdirs="dxr3 liba52 libdts libfaad libffmpeg libmad libmpeg2 libspucc libspudec libspudvb libw32dll input/vcd combined/ffmpeg" +c_subdirs="dxr3 liba52 libdts libfaad libffmpeg libmad libmpeg2 libspucc libspudec libspudvb libw32dll input/vcd" c_demuxers="xineplug_dmx_asf.la asfheader.h asfheader.c demux_asf.c xineplug_dmx_mpeg.la demux_mpeg.c xineplug_dmx_mpeg_block.la demux_mpeg_block.c xineplug_dmx_mpeg_ts.la demux_ts.c xineplug_dmx_mpeg_elem.la demux_elem.c xineplug_dmx_mpeg_pes.la demux_mpeg_pes.c xineplug_dmx_yuv4mpeg2.la demux_yuv4mpeg2.c" c_input="xineplug_inp_mms.la input_mms.c mms.c mmsh.c ../demuxers/asfheader.c mms.h mmsh.h xineplug_inp_vcdo.la input_vcd.c vcd" c_libxineadec="xineplug_decode_gsm610.la xineplug_decode_nsf.la gsm610.c nsf.c gsm610 nosefart" @@ -73,8 +73,8 @@ do_nukeentry src/input/Makefile.am "$c_input" do_remove src/input "$c_input" do_nukeentry src/audio_dec/Makefile.am "$c_audiodec" do_remove src/audio_dec "$c_audiodec" -do_nukeentry src/combined/Makefile.am "ffmpeg" -do_remove src/combined "ffmpeg" +#do_nukeentry src/combined/Makefile.am "ffmpeg" +#do_remove src/combined "ffmpeg" do_nukeentry src/post/planar/Makefile.am "pp\.c \S*/libpostproc/libpostprocess\.la" do_nukeline src/post/planar/planar.c "pp_init_plugin pp_special_info" do_remove src/post/planar "pp.c" diff --git a/xine-lib-1.2.6-crippled.tar.xz b/xine-lib-1.2.6-crippled.tar.xz index 106c5ab..c66fc41 100644 --- a/xine-lib-1.2.6-crippled.tar.xz +++ b/xine-lib-1.2.6-crippled.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eac3308b13f68bfdadcf85af5e104450b84fb346d5af95e29fa35c8339ff422e -size 4749220 +oid sha256:49e856b05f76d9f09bdb8434a59b197046d64cd4ce168079211946ff657d282a +size 4883872 diff --git a/xine-lib-crippled-ffmpeg3.0.patch b/xine-lib-crippled-ffmpeg3.0.patch new file mode 100644 index 0000000..8a8c5d5 --- /dev/null +++ b/xine-lib-crippled-ffmpeg3.0.patch @@ -0,0 +1,44 @@ +Index: src/combined/ffmpeg/ff_audio_decoder.c +=================================================================== +--- src/combined/ffmpeg/ff_audio_decoder.c.orig ++++ src/combined/ffmpeg/ff_audio_decoder.c +@@ -590,7 +590,7 @@ static int ff_audio_decode (ff_audio_dec + int got_frame; + float gain = this->class->gain; + if (!this->av_frame) +- this->av_frame = avcodec_alloc_frame (); ++ this->av_frame = av_frame_alloc (); + + consumed = avcodec_decode_audio4 (this->context, this->av_frame, &got_frame, &avpkt); + if ((consumed >= 0) && got_frame) { +@@ -1071,7 +1071,7 @@ static void ff_audio_reset (audio_decode + /* try to reset the wma decoder */ + if( this->decoder_ok ) { + #if AVAUDIO > 3 +- avcodec_free_frame (&this->av_frame); ++ av_frame_free (&this->av_frame); + #endif + pthread_mutex_lock (&ffmpeg_lock); + avcodec_close (this->context); +@@ -1105,7 +1105,7 @@ static void ff_audio_dispose (audio_deco + + if( this->context && this->decoder_ok ) { + #if AVAUDIO > 3 +- avcodec_free_frame (&this->av_frame); ++ av_frame_free (&this->av_frame); + #endif + pthread_mutex_lock (&ffmpeg_lock); + avcodec_close (this->context); +Index: src/combined/ffmpeg/ff_video_decoder.c +=================================================================== +--- src/combined/ffmpeg/ff_video_decoder.c.orig ++++ src/combined/ffmpeg/ff_video_decoder.c +@@ -2523,7 +2523,7 @@ static video_decoder_t *ff_video_open_pl + this->stream = stream; + this->class = (ff_video_class_t *) class_gen; + +- this->av_frame = avcodec_alloc_frame(); ++ this->av_frame = av_frame_alloc(); + this->context = avcodec_alloc_context(); + this->context->opaque = this; + #if AVPALETTE == 1 diff --git a/xine-lib-without-ffmpeg.patch b/xine-lib-without-ffmpeg.patch index 9a20a50..6098b57 100644 --- a/xine-lib-without-ffmpeg.patch +++ b/xine-lib-without-ffmpeg.patch @@ -1,7 +1,8 @@ -diff -uNr xine-lib-1.2.1.orig/m4/decoders.m4 xine-lib-1.2.1/m4/decoders.m4 ---- xine-lib-1.2.1.orig/m4/decoders.m4 2012-02-04 01:41:43.000000000 +0100 -+++ xine-lib-1.2.1/m4/decoders.m4 2012-05-21 22:46:39.470861703 +0200 -@@ -85,9 +85,7 @@ +Index: m4/decoders.m4 +=================================================================== +--- m4/decoders.m4.orig ++++ m4/decoders.m4 +@@ -85,9 +85,7 @@ AC_DEFUN([XINE_DECODER_PLUGINS], [ AM_CONDITIONAL([WITH_EXTERNAL_FAAD], [test x"$have_external_faad" = x"yes"]) dnl ffmpeg external version required @@ -11,10 +12,11 @@ diff -uNr xine-lib-1.2.1.orig/m4/decoders.m4 xine-lib-1.2.1/m4/decoders.m4 AC_DEFINE([HAVE_FFMPEG], 1, [Define this if you have ffmpeg library]) dnl Check presence of ffmpeg/avutil.h to see if it's old or new -diff -uNr xine-lib-1.2.1.orig/src/audio_dec/Makefile.am xine-lib-1.2.1/src/audio_dec/Makefile.am ---- xine-lib-1.2.1.orig/src/audio_dec/Makefile.am 2012-02-04 01:41:43.000000000 +0100 -+++ xine-lib-1.2.1/src/audio_dec/Makefile.am 2012-05-22 20:37:48.863941984 +0200 -@@ -49,7 +49,6 @@ +Index: src/audio_dec/Makefile.am +=================================================================== +--- src/audio_dec/Makefile.am.orig ++++ src/audio_dec/Makefile.am +@@ -49,7 +49,6 @@ $(top_builddir)/contrib/gsm610/libgsm610 xineplug_LTLIBRARIES = \ xineplug_decode_gsm610.la \ xineplug_decode_lpcm.la \ @@ -22,7 +24,7 @@ diff -uNr xine-lib-1.2.1.orig/src/audio_dec/Makefile.am xine-lib-1.2.1/src/audio $(musepack_module) \ $(dts_module) \ $(mad_module) \ -@@ -87,7 +86,3 @@ +@@ -87,7 +86,3 @@ xineplug_decode_faad_la_SOURCES = xine_f xineplug_decode_faad_la_DEPENDENCIES = $(FAAD_DEPS) xineplug_decode_faad_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(FAAD_LIBS) -lm xineplug_decode_faad_la_CFLAGS = $(FAAD_CFLAGS) @@ -30,3 +32,26 @@ diff -uNr xine-lib-1.2.1.orig/src/audio_dec/Makefile.am xine-lib-1.2.1/src/audio -xineplug_decode_dvaudio_la_SOURCES = ff_dvaudio_decoder.c -xineplug_decode_dvaudio_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) -xineplug_decode_dvaudio_la_CPPFLAGS = $(AM_CPPFLAGS) $(FFMPEG_CFLAGS) +Index: src/combined/Makefile.am +=================================================================== +--- src/combined/Makefile.am.orig ++++ src/combined/Makefile.am +@@ -1,5 +1,5 @@ + include $(top_srcdir)/misc/Makefile.quiet +-SUBDIRS = ffmpeg ++#SUBDIRS = ffmpeg + + include $(top_builddir)/misc/Makefile.plugins + include $(top_srcdir)/misc/Makefile.common +Index: configure.ac +=================================================================== +--- configure.ac.orig ++++ configure.ac +@@ -1285,7 +1285,6 @@ src/Makefile + src/audio_out/Makefile + src/audio_dec/Makefile + src/combined/Makefile +-src/combined/ffmpeg/Makefile + src/demuxers/Makefile + + src/input/Makefile diff --git a/xine-lib.changes b/xine-lib.changes index 80d86e7..25c7678 100644 --- a/xine-lib.changes +++ b/xine-lib.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Aug 1 12:58:27 UTC 2016 - davejplater@gmail.com + +- Fixed build in Leap:42.2 by building with gcc5. +- Removed conditinals for old openSUSE versions from spec file. +- Modified pre checkin script to enable build with the ffmpeg libs + that are in the distribution. +- Added xine-lib-crippled-ffmpeg3.0.patch to enable leap and above + to build with ffmpeg3. +- Removed unused build flags. + ------------------------------------------------------------------- Sun Jul 24 15:48:08 UTC 2016 - olaf@aepfle.de diff --git a/xine-lib.spec b/xine-lib.spec index 2153ed2..1aba577 100644 --- a/xine-lib.spec +++ b/xine-lib.spec @@ -17,8 +17,8 @@ Name: xine-lib -# %bcond_with = default off -# %bcond_without = default on +# %%bcond_with = default off +# %%bcond_without = default on # # --with distributable -> don't build libxine2-codecs # --without distributable -> build libxine2-codecs @@ -27,6 +27,20 @@ Name: xine-lib %bcond_without distributable %bcond_with onlynondistributable %bcond_without pulseaudio +%if 0%{?is_opensuse} == 1 +%bcond_without gcc5 +%else +%bcond_with gcc5 +%endif +%if 0%{?suse_version} > 1320 || 0%{?is_opensuse} == 1 +%bcond_without ffmpeg +%else +%if %{with distributable} +%bcond_with ffmpeg +%else +%bcond_without ffmpeg +%endif +%endif %bcond_with sdl %bcond_with aalib %bcond_with esd @@ -35,6 +49,9 @@ Name: xine-lib %bcond_with directfb %bcond_without modplug # +%if %{with gcc5} +BuildRequires: gcc5 +%endif BuildRequires: ImageMagick-devel BuildRequires: Mesa-devel BuildRequires: alsa-devel @@ -58,31 +75,24 @@ BuildRequires: speex-devel BuildRequires: update-desktop-files BuildRequires: vcdimager-devel BuildRequires: xorg-x11-devel -%if 0%{suse_version} >= 1210 BuildRequires: libv4l-devel >= 0.8.4 -%else -%if 0%{suse_version} >= 1110 -BuildRequires: libv4l-devel -%endif -%endif -%if 0%{suse_version} >= 1030 BuildRequires: lirc-devel +%if %{with ffmpeg} +BuildRequires: pkgconfig(libbluray) >= 0.2.1 +BuildRequires: pkgconfig(libavcodec) +BuildRequires: pkgconfig(libavutil) +BuildRequires: pkgconfig(libpostproc) +BuildRequires: pkgconfig(libavformat) %else -BuildRequires: lirc +BuildRequires: libavutil-devel %endif %if !%{with distributable} BuildRequires: libfaad-devel -BuildRequires: pkgconfig(libavcodec) -BuildRequires: pkgconfig(libavutil) -BuildRequires: pkgconfig(libbluray) >= 0.2.1 BuildRequires: pkgconfig(libdts) -BuildRequires: pkgconfig(libpostproc) BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(libva-glx) BuildRequires: pkgconfig(mad) BuildRequires: pkgconfig(vdpau) -%else -BuildRequires: libavutil-devel %endif %if %{with pulseaudio} BuildRequires: libpulse-devel @@ -104,11 +114,7 @@ BuildRequires: gnome-vfs2-devel BuildRequires: libjack-devel %endif %if %{with directfb} -%if %suse_version >= 1020 BuildRequires: DirectFB-devel -%else -BuildRequires: DirectFB -%endif %endif %if %{with modplug} BuildRequires: libmodplug-devel @@ -132,11 +138,13 @@ Source99: precheckin_cripple_tarball.sh Patch0: xine-lib-libdvdread_udf.diff Patch1: xine-lib-v4l-2.6.38.patch +# PATCH allow ffmpeg in openSUSE versions that have ffmpeg and still use the crippled tar ball to build with ffmpeg3. +Patch7: xine-lib-crippled-ffmpeg3.0.patch Patch2: xine-lib-without-ffmpeg.patch +Patch5: xine-lib-ffmpeg3.0.patch Patch3: fix-non-x86-build.diff # Add theora FOURCC to libxine I found an avi container that xine wouldn't play. Patch4: xine-lib-theora.patch -Patch5: xine-lib-ffmpeg3.0.patch # PATCH-FIX-UPSTREAM xine-lib-link-xcb.patch https://bugs.xine-project.org/show_bug.cgi?id=573 dimstar@opensuse.org -- Look for xcb, not xcb-shape Patch6: xine-lib-link-xcb.patch @@ -485,6 +493,7 @@ Autoren: %endif %prep +rm -rf contrib %if %{with distributable} && %{with onlynondistributable} %error need --without distributable for --with onlynondistributable %endif @@ -493,7 +502,9 @@ cat <= 1210 %patch1 -%endif -%if %{with distributable} -%patch2 -p1 +%if %{with distributable} && %{with ffmpeg} +%patch7 %else -%patch5 -p0 +%if !%{with ffmpeg} +%patch2 +rm -rf src/combined/ffmpeg configure +%else +%patch5 +%endif %endif %ifnarch %ix86 x86_64 %patch3 %endif %patch4 %patch6 -p1 + rm -f m4/libtool15.m4 sed -i -e 's|/tmp/vdr-xine|/var/lib/vdr-xine|g' src/vdr/input_vdr.c %build export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -fno-force-addr `pkg-config --cflags smbclient`" export CCASFLAGS=-Wa,--noexecstack -%if 0%{suse_version} < 1011 +# Leap:42.2 won't build with gcc48 +%if %{with gcc5} +export CC="gcc-5" +export CPP="cpp-5" +%endif echo 'AC_DEFUN([AC_REQUIRE_AUX_FILE])dnl' >> acinclude.m4 -%endif -%if 0%{?suse_version} < 1020 - # hack for sles10 - rm m4/gettext.m4 m4/intl.m4 - sed -i -e '/AM_GNU_GETTEXT_VERSION/s/0\.16\.1/0.14/' configure.ac -%endif +# # hack for sles10 +## rm m4/gettext.m4 m4/intl.m4 +## sed -i -e '/AM_GNU_GETTEXT_VERSION/s/0\.16\.1/0.14/' configure.ac + if [ ! -f configure ]; then NO_CONFIGURE=1 ./autogen.sh fi AUTOPOINT=true autoreconf -fi -./configure --prefix=/usr \ +%configure --prefix=/usr \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ -%if 0%{suse_version} > 1010 + --disable-rpath \ --docdir=%{_defaultdocdir}/xine \ -%else - docdir=%{_defaultdocdir}/xine \ -%endif - --enable-fpic \ --enable-antialiasing \ --with-libflac \ --with-freetype \ @@ -556,11 +569,9 @@ AUTOPOINT=true autoreconf -fi %if !%{with sdl} --without-sdl \ %endif -%if !%{with distributable} - --with-external-ffmpeg \ - --enable-bluray \ -%else +%if %{with distributable} --disable-faad \ + --disable-mad \ --disable-a52dec \ --disable-vdpau \ --disable-dxr3 \ @@ -568,23 +579,16 @@ AUTOPOINT=true autoreconf -fi %ifarch %{ix86} --with-w32-path=/usr/lib/win32 \ %endif - --with-install-plugins-helper=${_prefix}/lib/opensuse-codecs-installer -%if 0%{?suse_version} < 1110 -# wtf libtool shit. $echo is unset. I guess there is a way to fix -# this properly, please tell me! -echo=echo \ -%endif -make %{?jobs:-j%{jobs}} + --with-pic +# --with-install-plugins-helper=${_prefix}/lib/opensuse-codecs-installer +echo $CFLAGS +make %{?jobs:-j%{jobs}} V=1 %install -%if 0%{?suse_version} < 1110 -# same libtool problem here -echo=echo \ -%endif make install DESTDIR=%{buildroot} LIB="%{buildroot}%{_libdir}/xine/plugins/%{abiversion}" # install documentation -#install -m 0644 %{SOURCE1} COPYING AUTHORS %{buildroot}%{_defaultdocdir}/xine/ +#install -m 0644 %%{SOURCE1} COPYING AUTHORS %%{buildroot}%%{_defaultdocdir}/xine/ # remove usless READMEs rm %{buildroot}%{_defaultdocdir}/xine/README.{irix,solaris,WIN32} # remove .la files, they are evil @@ -607,10 +611,8 @@ xineplug_vo_out_opengl xineplug_vo_out_opengl2 xineplug_vo_out_xshm xineplug_vo_out_xv -%if 0%{suse_version} > 1020 xineplug_vo_out_xcbshm xineplug_vo_out_xcbxv -%endif xineplug_vo_out_raw %if !%{with distributable} xineplug_vo_out_vdpau @@ -813,7 +815,7 @@ rm -rf %{buildroot} %dir /usr/share/xine-lib %{_libdir}/libxine.so.* %doc %{_mandir}/man1/xine-list-*.gz -#%doc %{_mandir}/man5/xine.* +#%%doc %%{_mandir}/man5/xine.* %{_defaultdocdir}/xine %dir %{_libdir}/xine/plugins/%{abiversion}/post %{_libdir}/xine/plugins/%{abiversion}/mime.types @@ -877,7 +879,8 @@ rm -rf %{buildroot} /usr/share/aclocal/xine.m4 /usr/include/xine /usr/include/xine.h -%endif # onlynondistributable +%endif +# onlynondistributable %if !%{with distributable}