Subject: pkg/15978: some fix for graphics/ffmpeg
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rxg@ms25.url.com.tw>
List: netbsd-bugs
Date: 03/20/2002 15:10:37
>Number: 15978
>Category: pkg
>Synopsis: some fix for graphics/ffmpeg
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Mar 19 23:13:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Rui-Xiang Guo
>Release: NetBSD 1.5ZC
>Organization:
>Environment:
System: NetBSD rxgpc.sparqnet.net 1.5ZC NetBSD 1.5ZC (HIVE) #0: Wed Mar 20 12:58:08 CST 2002 rxg@rxgpc.sparqnet.net:/usr/src/sys/arch/i386/compile/HIVE i386
Architecture: i386
Machine: i386
>Description:
some fix for graphics/ffmpeg
>How-To-Repeat:
We need to use LIBTOOL and install libraries and ffserver.conf
>Fix:
1. please fix the Makefile with this:
--- /usr/pkgsrc/graphics/ffmpeg/Makefile Tue Mar 19 20:39:27 2002
+++ Makefile Wed Mar 20 14:43:14 2002
@@ -12,13 +12,35 @@
HAS_CONFIGURE= YES
USE_GMAKE= YES
+USE_LIBTOOL= YES
+MAKE_FLAGS+= LOCALBASE="${LOCALBASE}"
+.if !exists(/usr/include/getopt.h)
+MAKE_FLAGS+= EXTRA_LIBS=-lgetopt
+.endif
-CONFIGURE_ARGS= --cc=${CC} --disable-grab --prefix=${PREFIX}
+.include "../../mk/bsd.prefs.mk"
+
+.if ( ${OBJECT_FMT} == "a.out" )
+MAKE_ENV+= FILEFORMAT=aoutb
+.else
+MAKE_ENV+= FILEFORMAT=elf
+.endif
+
+CONFIGURE_ARGS= --cc=${CC} --prefix=${PREFIX}
+CONFIGURE_ARGS+= --disable-grab \
+ --disable-mmx
WRKSRC= ${WRKDIR}/ffmpeg
+post-patch:
+ ${MV} ${WRKSRC}/ffserver.c ${WRKSRC}/ffserver.c.old
+ ${SED} -e 's:/etc/ffserver.conf:'${PREFIX}/etc/ffserver.conf':g' \
+ ${WRKSRC}/ffserver.c.old > ${WRKSRC}/ffserver.c
+
post-install:
+ ${INSTALL_DATA} ${WRKSRC}/doc/ffserver.conf ${PREFIX}/etc
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ffmpeg
${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/doc/* \
${PREFIX}/share/doc/ffmpeg
+.include "../../devel/libgetopt/buildlink.mk"
.include "../../mk/bsd.pkg.mk"
To use --disable-mmx for MI and avoid linking problem.
2. replace patch-ab with this
$NetBSD$
--- ffserver.c.orig Wed Aug 15 06:38:17 2001
+++ ffserver.c
@@ -1526,7 +1526,11 @@
config_filename = "/etc/ffserver.conf";
for(;;) {
+#ifdef __NetBSD__
+ c = getopt_long(argc, argv, "Lh?f:", NULL, NULL);
+#else
c = getopt_long_only(argc, argv, "Lh?f:", NULL, NULL);
+#endif
if (c == -1)
break;
switch(c) {
2. replace pactc-ac with this
$NetBSD$
--- Makefile.orig Wed Aug 15 21:12:07 2001
+++ Makefile
@@ -3,8 +3,8 @@
#
include config.mak
-CFLAGS= $(OPTFLAGS) -Wall -g -I./libavcodec -I./libav
-LDFLAGS= -g
+CFLAGS= $(OPTFLAGS) -Wall -I./libavcodec -I./libav -I$(LOCALBASE)/include
+LDFLAGS= -L$(LOCALBASE)/lib
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p
LDFLAGS+=-p
@@ -18,17 +18,19 @@
$(MAKE) -C libavcodec all
$(MAKE) -C libav all
-ffmpeg: ffmpeg.o libav/libav.a libavcodec/libavcodec.a
- gcc $(LDFLAGS) -o $@ $^ -lm
+ffmpeg: ffmpeg.o libav/libav.la libavcodec/libavcodec.la
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $^ -lm
-ffserver: ffserver.o libav/libav.a libavcodec/libavcodec.a
- gcc $(LDFLAGS) -o $@ $^ -lm
+ffserver: ffserver.o libav/libav.la libavcodec/libavcodec.la
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $^ -lm $(EXTRA_LIBS)
%.o: %.c
- gcc $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
install: all
- install -s -m 755 $(PROG) $(prefix)/bin
+ $(MAKE) -C libavcodec install
+ $(MAKE) -C libav install
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) $(PROG) $(prefix)/bin
clean:
$(MAKE) -C libavcodec clean
4. add patch-ad and patch-ae
$NetBSD$
--- libav/Makefile.orig Wed Aug 15 06:32:50 2001
+++ libav/Makefile
@@ -1,5 +1,6 @@
include ../config.mak
-CFLAGS= $(OPTFLAGS) -Wall -g -I../libavcodec -DHAVE_AV_CONFIG_H
+
+CFLAGS= $(OPTFLAGS) -Wall -I../libavcodec -I$(LOCALBASE)/include -DHAVE_AV_CONFIG_H
OBJS= rm.o mpeg.o asf.o avienc.o jpeg.o swf.o wav.o raw.o \
avidec.o ffm.o \
@@ -12,14 +13,17 @@
LIB= libav.a
+install: all
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) $(prefix)/lib
+
all: $(LIB)
$(LIB): $(OBJS)
rm -f $@
- $(AR) rcs $@ $(OBJS)
+ $(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) -rpath $(prefix)/lib
%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o *~ *.a
$NetBSD$
--- libavcodec/Makefile.orig Mon Aug 13 06:52:36 2001
+++ libavcodec/Makefile
@@ -1,7 +1,6 @@
include ../config.mak
-CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H
-LDFLAGS= -g
+CFLAGS= $(OPTFLAGS) -Wall -DHAVE_AV_CONFIG_H
OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
mpegaudio.o ac3enc.o mjpeg.o resample.o dsputil.o \
@@ -42,23 +41,26 @@
LIB= libavcodec.a
TESTS= imgresample-test dct-test
+install: all
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) $(prefix)/lib
+
all: $(LIB)
tests: apiexample cpuid_test $(TESTS)
$(LIB): $(OBJS) $(ASM_OBJS)
rm -f $@
- $(AR) rcs $@ $(OBJS) $(ASM_OBJS)
+ $(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) -rpath $(prefix)/lib
dsputil.o: dsputil.c dsputil.h
%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
%.o: %.S
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
%.o: %.s
- nasm -f elf -o $@ $<
+ nasm -f $(FILEFORMAT) -o $@ $<
# depend only used by mplayer now
dep: depend
5. add these lines into PLIST
--- /usr/pkgsrc/graphics/ffmpeg/PLIST Tue Mar 19 20:39:27 2002
+++ PLIST Wed Mar 20 12:06:18 2002
@@ -1,6 +1,17 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2002/03/19 12:39:27 tron Exp $
+@comment $NetBSD$
bin/ffmpeg
bin/ffserver
+etc/ffserver.conf
+lib/libav.a
+lib/libav.la
+lib/libav.so
+lib/libav.so.0
+lib/libav.so.0.0
+lib/libavcodec.a
+lib/libavcodec.la
+lib/libavcodec.so
+lib/libavcodec.so.0
+lib/libavcodec.so.0.0
share/doc/ffmpeg/FAQ
share/doc/ffmpeg/README
share/doc/ffmpeg/README.dev
>Release-Note:
>Audit-Trail:
>Unformatted: