Bug 56721 - [patch, non-maintainer] multimedia/ffmpeg: fix installation of shared libs, man page installation, plist
Summary: [patch, non-maintainer] multimedia/ffmpeg: fix installation of shared libs, m...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mario Sergio Fujikawa Ferreira
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-11 23:00 UTC by Simon Barner
Modified: 2003-12-08 03:27 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (2.77 KB, patch)
2003-09-11 23:00 UTC, Simon Barner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Barner 2003-09-11 23:00:35 UTC
The port used to install the shared library to libname.so and added a symbolic
link to libname.so.1. AFAIK it should be vice-versa.

Another improvement is, that the man pages are no correctly listed in
the port Makefile.

As a last point, I added refrences for the shared version of libavformat
to the pkg-plist.

Don't know whether the port revison should be bumped (in my patches, it
is not).
Comment 1 Erwin Lansing freebsd_committer freebsd_triage 2003-09-12 07:55:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lioux

Over to maintainer
Comment 2 Mark Linimon 2003-12-05 00:26:27 UTC
Unless I uncomment the line WITH_SDL in the Makefile, I get
the following:

===>  Configuring for ffmpeg-0.4.8
sdl-config: not found

Does the submitter of this PR have the same problem?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2003-12-05 00:27:19 UTC
State Changed
From-To: open->feedback

Set to feedback to note that I'm trying to help out lioux@ 
who is having machine problems.
Comment 4 Simon Barner 2003-12-06 03:03:40 UTC
[ added maintainer to Cc ]

> Unless I uncomment the line WITH_SDL in the Makefile, I get
> the following:
> 
> ===>  Configuring for ffmpeg-0.4.8
> sdl-config: not found
> 
> Does the submitter of this PR have the same problem?

There is a REINPLACE statement that should take care of this. I updated
the patch (see below), in order to fix the following this:

- detection of imlib2
- build without debug information
- handling of optimization levels

Simon

diff -ruN ffmpeg/Makefile ffmpeg.patched/Makefile
--- ffmpeg/Makefile	Wed Oct  8 15:37:43 2003
+++ ffmpeg.patched/Makefile	Sat Dec  6 03:55:34 2003
@@ -18,9 +18,13 @@
 HAS_CONFIGURE=	yes
 USE_GMAKE=	yes
 USE_REINPLACE=	yes
-CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
+CONFIGURE_ARGS=	--cc="${CC}" --prefix="${PREFIX}" \
 		--make="${GMAKE}" --enable-shared \
-		--extra-libs="-lm -L${LOCALBASE}/lib"
+		--extra-ldflags="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
+		--extra-libs"-lm" \
+		--disable-debug
+MAKE_ENV+=	LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib"
+
 PLIST_SUB=	SHLIB_VERSION=${SHLIB_VERSION}
 INSTALLS_SHLIB=	yes
 
@@ -35,6 +39,7 @@
 HEADER_FILES=	libavcodec/avcodec.h libavcodec/common.h \
 		libavcodec/dsputil.h
 LIB_FILES=	libavcodec/libavcodec.a libavformat/libavformat.a
+MAN1=		ffmpeg.1 ffplay.1 ffserver.1
 
 .include <bsd.port.pre.mk>
 
@@ -53,7 +58,7 @@
 ##
 ## SDL
 .if exists(${LOCALBASE}/lib/libSDL-1.1.so)
-#WITH_SDL=yes
+WITH_SDL=yes
 .endif
 ## freetype2
 .if exists(${LOCALBASE}/lib/libfreetype.so)
@@ -120,11 +125,15 @@
 .endif
 ## optimization
 .ifdef(WITH_OPTIMIZED_CFLAGS)
-CONFIGURE_ARGS+=	--extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
-				-O3 -ffast-math -fomit-frame-pointer"
-.else
-CONFIGURE_ARGS+=	--extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
+CONFIGURE_ARGS+=	--extra-cflags="-I${LOCALBASE}/include \
+			-I${X11BASE}/include \
+			-ffast-math -fomit-frame-pointer"
+.else
+CONFIGURE_ARGS+=	--extra-cflags="-I${LOCALBASE}/include \
+			-I${X11BASE}/include" \
+			--disable-opts
 .endif
