Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73542 - Porting: media-video/ffmpeg
Summary: Porting: media-video/ffmpeg
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: PPC64 All
: High normal (vote)
Assignee: Lina Pezzella (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-06 03:50 UTC by Roman Dilken
Modified: 2006-04-12 10:52 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Possible fix (ffmpeg.macos,665 bytes, patch)
2005-03-20 04:06 UTC, Luca Barbato
Details | Diff
ffmpeg Sources Patch (ffmpeg-osx.diff,5.75 KB, patch)
2005-03-20 22:09 UTC, Lina Pezzella (RETIRED)
Details | Diff
The revised ebuild (ffmpeg-0.4.9_pre1.ebuild,3.69 KB, text/plain)
2005-03-20 22:10 UTC, Lina Pezzella (RETIRED)
Details
Ebuild (ffmpeg.ebuild,3.69 KB, text/plain)
2005-04-08 15:28 UTC, Lina Pezzella (RETIRED)
Details
Sources/Makefile Patch (ffmpeg-osx.patch,5.91 KB, patch)
2005-04-08 15:28 UTC, Lina Pezzella (RETIRED)
Details | Diff
Ebuild Take 3 (ffmpeg-0.4.9_pre1.ebuild,3.96 KB, text/plain)
2005-04-09 11:06 UTC, Lina Pezzella (RETIRED)
Details
patch against the current cvs (cvs.patch,4.96 KB, patch)
2005-04-09 16:20 UTC, Luca Barbato
Details | Diff
lu-zero's patch against the current cvs (version 2) (ffmpeg-current.patch,5.13 KB, patch)
2005-04-09 18:32 UTC, Lina Pezzella (RETIRED)
Details | Diff
changes made to ffmpeg-0.4.9_p20050226-r5.ebuild for OSX port (not complete) (ffmpeg-0.4.9_p20050226-r5.ebuild.patch,1.76 KB, patch)
2005-07-10 11:28 UTC, Fabian Groffen
Details | Diff
patch to apply on ffmpeg-0.4.9_p20050226 to make it more OSX compliant (not complete) (ffmpeg-0.4.9_p20050226-osx.patch,5.72 KB, patch)
2005-07-10 11:31 UTC, Fabian Groffen
Details | Diff
patch to apply on ffmpeg-0.4.9_p20050226 sources (de-typo-ed version - not complete) (ffmpeg-0.4.9_p20050226-osx.patch,5.67 KB, patch)
2005-07-10 11:54 UTC, Fabian Groffen
Details | Diff
patches made to get it to compile on ffmpeg-0.4.9_p20050226 (ffmpeg-0.4.9_p20050226-osx.patch,6.44 KB, patch)
2005-07-11 13:10 UTC, Fabian Groffen
Details | Diff
patches made to the ebuild to get it to compile (ffmpeg-0.4.9_p20050226-r5.ebuild.patch,1.67 KB, patch)
2005-07-11 13:13 UTC, Fabian Groffen
Details | Diff
Sources Patch (ffmpeg-osx2.patch,8.96 KB, patch)
2005-08-05 22:52 UTC, Lina Pezzella (RETIRED)
Details | Diff
Ebuild (ffmpeg-0.4.9.ebuild,3.93 KB, text/plain)
2005-08-05 22:56 UTC, Lina Pezzella (RETIRED)
Details
Arch-agnostic Patch (ffmpeg-osx.diff,8.93 KB, patch)
2005-08-07 12:51 UTC, Lina Pezzella (RETIRED)
Details | Diff
Arch Agnostic Patch (ffmpeg-osx.diff,9.19 KB, patch)
2005-08-07 13:13 UTC, Lina Pezzella (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dilken 2004-12-06 03:50:19 UTC
Porting fails due to a linker error:

cc -dynamiclib -o libavcodec.so common.o utils.o mem.o allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o motion_est.o imgconvert.o imgresample.o mpeg12.o mpegaudiodec.o pcm.o simple_idct.o ratecontrol.o adpcm.o eval.o dv.o error_resilience.o fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o h264.o golomb.o vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o flac.o vp3dsp.o integer.o h263.o h261.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o a52dec.o liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o liba52/imdct.o  liba52/parse.o liba52/crc.o liba52/resample.o faad.o faac.o libpostproc/postprocess.o mp3lameaudio.o oggvorbis.o ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o  -lz  -lfaac -lmp3lame -lvorbis -lvorbisenc  -Wl,-d
/usr/bin/libtool: unknown option character `d' in: -d
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT]
Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [libavcodec.so] Error 1
make: *** [lib] Error 2


Reproducible: Always
Steps to Reproduce:
1. ekeyword ~ppc-macos /usr/portage/media-video/ffmpeg/ffmpeg-0.4.9_pre1.ebuild
2. emerge -av ffmpeg
3.



Expected Results:  
compile cleanly - it prevents me from porting vlc

!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.0.51-r8 (default-macos/ppc/10.3, gcc-3.3, libsystem-7.1-r0, 7.6.0
Power Macintosh)
=================================================================
System uname: 7.6.0 Power Macintosh powerpc
macos-20041118
Python:              dev-lang/python-2.3.3 [2.3 (#1, Sep 13 2003, 00:49:11)]
distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632)
[disabled]
dev-lang/python:     2.3.3
sys-devel/autoconf:  2.57, 2.59-r5
sys-devel/automake:  1.6.3, 1.8.5-r1
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  [Not Present]
ACCEPT_KEYWORDS="ppc-macos ~ppc-macos"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe  -mcpu=G5 -mtune=G5 -mpowerpc64 -funroll-loops -flat_namespace
-mpowerpc-gpopt"
CHOST="powerpc-apple-darwin"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -pipe  -mcpu=G5 -mtune=G5 -mpowerpc64 -funroll-loops
-flat_namespace -mpowerpc-gpopt"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache collision-protect cvs distlocks keepwork"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc X altivec berkdb debug dts dvd encode faac faad ggi gif hbci jpeg
justify makecheck matroska multilib ncurses nls nptl odbc ofx oggvorbis opengl
png ppc-macos quotes recode ssl threads tiff truetype unicode usb zlib"
Comment 1 Lina Pezzella (RETIRED) gentoo-dev 2005-02-12 12:58:47 UTC
This depends on a newer version of automake than is available for ppc-macos's default collision-protect
profile. Will revisit after pathspec implementation.
Comment 2 Chris White (RETIRED) gentoo-dev 2005-03-09 14:52:24 UTC
Any updates on this?
Comment 3 Lina Pezzella (RETIRED) gentoo-dev 2005-03-09 18:01:02 UTC
For some reason it's calling /usr/bin/libtool. This is bad. It needs to call "libtool" so that the alias can
change that to "glibtool". I don't have a fix for it since I can't figure out why it's misbehaving like that.
Comment 4 Chris White (RETIRED) gentoo-dev 2005-03-09 22:14:34 UTC
Ok, I'll have a look at it tommorow and see what I can do to get it working for you guys.  Re-assigning for now.
Comment 5 Luca Barbato gentoo-dev 2005-03-15 14:52:43 UTC
questions:
1 ffmpeg does not use any autotools/libtools.
2 why CC -Wl,-d does call libtool?
3 could you attach the generated config.mak ?

till now the possible solution is put -Wl,-dynamic as LDFLAGS and/or set CC as gcc
Comment 6 Lina Pezzella (RETIRED) gentoo-dev 2005-03-15 17:05:07 UTC
append-ldflags -Wl,-dynamic fixes the libtool error. Good to know.

New error:

cc -shared -Wl,-soname,libpostproc.so.0 \
-o libpostproc.so postprocess_pic.o
cc: unrecognized option `-shared'
ld: unknown flag: -soname
make[2]: *** [libpostproc.so] Error 1
make[1]: *** [libavcodec.so] Error 2
make: *** [lib] Error 2

!!! ERROR: media-video/ffmpeg-0.4.9_p20050226-r1 failed.
!!! Function src_install, Line 119, Exitcode 2
!!! Install Failed
!!! If you need support, post the topmost build error, NOT this status message.
Comment 7 Luca Barbato gentoo-dev 2005-03-15 17:18:08 UTC
after configure sed the config.mak and set CC=gcc

should help
Comment 8 Chris White (RETIRED) gentoo-dev 2005-03-17 23:56:04 UTC
*bump* still needs some attention.
Comment 9 Luca Barbato gentoo-dev 2005-03-18 01:36:23 UTC
Please try with
CC=gcc
SLIBSUF=".dylib"
Comment 10 Lina Pezzella (RETIRED) gentoo-dev 2005-03-19 20:12:42 UTC
Even with CC=gcc and the .dylib, I get the following error with pre1:

gcc -dynamiclib -o libavcodec.dylib common.o utils.o mem.o allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o motion_est.o imgconvert.o imgresample.o mpeg12.o mpegaudiodec.o pcm.o simple_idct.o ratecontrol.o adpcm.o eval.o dv.o error_resilience.o fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o h264.o golomb.o vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o flac.o vp3dsp.o integer.o h263.o h261.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o libpostproc/postprocess.o ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o  -lz   -Wl,-d
/usr/bin/libtool: unknown option character `d' in: -d
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT]
Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [libavcodec.dylib] Error 1
make: *** [lib] Error 2

I don't see a point trying the older versions, although I seem to remember that an older version got over this problem only to have a problem with -shared. I also tried append-ldflags -Wl,-dynamic. Same error.
Comment 11 Luca Barbato gentoo-dev 2005-03-20 04:06:53 UTC
Created attachment 53921 [details, diff]
Possible fix

Please try that patch, _should_ make everything work.
Comment 12 Lina Pezzella (RETIRED) gentoo-dev 2005-03-20 16:42:14 UTC
I've gotten it working. I need to do some cleanup of things in local scope and I would like to collapse
my 4-5 patches into one bigger patch. Assuming I can get another program to link against this, I
will be committing either tonight or tomorrow.
Comment 13 Luca Barbato gentoo-dev 2005-03-20 16:57:40 UTC
Once you are ready you should commit the patch upstream.
Comment 14 Lina Pezzella (RETIRED) gentoo-dev 2005-03-20 22:09:47 UTC
Created attachment 54021 [details, diff]
ffmpeg Sources Patch

I'm attaching what I have to make it build. I get the following when I try to
run the binary:

dyld: ffmpeg Undefined symbols:
ffmpeg undefined reference to _ffm_nopts expected to be defined in
libavformat.dylib
ffmpeg undefined reference to _first_avcodec expected to be defined in
libavcodec.dylib
ffmpeg undefined reference to _first_iformat expected to be defined in
libavformat.dylib
ffmpeg undefined reference to _first_image_format expected to be defined in
libavformat.dylib
ffmpeg undefined reference to _first_oformat expected to be defined in
libavformat.dylib
ffmpeg undefined reference to _first_protocol expected to be defined in
libavformat.dylib
ffmpeg undefined reference to _loop_input expected to be defined in
libavformat.dylib
Trace/BPT trap

Hopefully someone has some ideas as to what to try.
Comment 15 Lina Pezzella (RETIRED) gentoo-dev 2005-03-20 22:10:55 UTC
Created attachment 54022 [details]
The revised ebuild

Sorry I didn't make a patch. I don't have the original copy of that ebuild on
my harddrive. There's not much different -- just look for the 2 ppc-macos
lines.
Comment 16 Lina Pezzella (RETIRED) gentoo-dev 2005-03-22 08:39:44 UTC
I went through each of the "undefined references", and found their definitions in the C files. All of the
corresponding object files link against the libraries, so I don't see a reason for that particular error.

A more thorough investigation shows the following:

# nm -u /usr/lib/libavcodec.dylib 
nm: object: /usr/lib/libavcodec.dylib malformed object (nhints in LC_TWOLEVEL_HINTS load command not the same as nundefsym in LC_DYSYMTAB load command)

# nm -u /usr/lib/libavformat.dylib 
nm: object: /usr/lib/libavformat.dylib malformed object (nhints in LC_TWOLEVEL_HINTS load command not the same as nundefsym in LC_DYSYMTAB load command)

I'm not sure why this is happening. The source code for the generated error can be found here, but
unfortunately the section we need is uncommented:

http://darwinsource.opendarwin.org/DevToolsApr2004/cctools-499/libstuff/ofile.c

I found a similar issue with an emacs build. It was fixed by a modification of the C code. However, some
of the definitions that are "undefined" are just simple declaration/initialization of variables. I don't see
why they would be generating errors.

I'd appreciate any votes on what we should do with this problem.
Comment 17 Lina Pezzella (RETIRED) gentoo-dev 2005-04-08 15:27:01 UTC
Kito and I worked on this this afternoon. Only thing that still doesn't work is USE=dvd on collision-
protect (see package.mask) and USE=oggvorbis is just broken. USE=sdl would need libsdl keyworded.

Please test and report back here.

Comment 18 Lina Pezzella (RETIRED) gentoo-dev 2005-04-08 15:28:06 UTC
Created attachment 55717 [details]
Ebuild
Comment 19 Lina Pezzella (RETIRED) gentoo-dev 2005-04-08 15:28:38 UTC
Created attachment 55718 [details, diff]
Sources/Makefile Patch
Comment 20 Luca Barbato gentoo-dev 2005-04-08 15:34:56 UTC
what's wrong with vorbis support?

(I'll try to update the snapshot once I can make upstream merge your bits)
Comment 21 Lina Pezzella (RETIRED) gentoo-dev 2005-04-08 15:44:56 UTC
Here's the error with USE=oggvorbis:

gcc -dynamiclib -o libavformat.dylib utils.o cutils.o os_support.o allformats.o mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o raw.o rm.o avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o sierravmd.o matroska.o ../libavcodec/libavcodec.dylib asf.o asf-enc.o pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o avio.o aviobuf.o file.o  framehook.o  udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o ogg.o  -lz  -Wl,-dynamic
/usr/bin/libtool: internal link edit command failed
ld: ogg.o illegal reference to symbol: _ogg_page_serialno defined in indirectly referenced dynamic library /usr/lib/libogg.0.dylib
make[1]: *** [libavformat.dylib] Error 1
make: *** [lib] Error 2

!!! ERROR: media-video/ffmpeg-0.4.9_pre1 failed.
!!! Function src_compile, Line 81, Exitcode 2

Hope that helps. I haven't had the time to look at it yet.
Comment 22 Luca Barbato gentoo-dev 2005-04-08 15:53:57 UTC
don't kill me but you should use the latest snapshot or a current cvs snapshot...

Some issues got already addressed and that one seems one of them....
Comment 23 Kito (RETIRED) gentoo-dev 2005-04-08 16:20:02 UTC
-logg should fix that methinks
Comment 24 Luca Barbato gentoo-dev 2005-04-08 16:30:29 UTC
already present in the latest snapshot I think...
Comment 25 Lina Pezzella (RETIRED) gentoo-dev 2005-04-08 19:29:58 UTC
Well, my interest is in getting the current version working in the portage tree so that users can emerge
ffmpeg. In the interest of not doing more work later on down the line, it would be a good idea to
run my diffs against the cvs version. I'll do that as soon as I get a moment. (finals crunch time this month)
Comment 26 Lina Pezzella (RETIRED) gentoo-dev 2005-04-09 11:05:29 UTC
Revised ebuild that adds the -logg stuff.
Comment 27 Lina Pezzella (RETIRED) gentoo-dev 2005-04-09 11:06:09 UTC
Created attachment 55775 [details]
Ebuild Take 3
Comment 28 Luca Barbato gentoo-dev 2005-04-09 16:20:06 UTC
Created attachment 55805 [details, diff]
patch against the current cvs

new patch against the current cvs the snapshot will be taken once it will be
committed upstream (hopefully)
Comment 29 Lina Pezzella (RETIRED) gentoo-dev 2005-04-09 17:24:40 UTC
Just read over the patch against the current cvs. 

+	ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec$(SLIBSUF)
+	ln -sf libavformat-$(VERSION).so $(libdir)/libavformat$(SLIBSUF)

Darwin doesn't know about .so, so those lines won't work.

-SPPLIB = $(SLIBPREF)postproc$(SLIBSUF)
+SPPLIB = $(SLIBPREF)postproc

I don't know why that's in there. We definitely want a suffix on libraries.

If we can get those lines changed to what they should be (I'd do it myself, but i'm not sure),
I'd say that has a good chance of working. :-)
Comment 30 Luca Barbato gentoo-dev 2005-04-09 17:39:28 UTC
change the .so to $(SLIBSUF) (I'm getting sleepy and I missed those 2)

the postproc patch is correct (the $(SLIBSUF) will be used in the makefile in a different way)
Comment 31 Lina Pezzella (RETIRED) gentoo-dev 2005-04-09 18:32:32 UTC
Created attachment 55822 [details, diff]
lu-zero's patch against the current cvs (version 2)

This is what you dcc-ed me on IRC.
Comment 32 Lina Pezzella (RETIRED) gentoo-dev 2005-04-09 18:33:28 UTC
And the new errors:

gcc -dynamiclib -o libavcodec.dylib bitstream.o utils.o mem.o allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o motion_est.o imgconvert.o imgresample.o mpeg12.o mpegaudiodec.o pcm.o simple_idct.o ratecontrol.o adpcm.o eval.o dv.o error_resilience.o fft.o mdct.o mace.o huffyuv.o cyuv.o raw.o h264.o golomb.o vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o vcr1.o cljr.o roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o msrle.o msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o 8bps.o smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o h264idct.o qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o h261.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o shorten.o loco.o alac.o wnv1.o ws-snd1.o aasc.o  faad.o faac.o libpostproc/postprocess.o mp3lameaudio.o ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o ppc/dsputil_h264_altivec.o  -lz  -lfaac -lmp3lame  -Wl,-dynamic,-search_paths_first
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
msmpeg4.o definition of common _ff_msmp4_dc_chroma_vlc (size 32)
msmpeg4.o definition of common _ff_msmp4_dc_luma_vlc (size 32)
msmpeg4.o definition of common _ff_msmp4_mb_i_vlc (size 16)
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libavcodec.dylib] Error 1
make: *** [lib] Error 2
Comment 33 Nick Dimiduk (RETIRED) gentoo-dev 2005-04-20 21:32:30 UTC
Built with "Ebuild Take 3" and "Sources/Makefile Patch", USE="acc altivec debug encode oggvorbis truetype".  "+dvd" fails because of masked a52dec and "+sdl" fails due to masked libsdl.  Using these use flags, I can build a copy of ffmpeg which works with the test files I've thrown at it.  It fails to encode ogg, but I think that's a problem with libogg rather than ffmpeg.

I'm not sure if any of this is news...  I assume it's lu-zero's patch which needs pushed upstream?  If i'm not mistaken, it is the same changes as are present in the other patch?  What additional information needs to accompany the patch when i send it upstream (hopefully tomorrow)?

This one's close; let's hammer it out.
Comment 34 Luca Barbato gentoo-dev 2005-04-21 02:05:06 UTC
What about the issue Lina pointed out?
Comment 35 Lina Pezzella (RETIRED) gentoo-dev 2005-04-21 06:43:55 UTC
What needs to be done is to download the current cvs version and port my patches to that version.
lu-zero's patches are a step in that direction, but they have the problem I mentioned in comment #32.

So basically, work left:
1) download current cvs from project homepage
2) write ebuild for current cvs build (can modify old ebuild)
3) apply my patches to the current cvs (which will require editing the sources manually since they are
slightly different now)
4) post result back here so a few people can test
5) if 4 comes back okay, send upstream.
Comment 36 Luca Barbato gentoo-dev 2005-04-21 06:59:51 UTC
The latest patch should apply cleanly to the current cvs.
I can push it myself IF you can assure me it will work on osx
Comment 37 Lina Pezzella (RETIRED) gentoo-dev 2005-04-21 08:26:16 UTC
New problem:

gcc -Wall -Wno-switch -fast -mcpu=7450 -pipe -fPIC -fno-common -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare -faltivec -I. -I'/var/tmp/portage/ffmpeg-0.4.9/work/ffmpeg' -I'/var/tmp/portage/ffmpeg-0.4.9/work/ffmpeg'/libavcodec -I'/var/tmp/portage/ffmpeg-0.4.9/work/ffmpeg'/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o output_example.o output_example.c 
gcc -Wl,-dynamic,-search_paths_first -g  -o output_example output_example.o -L./libavformat -lavformat -L./libavcodec -lavcodec -lz 
make -C vhook all
make[1]: *** No rule to make target `null.dylib', needed by `all'.  Stop.
make: *** [videohook] Error 2


Notice "null.dylib". That's definitely a problem.
Comment 38 Lina Pezzella (RETIRED) gentoo-dev 2005-04-21 09:05:07 UTC
ffmpeg # ./ffmpeg --help
dyld: ./ffmpeg Undefined symbols:
./ffmpeg undefined reference to _av_destruct_packet_nofree expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _ffm_nopts expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _first_avcodec expected to be defined in /usr/lib/libavcodec.dylib
./ffmpeg undefined reference to _first_iformat expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _first_image_format expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _first_oformat expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _first_protocol expected to be defined in /usr/lib/libavformat.dylib
./ffmpeg undefined reference to _loop_input expected to be defined in /usr/lib/libavformat.dylib
Trace/BPT trap
Comment 39 Lina Pezzella (RETIRED) gentoo-dev 2005-04-21 16:42:27 UTC
Okay - after the fixes to libavformat that were discussed between myself and Luca on IRC, it seems to 
build properly, with one hitch - none of the dynamic shared libraries get installed to /usr/lib. Hence
when I run the ffmpeg binary "ffmpeg --help", I get undefined symbols. So - the problem is somewhere
in the installation phase.
Comment 40 Nick Dimiduk (RETIRED) gentoo-dev 2005-04-21 18:24:44 UTC
If that's the case, why is it I'm able to use the application to perform file conversions?
Comment 41 Lina Pezzella (RETIRED) gentoo-dev 2005-04-22 07:57:31 UTC
You're using the application from portage, or from a cvs checkout of ffmpeg?
Comment 42 Nick Dimiduk (RETIRED) gentoo-dev 2005-04-22 10:41:58 UTC
My binary is built by portage using the ebuild attached to this bug.  The ebuild downloads the sources from a sourceforge mirror and then patches using the "Sources/Makefile Patch" which I placed in the files directory.
Comment 43 Lina Pezzella (RETIRED) gentoo-dev 2005-05-03 18:14:27 UTC
Current working patch is inCVS here. I'll have more time next week to get it working against the CVS snapshots.
Comment 44 Fabian Groffen gentoo-dev 2005-07-10 11:28:44 UTC
Created attachment 63084 [details, diff]
changes made to ffmpeg-0.4.9_p20050226-r5.ebuild for OSX port (not complete)

Sharing my today's efforts to apply Lina's patch from 0.4.8 to
0.4.9_p20050226-r5.

It manages to get through the static stuff, but only when disabling the vhook. 
Maybe my efforts help someone else to get going.
Comment 45 Fabian Groffen gentoo-dev 2005-07-10 11:31:59 UTC
Created attachment 63085 [details, diff]
patch to apply on ffmpeg-0.4.9_p20050226 to make it more OSX compliant (not complete)

This is a 'ported' patch from 0.4.8 to 0.4.9.  It mainly deals with correcting
the little changes that have been since and doing the patch by hand.  Some
extra changes by me were made to allow compilation to get somewhat further.

Maybe this work saves someone else from doing the manual patch job
Comment 46 Fabian Groffen gentoo-dev 2005-07-10 11:54:53 UTC
Created attachment 63086 [details, diff]
patch to apply on ffmpeg-0.4.9_p20050226 sources (de-typo-ed version - not complete)

just saw too late that there were some stupid typos in my patch, as well as new
oportunities to get a bit further in the process of getting the stuff to
compile.
Comment 47 Lina Pezzella (RETIRED) gentoo-dev 2005-07-11 08:44:37 UTC
You really might want to consider working with the current CVS snapshot. I'm not sure if they've changed 
much since the latest snapshot in the portage tree. When you send to upstream, they're going to want a 
patch against their current CVS.
Comment 48 Fabian Groffen gentoo-dev 2005-07-11 13:10:25 UTC
Created attachment 63172 [details, diff]
patches made to get it to compile on ffmpeg-0.4.9_p20050226

This from the bottom up recreated patch allows to compile static and shared.  I
haven't pushed my luck on any of the useflags (yet).

The patch is a joint venture of me, Google, some fink inspiration and j4rg0n.

I know for sure this patch is useless for upstream, since it's too hairy.
Comment 49 Fabian Groffen gentoo-dev 2005-07-11 13:13:17 UTC
Created attachment 63173 [details, diff]
patches made to the ebuild to get it to compile

Note that the osx patches are applied after any other patch.

With this patch I was able to compile, but it's far from the nicest solution
around as it sometimes uses brute force...
Comment 50 Lina Pezzella (RETIRED) gentoo-dev 2005-08-05 22:52:55 UTC
Created attachment 65208 [details, diff]
Sources Patch

Okay, this is not my final answer, as I need to make some of my changes
darwin-only. So yes, this will probably break linux installs atm.

kito - the problem was twofold: 1) flat_namespace was doing funky things. 2)
INSTALLSTRIP killed my dylibs.

