[packages/mp1e] - rediffed patch, refreshed spec; added gcc patch to fix gcc>3 build errors

qboosh qboosh at pld-linux.org
Thu Jul 20 21:51:18 CEST 2023


commit f9caf9eced2486e668781b907eded1a66f046ae8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jul 20 21:21:41 2023 +0200

    - rediffed patch, refreshed spec; added gcc patch to fix gcc>3 build errors

 mp1e-common.patch |   9 ++-
 mp1e-gcc.patch    | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mp1e.spec         |  32 +++++++----
 3 files changed, 191 insertions(+), 17 deletions(-)
---
diff --git a/mp1e.spec b/mp1e.spec
index d34ea78..b81b97e 100644
--- a/mp1e.spec
+++ b/mp1e.spec
@@ -1,6 +1,7 @@
 #
 # Conditional build:
-%bcond_without	alsa	# without ALSA support
+%bcond_without	alsa		# ALSA support
+%bcond_without	static_libs	# static library
 #
 Summary:	MP1E - Real Time Software MPEG-1 Encoder
 Summary(pl.UTF-8):	MP1E - koder MPEG-1 Real Time Software
@@ -9,10 +10,12 @@ Version:	1.9.4
 Release:	1
 License:	GPL v2
 Group:		X11/Applications/Multimedia
-Source0:	http://dl.sourceforge.net/zapping/%{name}-%{version}.tar.bz2
+#Source0Download: https://sourceforge.net/projects/zapping/files/OldFiles/
+Source0:	https://downloads.sourceforge.net/zapping/%{name}-%{version}.tar.bz2
 # Source0-md5:	4dad97af4db5d4ba61c3a2aec5ebd932
 Patch0:		%{name}-common.patch
-URL:		http://zapping.sourceforge.net/
+Patch1:		%{name}-gcc.patch
+URL:		https://zapping.sourceforge.net/Zapping/index.html
 %{?with_alsa:BuildRequires:	alsa-lib-devel >= 0.9.0}
 BuildRequires:	audiofile-devel
 BuildRequires:	autoconf
@@ -74,9 +77,10 @@ Statyczna biblioteka MP1E.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
-rm -f macros/{alsa,as}.m4
-%if !%{with alsa}
+%{__rm} macros/{alsa,as}.m4
+%if %{without alsa}
 echo 'AC_DEFUN([AM_PATH_ALSA], [$3])' > macros/alsa.m4
 %endif
 
@@ -87,7 +91,8 @@ echo 'AC_DEFUN([AM_PATH_ALSA], [$3])' > macros/alsa.m4
 %{__autoheader}
 %{__automake}
 %configure \
-	--enable-shared
+	--enable-shared \
+	%{!?with_static_libs:--disable-static}
 %{__make}
 
 %install
@@ -104,19 +109,22 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
+%attr(755,root,root) %{_bindir}/mp1e
+%{_mandir}/man1/mp1e.1*
 
 %files libs
 %defattr(644,root,root,755)
 %doc AUTHORS BUGS ChangeLog README
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+%attr(755,root,root) %{_libdir}/libmp1e_common.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libmp1e_common.so.0
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
+%attr(755,root,root) %{_libdir}/libmp1e_common.so
+%{_libdir}/libmp1e_common.la
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/lib*.a
+%{_libdir}/libmp1e_common.a
+%endif
diff --git a/mp1e-common.patch b/mp1e-common.patch
index 33881ac..63f7553 100644
--- a/mp1e-common.patch
+++ b/mp1e-common.patch
@@ -27,11 +27,10 @@ diff -Nur mp1e-1.9.3.orig/configure.in mp1e-1.9.3/configure.in
  
  dnl
  dnl V4l/2 always compiled in
-diff -Nur mp1e-1.9.3.orig/Makefile.am mp1e-1.9.3/Makefile.am
---- mp1e-1.9.3.orig/Makefile.am	2002-12-14 01:43:43.000000000 +0100
-+++ mp1e-1.9.3/Makefile.am	2003-11-10 23:16:18.116203496 +0100
-@@ -29,14 +29,22 @@
- dist-hook:
+--- mp1e-1.9.4.orig/Makefile.am	2002-12-14 01:43:43.000000000 +0100
++++ mp1e-1.9.4/Makefile.am	2003-11-10 23:16:18.116203496 +0100
+@@ -31,14 +31,22 @@ dist-hook:
+ 		rm -rf $(distdir)/$$file; done
  
  bin_PROGRAMS = mp1e
 +lib_LTLIBRARIES = libmp1e_common.la
diff --git a/mp1e-gcc.patch b/mp1e-gcc.patch
new file mode 100644
index 0000000..880a14f
--- /dev/null
+++ b/mp1e-gcc.patch
@@ -0,0 +1,167 @@
+--- mp1e-1.9.4/common/mmx.h.orig	2004-04-08 20:21:36.000000000 +0200
++++ mp1e-1.9.4/common/mmx.h	2023-07-20 16:50:32.264603637 +0200
+@@ -59,8 +59,8 @@ typedef	union {
+ 
+ extern int cpu_detection(void);
+ 
+-#if __GNUC__ == 3
+-# if __GNUC_MINOR__ > 3
++#if __GNUC__ >= 3
++# if (__GNUC__ > 3) || (__GNUC_MINOR__ > 3)
+ #  warning Compilation with your version of gcc is untested,
+ #  warning may fail or create incorrect code.
+ # endif
+--- mp1e-1.9.4/video/mpeg1.c.orig	2003-11-13 06:02:12.000000000 +0100
++++ mp1e-1.9.4/video/mpeg1.c	2023-07-20 20:14:50.401528942 +0200
+@@ -2814,13 +2814,13 @@ option_set(rte_codec *codec, const char
+ 	mpeg1_context *mpeg1 = PARENT(codec, mpeg1_context, codec);
+ 	rte_context *context = codec->context;
+ 
+-	if (0) {
++#if 0
+ 		static char *option_print(rte_codec *, const char *, va_list);
+ 		char *str = option_print(codec, keyword, args);
+ 
+ 		printv(0, "mpeg1/option_set(%p, %s, %s)\n", mpeg1, keyword, str);
+ 		free(str);
+-	}
++#endif
+ 
+ 	/* Preview runtime changes here */
+ 
+--- mp1e-1.9.4/common/bstream.h.orig	2002-09-12 14:25:13.000000000 +0200
++++ mp1e-1.9.4/common/bstream.h	2023-07-20 20:16:16.737727885 +0200
+@@ -60,7 +60,7 @@ do {									\
+ 	if (__builtin_constant_p(n))					\
+ 		__asm__ __volatile__ (					\
+ 			"\tpsllq %0,%%mm0;\n"				\
+-			:: "im" ((n)) : "cc" FPU_REGS);			\
++			:: "i" ((n)) : "cc" FPU_REGS);			\
+ 			/* never m but suppress warning */		\
+ 	else								\
+ 		__asm__ __volatile__ (					\
+@@ -68,11 +68,6 @@ do {									\
+ 			"\tpsllq %%mm2,%%mm0;\n"			\
+ 			:: "rm" ((unsigned int)(n)) : "cc" FPU_REGS);	\
+ 									\
+-	if (0&&__builtin_constant_p(v))					\
+-		__asm__ __volatile__ ("\tpor %0,%%mm0;\n"		\
+-			:: "m" ((unsigned long long)(v))		\
+-			: "cc" FPU_REGS);				\
+-	else								\
+ 		__asm__ __volatile__ (					\
+ 			"\tmovd %0,%%mm1;\n"				\
+ 			"\tpor %%mm1,%%mm0;\n"				\
+--- mp1e-1.9.4/video/motion.c.orig	2002-10-02 22:50:42.000000000 +0200
++++ mp1e-1.9.4/video/motion.c	2023-07-20 20:52:04.922756835 +0200
+@@ -3900,7 +3900,7 @@ predict_bidirectional_motion(mpeg1_conte
+  *  mblock[1] = org - old_ref;
+  *  mblock[3] = old_ref; 	// for reconstruction by idct_inter
+  */
+-unsigned int
++unsigned int reg(1)
+ predict_forward_packed(unsigned char *from)
+ {
+ 	int i, n, s2 = 0;
+@@ -3919,7 +3919,7 @@ predict_forward_packed(unsigned char *fr
+ 	return s2 * 256;
+ }
+ 
+-unsigned int
++unsigned int reg(1)
+ predict_forward_planar(unsigned char *from)
+ {
+ 	int i, j, n, s2 = 0;
+@@ -3961,7 +3961,7 @@ predict_forward_planar(unsigned char *fr
+  *
+  *  mblock[1] = org - new_ref;
+  */
+-unsigned int
++unsigned int reg(1)
+ predict_backward_packed(unsigned char *from)
+ {
+ 	int i, n, s2 = 0;
+--- mp1e-1.9.4/audio/mp2.c.orig	2003-01-03 05:54:31.000000000 +0100
++++ mp1e-1.9.4/audio/mp2.c	2023-07-20 21:05:54.444929594 +0200
+@@ -160,7 +160,7 @@ fetch_samples(mp2_context *mp2, int chan
+ 	/* const */ int spf = SAMPLES_PER_FRAME * cs;
+ 	/* const */ int la = (512 - 32) * cs;
+ 	buffer *buf = mp2->ibuf;
+-	unsigned char *o;
++	uint32_t *o;
+ 	int todo;
+ 
+ 	if (mp1e_sync_break(&mp2->codec.sstr, buf->time
+@@ -171,7 +171,7 @@ fetch_samples(mp2_context *mp2, int chan
+ 
+ 	memcpy(mp2->wrap, mp2->wrap + spf, la);
+ 
+-	o = mp2->wrap + la;
++	o = (uint32_t *)(mp2->wrap + la);
+ 
+ 	if (mp2->format_scale)
+ 		for (todo = 0; todo < SAMPLES_PER_FRAME; todo++) {
+@@ -188,9 +188,9 @@ fetch_samples(mp2_context *mp2, int chan
+ 				temp = ((uint16_t *) buf->data)[mp2->i16 >> 16] << 8;	/* 00RRLL00 or 00LLRR00 */
+ 				temp = ((temp << 8) | temp) & 0xFF00FF00;		/* RRxxLLxx or LLxxRRxx */
+ 
+-				*((uint32_t *) o)++ = mp2->format_sign ^ temp;
++				*o++ = mp2->format_sign ^ temp;
+ 			} else
+-				*((uint16_t *) o)++ = mp2->format_sign
++				*o++ = mp2->format_sign
+ 					^ (((uint8_t *) buf->data)[mp2->i16 >> 16] << 8);
+ 
+ 			mp2->i16 += mp2->incr;
+@@ -205,10 +205,10 @@ fetch_samples(mp2_context *mp2, int chan
+ 			/* 16 -> 16 bit, same endian */
+ 
+ 			if (channels > 1)
+-				*((uint32_t *) o)++ = mp2->format_sign
++				*o++ = mp2->format_sign
+ 					^ ((uint32_t *) buf->data)[mp2->i16 >> 16];
+ 			else
+-				*((uint16_t *) o)++ = mp2->format_sign
++				*o++ = mp2->format_sign
+ 					^ ((uint16_t *) buf->data)[mp2->i16 >> 16];
+ 
+ 			mp2->i16 += mp2->incr;
+@@ -511,8 +511,11 @@ encode(mp2_context *mp2, unsigned char *
+ 
+ 	bflush(&mp2->out);
+ 
+-	while (((char *) mp2->out.p - (char *) mp2->out.p1) < bpf)
+-		*((unsigned int *)(mp2->out.p))++ = 0;
++	while (((char *) mp2->out.p - (char *) mp2->out.p1) < bpf) {
++		uint32_t *p = (void*)mp2->out.p;
++		*p++ = 0;
++		mp2->out.p = (void*)p;
++	}
+ }
+ 
+ #define C (&mp2->codec.codec)
+@@ -622,7 +625,8 @@ mp1e_mp2(void *codec)
+ 	printv(3, "Audio compression thread\n");
+ 
+ 	/* Round nearest, double prec, no exceptions */
+-	__asm__ __volatile__ ("fldcw %0" :: "m" (0x027F));
++	uint16_t cw = 0x027F;
++	__asm__ __volatile__ ("fldcw %0" :: "m" (cw));
+ 
+ 	assert(mp2->codec.codec.state == RTE_STATE_RUNNING);
+ 
+--- mp1e-1.9.4/options.c.orig	2003-01-03 06:37:33.000000000 +0100
++++ mp1e-1.9.4/options.c	2023-07-20 21:09:41.427033260 +0200
+@@ -175,10 +175,11 @@ long_options[] = {
+ 	{ NULL }
+ };
+ 
++static rte_bool parse_option(int c);
++
+ static void
+ options_from_file(char *name, rte_bool fail)
+ {
+-	static rte_bool parse_option(int c);
+ 	static int recursion = 0;
+ 	char *s, *p, buffer[300];
+ 	FILE *fi;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mp1e.git/commitdiff/44cb69284ebc4ba58a572d16550b2521d0467161



More information about the pld-cvs-commit mailing list