+
 ## vhook
 .ifndef(WITHOUT_VHOOK)
 PLIST_SUB+=	VHOOK=""
@@ -254,8 +263,9 @@
 .for file in ${LIB_FILES}
 	@${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/lib/${file:T}
 .endfor
+
 # add shared lib link
 	@${LN} -sf libavcodec.so \
-		${PREFIX}/lib/libavcodec.so.${SHLIB_VERSION}
+	${PREFIX}/lib/libavcodec.so.${SHLIB_VERSION}
 
 .include <bsd.port.post.mk>
diff -ruN ffmpeg/files/patch-Makefile ffmpeg.patched/files/patch-Makefile
--- ffmpeg/files/patch-Makefile	Fri Jan 10 19:21:21 2003
+++ ffmpeg.patched/files/patch-Makefile	Sat Dec  6 02:29:46 2003
@@ -1,5 +1,5 @@
---- Makefile.orig	Wed Jan  1 20:51:57 2003
-+++ Makefile	Wed Jan  1 20:52:27 2003
+--- Makefile.orig	Sun Sep 28 17:26:39 2003
++++ Makefile	Sat Dec  6 02:29:28 2003
 @@ -6,8 +6,7 @@
  
  VPATH=$(SRC_PATH)
@@ -10,3 +10,14 @@
  
  ifeq ($(TARGET_GPROF),yes)
  CFLAGS+=-p
+@@ -69,8 +68,8 @@
+ all: lib $(PROG) $(PROGTEST) $(VHOOK)
+ 
+ lib:
+-	$(MAKE) -C libavcodec all
+-	$(MAKE) -C libavformat all
++	$(MAKE) LDFLAGS="$(LDFLAGS)" -C libavcodec all
++	$(MAKE) LDFLAGS="$(LDFLAGS)" -C libavformat all
+ 
+ ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
+ 	$(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
diff -ruN ffmpeg/files/patch-configure ffmpeg.patched/files/patch-configure
--- ffmpeg/files/patch-configure	Thu Jan  1 01:00:00 1970
+++ ffmpeg.patched/files/patch-configure	Sat Dec  6 03:41:32 2003
@@ -0,0 +1,55 @@
+--- configure.orig	Sun Sep 28 17:26:39 2003
++++ configure	Sat Dec  6 03:41:29 2003
+@@ -22,7 +22,7 @@
+ mandir=""
+ bindir=""
+ cross_prefix=""
+-cc="gcc"
++cc="$CC"
+ ar="ar"
+ ranlib="ranlib"
+ make="make"
+@@ -111,7 +111,7 @@
+ BeOS)
+ prefix="/boot/home/config"
+ # helps building libavcodec
+-CFLAGS="-DPIC -fomit-frame-pointer"
++CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer"
+ # 3 gcc releases known for BeOS, each with ugly bugs
+ gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
+ case "$gcc_version" in
+@@ -177,13 +177,13 @@
+ gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
+ case "$gcc_version" in
+ *2.95*) 
+-CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
++CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
+ ;;
+ *3.3*) 
+-CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
++CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
+ ;;
+ *) 
+-CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
++CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
+ ;;
+ esac
+ ;;
+@@ -276,7 +276,7 @@
+   ;;
+   --make=*) make=`echo $opt | cut -d '=' -f 2`
+   ;;
+-  --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
++  --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
+   ;;
+   --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
+   ;;
+@@ -682,7 +682,7 @@
+ EOF
+ 
+ imlib2=no
+-if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null  ; then
++if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 2> /dev/null  ; then
+ imlib2=yes
+ fi
+ 
diff -ruN ffmpeg/files/patch-libavcodec::Makefile ffmpeg.patched/files/patch-libavcodec::Makefile
--- ffmpeg/files/patch-libavcodec::Makefile	Wed Oct  8 15:37:43 2003
+++ ffmpeg.patched/files/patch-libavcodec::Makefile	Sat Dec  6 03:00:25 2003
@@ -1,12 +1,22 @@
---- libavcodec/Makefile.orig	Sun Oct  6 12:26:38 2002
-+++ libavcodec/Makefile	Wed Oct  9 14:24:34 2002
-@@ -228,8 +228,7 @@
- install: all
- ifeq ($(BUILD_SHARED),yes)
+--- libavcodec/Makefile.orig	Sat Dec  6 02:32:47 2003
++++ libavcodec/Makefile	Sat Dec  6 03:00:14 2003
+@@ -162,7 +162,7 @@
+ 	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
+ 	-lib /machine:i386 /def:$(@:.dll=.def)
+ else
+-	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
++	$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
+ endif
+ 
+ dsputil.o: dsputil.c dsputil.h
+@@ -230,8 +230,8 @@
+ 	install -s -m 755 $(SLIB) "$(prefix)"
+ else
  	install -d $(prefix)/lib
 -	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so
 -	ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
