David Harel schreef:
> Jonathan, Thanks for your explanation.
> 
> I still don't get it. The command emerge should have done the 
> dependent packages before doing the desirable package anyway.

It will, but not if you haven't specified support for it via USE flags.
Meaning:

1) The Win32 codec support in mPlayer is *optional* (many people don't
need or use it, and it is your choice as to whether to use it, because
it is not essential to the main functionality of the program;

2) Optional support means by definition that it will not be available if
you don't specify that you want the option enabled, by enabling the USE
flag representing that option;

2) The USE flags available and active for any given package can be
viewed prior to emerging with the --verbose flag, which Jonathan gave
you an example of for mPlayer:

>> jwright on jonathan [ ~ ] --> emerge -pv mplayer
>> 
>> These are the packages that I would merge, in order:
>> 
>> Calculating dependencies  ...done! [ebuild     U ] 
>> media-video/mplayer-1.0_pre7-r1 [1.0_pre7] -3dfx +3dnow +3dnowext 
>> +X -aac -aalib +alsa (-altivec) -arts -bidi -bl +cdparanoia 
>> +cpudetection -custom-cflags -debug +dga -directfb +divx4linux -doc
>>  +dts +dv -dvb +dvd +dvdread -edl +encode -esd +fbcon -ggi +gif 
>> +gtk -i8x0 -ipv6 -jack -joystick +jpeg -libcaca -lirc -live -lzo 
>> -mad -matroska -matrox +mmx +mmxext -mythtv -nas -nls +nvidia 
>> +opengl -oss +png +real +rtc +samba -sdl +sse -sse2 -svga -tga 
>> -theora +truetype -v4l -v4l2 -vorbis +win32codecs -xanim -xinerama 
>> -xmms +xv +xvid -xvmc 7,613 kB
>> 

Jonathan would emerge mplayer with support for the functiions marked
with a '+" (such as 3dnow, X, dvd, divx, xvid, win32codecs), and without
support for those functions marked with a "-" (such as 3dfx-- guess he
doesn't have a Voodoo card :) -- directfb, bidi --guess he's not
Japanese or Hebrew either, not needing bi-directional text support--
xinerama -- no dual-head display? ;) , etc). This is how he customizes
mPlayer for his particular system. I also have mplayer installed, and my
USE flags are almost the same, except I have -nvidia where he has
+nvidia, because I have an ATI card and nvidia support does me no good
whatsoever, whereas I guess Jonathan has an nvidia card.

If we take a particular USE flag-- let's say xvid-- and consider the
effects of having it turned on and off. Now, if you don't use mPlayer to
play xvid-encoded *.avi files, you don't need to set this flag, because
you'll never miss having xvid support in mplayer (because you never try
to play the kinds of files that need such support). However, if you do
need such support, and you set the flag, mplayer will emerge xvid before
itself, because by setting the USE flag, you have made xvid a dependency
of mplayer (since obviously, xvid must be installed for mplayer to
compile xvid support into itself).

However, if you install xvid alone, and emerge mplayer -xvid, you still
won't be able to play divx/xvid *.avi files--despite xvid being
installed-- *because you have not told mplayer via the USE flag to look
for xvid and use it if available*.

This is what USE flags are all about-- the ability to customize your
system to your specific needs, without reference to some general user
standard or guess by the development team (as is done under a binary
distribution), and without reference to what other users using the same
program might need.

I don't need nvidia support for my programs, but Jonathan does, so he
compiles his apps with it, I compile mine without it. But we have, I'm
sure, a lot of the same apps on our system. If we were both using a
binary distribution that came with precompiled packages, mplayer would
likely have nvidia support compiled in (since the maintainer 'guesses'
that 'most people' likely need this support), which is fine for
Jonathan, but unnecessary for me (and might in fact cause me problems).

> Also, if I have to specify additional packages while doing mplayer, 
> how do I add them? but last thing. I did emerge win32codec and THEN 
> mplayer and that didn't work.

Use emerge -pv program_name to see what USE flags are available for the
program, then add or remove them by adding a line to
/etc/portage/package.use such as

