Date: Sun, 5 Feb 2012 17:23:34 +0000 From: Chris Rees <crees@freebsd.org> To: ohauer@freebsd.org Cc: =?UTF-8?Q?Ry=C5=8DTa_SimaMoto?= <liangtai.s4@gmail.com>, ports@freebsd.org Subject: Re: Any common policy against conflicting choice in Makefile OPTIONS? Message-ID: <CADLo838J6wG8A5_ppkOHdQsoQMm08r70mY%2Bv9f2znuuka%2Be9kA@mail.gmail.com> In-Reply-To: <4F2EBAA5.2080004@FreeBSD.org> References: <CABDoUfBgkK9ezhwSe-v_NUXfG0DRaJs1HwMqit7MyeUUgTERdg@mail.gmail.com> <4F2EBAA5.2080004@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5 February 2012 17:21, Olli Hauer <ohauer@freebsd.org> wrote: > On 2012-02-05 17:19, Ry=C5=8DTa SimaMoto wrote: >> Hi, I'm a port maintainer for multimedia/qmmp, and some ports. >> Before upgrading QMMP port, may I ask what is the common policy how to >> offer Makefile OPTIONS containing a certain contradictory pair? >> >> Actually the latest version of QMMP supports several versions of ffmpeg, >> including 0.7.11, 0.9, 0.9.1, and 2012.01.22 that I tested to verify, so= it >> allows user to choose one of multimedia/ffmpeg or multimedia/ffmpeg-deve= l. >> As you know you should not select both of them, otherwise they may confl= ict >> with each other. =C2=A0I plan to provide an entry for each of them. >> =C2=A0 | .... >> =C2=A0 | [*] FFMPEG =C2=A0 =C2=A0 =C2=A0 =C2=A0Support to playback by FF= MPEG >> =C2=A0 | [ ] FFMPEG_DEVEL =C2=A0Support to playback by FFMPEG-devel >> =C2=A0 | .... >> Then how should the Makefile proceed after the user's choice? >> >> When the user did not install any of them yet, it's easy: The installati= on >> would obey the user's order except when occationally both of them are >> enabled that results to fail with an alert message. =C2=A0On the other h= and, if >> one of them are already installed, Makefile would know which one is >> installed using 'exists(${LOCALBASE}/include/libavcodec/vda.h)' command. >> So, in fact, there is no question that which version the user want to us= e. >> >> The smartest way would be that provides a single entry which corresponds >> to the existing version and hides the other entry that should not be >> choosen. =C2=A0Unfortunately, the value LOCALBASE is not defined until >> <bsd.port.options.mk> macro is loaded, that means we don't have any prop= er >> steps to determine what version is already installed when the Makefile >> construct the OPTIONS set. =C2=A0So we have no other way than to let the= option >> dialog always show both entries including quite wrong option. >> >> Then if the user selects the other one that might conflict with the >> installed version, there are six possible courses I assume. >> =C2=A00x000. =C2=A0Quit the session with alert message instructing user = to retry >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'make config' to choose the already in= stalled one that Makefile >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0knows. >> =C2=A00x001. =C2=A0Dare to go through and expect that the depending port= deals with >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the conflicting issue. >> =C2=A00x002. =C2=A0Use the installed version and omit the choice implici= tly. >> =C2=A00x004. =C2=A0Warn with short pause, then use the installed version= and omit >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the choice. >> =C2=A00x010. =C2=A0Store options into /var/db/ports/* as are that the us= er selects. >> =C2=A00x020. =C2=A0Store options into /var/db/ports/* with correction as= actually >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0working. =C2=A0(If option variables ar= e allowed to be changed at >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0testing stage.) >> >> Is there any recommended policy? =C2=A0If so, what way or a set of ways = should I >> choose? >> >> > > The following patch will do what you want, just polish the IGNORE message= s. > Hopefully the include files do not change with the next versions. > > > > > --- Makefile.orig =C2=A0 =C2=A0 =C2=A0 2012-02-05 17:53:58.000000000 +010= 0 > +++ Makefile =C2=A0 =C2=A02012-02-05 18:16:00.000000000 +0100 > @@ -35,6 +35,7 @@ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0FLAC =C2=A0 =C2=A0= "Support to playback FLAC files" on \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MUSEPACK =C2=A0 = =C2=A0 =C2=A0 =C2=A0"Support to playback MPC files" on \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0FFMPEG =C2=A0"Supp= ort to playback FFMPEG files" on \ > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FFMPEG_DEVEL =C2=A0 = =C2=A0"Support to playback FFMPEG-devel files" on \ Hm, breaks itself by default ;) I still think depending on ffmpeg binary and defaulting to multimedia/ffmpeg and just having the one OPTION is the simplest solution. Chris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo838J6wG8A5_ppkOHdQsoQMm08r70mY%2Bv9f2znuuka%2Be9kA>