I'll pretty this up on Sunday. If anyone wants to test for me on Tiger, that
would be much appreciated.
Comment 51 Lina Pezzella (RETIRED) gentoo-dev 2005-08-05 22:56:47 UTC
Created attachment 65209 [details]
Ebuild

For convenience, this is the ebuild. You can get the source I used here:

http://dev.gentoo.org/~j4rg0n/ffmpeg.tgz

(Just in case upstream CVS changes over the next 2 days).
Comment 52 Lina Pezzella (RETIRED) gentoo-dev 2005-08-07 12:51:11 UTC
Created attachment 65337 [details, diff]
Arch-agnostic Patch

These patches should be architecture agnostic. I'm testing them right now on
ppc-macos to make sure I didn't typo anything.
Comment 53 Lina Pezzella (RETIRED) gentoo-dev 2005-08-07 13:13:54 UTC
Created attachment 65340 [details, diff]
Arch Agnostic Patch

Deleted too many lines. Fixed it in this version.
Comment 54 Fabian Groffen gentoo-dev 2005-08-07 13:33:54 UTC
lazy verification: compiles with no extra use flags on ppc-macos (10.4) and x86

also appears to work on converting an avi to mpeg or wav.
Comment 55 Lina Pezzella (RETIRED) gentoo-dev 2005-10-08 16:56:20 UTC
Patches are in upstream CVS now. Closing out this bug.
Comment 56 Nick Dimiduk (RETIRED) gentoo-dev 2005-10-08 18:03:56 UTC
*cheer* :)