cat-egory/program_name +flag1 -flag2

+flag1 meaning any flag which is not enabled (displayed as - and blue in
the previous output) which you want enabled, and -flag2 meaning any flag
which is enabled (displayed as + and red or green with a * in the
previous output) that you do not want enabled.

For example, my custom USE entry in /etc/portage/package.use for mplayer
looks like this:

media-video/mplayer 3dnowext aac cdparanoia dts dvb dvdread edl matroska
mmxext real rtc -sse2 tga theora v4l2 win32codecs xanim xvmc

I add 3dnowext because I have an AMD CPU which can use it, remove SSE2,
because I have an AMD CPU which can't use it, and add the others because
either I know I use them or because it's possible that my usage habits
may change so that I need them (I've come across a few matroska files,
and I might use cdparanoia at some point, though when I get around to
ripping my audio CDs, I may well use another program. But I'd rather the
support be available than not, so I enable it).

If you can't figure out what a USE flag does, you can look in
/usr/portage/profiles/use.desc or /usr/portage/profiles/use.local.desc,
but I find it easier to use an alias to a command provided on this ML
that does the searching for me (since by myself I can't hardly grep at all):

alias useflag='grep /usr/portage/profiles/use.*desc -e'

When added to ~/.bashrc, and after re-sourcing ~/.bashrc, it then allows
the following:

useflag matroska
/usr/portage/profiles/use.desc:matroska - Adds support for the matroska
container format

zo 09/25/05 11:58
/usr/local
motub -> useflag theora
/usr/portage/profiles/use.desc:theora - Adds support for the Theora
Video Compression Codec

zo 09/25/05 11:58
/usr/local
motub -> useflag sse2
/usr/portage/profiles/use.local.desc:media-video/mplayer:sse2 - Enables
sse2 support
/usr/portage/profiles/use.local.desc:media-video/transcode:sse2 -
Enables sse2 support
/usr/portage/profiles/use.local.desc:sci-libs/acml:sse2 - Enables sse2
support
/usr/portage/profiles/use.local.desc:sci-libs/fftw:sse2 - Enables sse2
support
/usr/portage/profiles/use.local.desc:x11-themes/polymer:sse2 - Enables
sse2 support.

as you see, it searches the aboved named files for the useflag you've
questioned, and prints out the description. If this is insufficient,
there's always Google Linux ( http://www.google.com/linux? ), which is
where I had to look to find out that the *.mkv files I had were
Matroska-encoded in the first place.


Anyway this is what Gentoo is all about, in a nutshell. You (or your
admin) are responsible for knowing your system and how it is used, and
finding out how to customize it for maximum efficiency. The information
is all made available to you (man pages, descriptions), and if you need
more information, there's always a link to the package's homepage
readily available, and of course, there's always Google. The whole
system is designed to flow together as seamlessly as possible, but you
do have to use it  for it to do so :) .

So what you probably need to do in this particular situation is:

1) edit /etc/make.conf to read just 'x86' in the ACCEPT_KEYWORDS field.

2) add the following line to /etc/portage/package.keywords:

media-video/mplayer ~x86

3) unmerge win32codecs (emerge -C win32codecs)

4) run emerge -pv mplayer and see what USE flags are currently enabled
or disabled. My bet is that win32codecs is disabled for mPlayer, whereas
you want it enabled.

5) add the following line to /etc/portage/package.use

media-video/mplayer win32codecs flag1 flag2 -flag3

adding and subtracting any other USE flags you might want or want removed.

6) run emerge -av mplayer. You should now see win32codecs both enabled
for mplayer, and the package being called as an emerge dependency
(that's why we removed it, both so that we would see how it works, and
so that win32codecs would be out of your world file as a dependency
should be).

If everything is OK, then just say 'yes' to the emerge. If not, say
'no', make your adjustments and then run emerge --ask --verbose mplayer
again. Rinse and repeat until you're comfortable saying 'yes' to the emerge.

When emerged, mplayer should then run the Win32-encoded files as expected.

Hope this helps,
Holly
-- 
gentoo-user@gentoo.org mailing list

Reply via email to