-+	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec.so
++	install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec.so.0
++	cd $(prefix)/lib && ln -s libavcodec.so.0 libavcodec.so
  	ldconfig || true
- 	mkdir -p $(prefix)/include/ffmpeg
- 	install -m 644 $(VPATH)/avcodec.h $(prefix)/include/ffmpeg/avcodec.h
+ endif
+ else
diff -ruN ffmpeg/files/patch-libavformat::Makefile ffmpeg.patched/files/patch-libavformat::Makefile
--- ffmpeg/files/patch-libavformat::Makefile	Thu Jan  1 01:00:00 1970
+++ ffmpeg.patched/files/patch-libavformat::Makefile	Fri Dec  5 18:01:38 2003
@@ -0,0 +1,13 @@
+--- libavformat/Makefile.orig	Thu Sep 11 22:55:10 2003
++++ libavformat/Makefile	Thu Sep 11 23:12:50 2003
+@@ -88,8 +88,8 @@
+ install: all
+ ifeq ($(BUILD_SHARED),yes)
+ 	install -d $(prefix)/lib
+-	install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so
+-	ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
++	install -s -m 755 $(SLIB) $(prefix)/lib/libavformat.so.0
++	ln -sf libavformat.so.0 $(prefix)/lib/libavformat.so
+ 	ldconfig || true
+ 	mkdir -p $(prefix)/include/ffmpeg
+ 	install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h
diff -ruN ffmpeg/files/patch-vhook::Makefile ffmpeg.patched/files/patch-vhook::Makefile
--- ffmpeg/files/patch-vhook::Makefile	Thu Jan  1 01:00:00 1970
+++ ffmpeg.patched/files/patch-vhook::Makefile	Fri Dec  5 20:11:37 2003
@@ -0,0 +1,19 @@
+--- vhook/Makefile.orig	Fri Dec  5 20:07:04 2003
++++ vhook/Makefile	Fri Dec  5 20:07:55 2003
+@@ -29,13 +29,13 @@
+ 	install -s -m 755 $(HOOKS) $(INSTDIR)
+ 
+ imlib2.so: imlib2.o
+-	$(CC) -g -o $@ $(SHFLAGS) $< -lImlib2
++	$(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $< -lImlib2
+ 
+ drawtext.so: drawtext.o
+-	$(CC) -g -o $@ $(SHFLAGS) $< `freetype-config --libs`
++	$(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $< `freetype-config --libs`
+ 
+ %.so: %.o
+-	$(CC) -g -o $@ $(SHFLAGS) $<
++	$(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $<
+ 
+ clean:
+ 	rm -f *.o *.d .depend *.so *~
diff -ruN ffmpeg/pkg-plist ffmpeg.patched/pkg-plist
--- ffmpeg/pkg-plist	Wed Oct  8 15:37:43 2003
+++ ffmpeg.patched/pkg-plist	Fri Dec  5 18:03:35 2003
@@ -14,6 +14,8 @@
 lib/libavcodec.so
 lib/libavcodec.so.%%SHLIB_VERSION%%
 lib/libavformat.a
+lib/libavformat.so
+lib/libavformat.so.%%SHLIB_VERSION%%
 %%VHOOK%%%%DRAWTEXT%%lib/vhook/drawtext.so
 %%VHOOK%%lib/vhook/fish.so
 %%VHOOK%%%%IMLIB2%%lib/vhook/imlib2.so
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2003-12-08 03:27:11 UTC
State Changed
From-To: feedback->closed

Committed on behalf of lioux@ (who is having machine troubles), thanks.