media-video/mpeg2vidcodec: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Fri, 13 Dec 2019 13:20:52 +0000 (14:20 +0100)
committerDavid Seifert <soap@gentoo.org>
Fri, 13 Dec 2019 13:20:52 +0000 (14:20 +0100)
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: David Seifert <soap@gentoo.org>
media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-Wimplicit-function-declaration.patch [new file with mode: 0644]
media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-fix-build-system.patch [new file with mode: 0644]
media-video/mpeg2vidcodec/mpeg2vidcodec-12-r1.ebuild

diff --git a/media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-Wimplicit-function-declaration.patch b/media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-Wimplicit-function-declaration.patch
new file mode 100644 (file)
index 0000000..7f618a2
--- /dev/null
@@ -0,0 +1,54 @@
+--- a/src/mpeg2dec/getbits.c
++++ b/src/mpeg2dec/getbits.c
+@@ -34,6 +34,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <unistd.h>
+ #include "config.h"
+ #include "global.h"
+--- a/src/mpeg2dec/mpeg2dec.c
++++ b/src/mpeg2dec/mpeg2dec.c
+@@ -32,6 +32,8 @@
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <fcntl.h>
++#include <sys/types.h>
++#include <unistd.h>
+ #define GLOBAL
+ #include "config.h"
+--- a/src/mpeg2dec/spatscal.c
++++ b/src/mpeg2dec/spatscal.c
+@@ -1,5 +1,7 @@
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "config.h"
+ #include "global.h"
+--- a/src/mpeg2dec/store.c
++++ b/src/mpeg2dec/store.c
+@@ -28,8 +28,10 @@
+  */
+ #include <stdio.h>
++#include <string.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "config.h"
+ #include "global.h"
+--- a/src/mpeg2dec/subspic.c
++++ b/src/mpeg2dec/subspic.c
+@@ -31,6 +31,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "config.h"
+ #include "global.h"
diff --git a/media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-fix-build-system.patch b/media-video/mpeg2vidcodec/files/mpeg2vidcodec-12-fix-build-system.patch
new file mode 100644 (file)
index 0000000..e278b3a
--- /dev/null
@@ -0,0 +1,78 @@
+--- a/Makefile
++++ b/Makefile
+@@ -53,26 +53,23 @@
+ #
+ # GNU gcc
+ #
+-CC = gcc
+-CFLAGS = -O2
++CFLAGS += -Wall
+ all: mpeg2decode mpeg2encode
+ mpeg2decode:
+-      cd src/mpeg2dec; make 'CC=$(CC)' \
+-      'CFLAGS=$(CFLAGS) $(USE_DISP) $(USE_SHMEM) $(INCLUDEDIR)' \
+-      'LIBS=$(LIBS)' 'LIBRARYDIR=$(LIBRARYDIR)'
++      cd src/mpeg2dec && $(MAKE)
+ mpeg2encode:
+-      cd src/mpeg2enc; make 'CC=$(CC)' 'CFLAGS=$(CFLAGS)'
++      cd src/mpeg2enc && $(MAKE)
+ pc:
+-      cd src/mpeg2dec; make pc 'CC=$(CC)' 'CFLAGS=$(CFLAGS)'
+-      cd src/mpeg2enc; make pc 'CC=$(CC)' 'CFLAGS=$(CFLAGS)'
++      cd src/mpeg2dec && $(MAKE) pc
++      cd src/mpeg2enc && $(MAKE) pc
+ clean:
+-      cd src/mpeg2dec; make clean
+-      cd src/mpeg2enc; make clean
++      cd src/mpeg2dec && $(MAKE) clean
++      cd src/mpeg2enc && $(MAKE) clean
+ test:
+       cd verify; ./verify
+--- a/src/mpeg2dec/Makefile
++++ b/src/mpeg2dec/Makefile
+@@ -60,8 +60,7 @@
+ #
+ # GNU gcc
+ #
+-CC = gcc
+-CFLAGS = -O2 $(USE_DISP) $(USE_SHMEM) $(INCLUDEDIR) $(TRACE) $(VERBOSE) $(VERIFY) $(WARNINGS)
++CFLAGS += -Wall
+ OBJ = mpeg2dec.o getpic.o motion.o getvlc.o gethdr.o getblk.o getbits.o store.o recon.o spatscal.o idct.o idctref.o display.o systems.o subspic.o verify.o
+@@ -76,7 +75,7 @@
+       coff2exe mpeg2dec
+ mpeg2decode: $(OBJ)
+-      $(CC) $(CFLAGS) $(LIBRARYDIR) -o mpeg2decode $(OBJ) -lm $(LIBS)
++      $(CC) $(CFLAGS) $(LDFLAGS) $(LIBRARYDIR) -o mpeg2decode $(OBJ) -lm $(LIBS)
+ display.o : display.c config.h global.h mpeg2dec.h 
+ getbits.o : getbits.c config.h global.h mpeg2dec.h 
+--- a/src/mpeg2enc/Makefile
++++ b/src/mpeg2enc/Makefile
+@@ -32,8 +32,7 @@
+ #
+ # GNU gcc
+ #
+-CC = gcc
+-CFLAGS = -O2 -Wall
++CFLAGS += -Wall
+ OBJ = mpeg2enc.o conform.o putseq.o putpic.o puthdr.o putmpg.o putvlc.o putbits.o motion.o predict.o readpic.o writepic.o transfrm.o fdctref.o idct.o quantize.o ratectl.o stats.o
+@@ -48,7 +47,7 @@
+       coff2exe mpeg2enc
+ mpeg2encode: $(OBJ)
+-      $(CC) $(CFLAGS) -o mpeg2encode $(OBJ) -lm
++      $(CC) $(CFLAGS) $(LDFLAGS) -o mpeg2encode $(OBJ) -lm
+ conform.o : conform.c config.h global.h mpeg2enc.h 
+ fdctref.o : fdctref.c config.h 
index d3769dd81efc9d311662074aa9cd3a19d0d088a1..33d9cdb700f6a24e079ad12dffcb2e267f04bc32 100644 (file)
@@ -1,11 +1,12 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=7
 
 inherit toolchain-funcs
 
 MY_P="${PN}_v${PV}"
+
 DESCRIPTION="MPEG Library"
 HOMEPAGE="http://www.mpeg.org/"
 SRC_URI="http://www.mpeg.org/pub_ftp/mpeg/mssg/${MY_P}.tar.gz"
@@ -13,23 +14,20 @@ SRC_URI="http://www.mpeg.org/pub_ftp/mpeg/mssg/${MY_P}.tar.gz"
 LICENSE="mpeg2enc"
 SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
-IUSE=""
 RESTRICT="mirror bindist" #465088
 
-S=${WORKDIR}/mpeg2
-
-src_prepare() {
-       sed -i -e 's:make:$(MAKE):' Makefile || die
+S="${WORKDIR}/mpeg2"
 
-       sed -i -e 's:$(CC) $(CFLAGS):\0 $(LDFLAGS):' \
-               src/mpeg2enc/Makefile src/mpeg2dec/Makefile || die
-}
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-build-system.patch
+       "${FILESDIR}"/${P}-Wimplicit-function-declaration.patch
+)
 
-src_compile() {
-       emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+src_configure() {
+       tc-export CC
 }
 
 src_install() {
        dobin src/mpeg2dec/mpeg2decode src/mpeg2enc/mpeg2encode
-       dodoc README doc/*
+       dodoc -r README doc/.
 }