Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-06 Thread RyōTa SimaMoto
Thank you for all!

I sent a PR of upgrading qmmp as
http://www.freebsd.org/cgi/query-pr.cgi?pr=164832

Perhaps the ports system may be not very strong to let
users select options easily without any complicated
interface.  I desided to maintain the current options,
and give up the plan to display twin options.  For
ffmpeg-devel users, a short message about how to use
the installed version is added by an IGNORE procedure.

-=-=-=-=-=
SimaMoto,RyoTa liangtai...@gmail.com
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread RyōTa SimaMoto
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-devel.
As you know you should not select both of them, otherwise they may conflict
with each other.  I plan to provide an entry for each of them.
  | 
  | [*] FFMPEGSupport to playback by FFMPEG
  | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
  | 
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 installation
would obey the user's order except when occationally both of them are
enabled that results to fail with an alert message.  On the other hand, 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 use.

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.  Unfortunately, the value LOCALBASE is not defined until
bsd.port.options.mk macro is loaded, that means we don't have any proper
steps to determine what version is already installed when the Makefile
construct the OPTIONS set.  So 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.
 0x000.  Quit the session with alert message instructing user to retry
 'make config' to choose the already installed one that Makefile
 knows.
 0x001.  Dare to go through and expect that the depending port deals with
 the conflicting issue.
 0x002.  Use the installed version and omit the choice implicitly.
 0x004.  Warn with short pause, then use the installed version and omit
 the choice.
 0x010.  Store options into /var/db/ports/* as are that the user selects.
 0x020.  Store options into /var/db/ports/* with correction as actually
 working.  (If option variables are allowed to be changed at
 testing stage.)

Is there any recommended policy?  If so, what way or a set of ways should I
choose?


-=-=-=-=-=
SimaMoto,RyoTa liangtai...@gmail.com
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Chris Rees
On 5 February 2012 16:19, RyōTa SimaMoto liangtai...@gmail.com 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-devel.
 As you know you should not select both of them, otherwise they may conflict
 with each other.  I plan to provide an entry for each of them.
  | 
  | [*] FFMPEG        Support to playback by FFMPEG
  | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
  | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.

 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
         'make config' to choose the already installed one that Makefile
         knows.
  0x001.  Dare to go through and expect that the depending port deals with
         the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
         the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
         working.  (If option variables are allowed to be changed at
         testing stage.)

 Is there any recommended policy?  If so, what way or a set of ways should I
 choose?

Why not just have an option for FFMPEG?

That way, the port can just use whichever version is installed.

Voila:

OPTIONS=  FFMPEG Support playback by FFMPEG on

.include bsd.port.options.mk

.if defined(WITH_FFMPEG)
RUN_DEPENDS+= ffmpeg:${PORTSDIR}/multimedia/ffmpeg
.endif

The code snippet above will sort dependencies out itself, but choose
ffmpeg by default.

Chris
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Olli Hauer
On 2012-02-05 17:19, RyōTa 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-devel.
 As you know you should not select both of them, otherwise they may conflict
 with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEGSupport to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.
 
 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
  'make config' to choose the already installed one that Makefile
  knows.
  0x001.  Dare to go through and expect that the depending port deals with
  the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
  the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
  working.  (If option variables are allowed to be changed at
  testing stage.)
 
 Is there any recommended policy?  If so, what way or a set of ways should I
 choose?
 
 

The following patch will do what you want, just polish the IGNORE messages.
Hopefully the include files do not change with the next versions.




--- Makefile.orig   2012-02-05 17:53:58.0 +0100
+++ Makefile2012-02-05 18:16:00.0 +0100
@@ -35,6 +35,7 @@
FLACSupport to playback FLAC files on \
MUSEPACKSupport to playback MPC files on \
FFMPEG  Support to playback FFMPEG files on \
+   FFMPEG_DEVELSupport to playback FFMPEG-devel files on \
MODPLUG Support to playback MOD files on \
WILDMIDISupport to playback MIDI files on \
GME Support video game music files on \
@@ -147,6 +148,10 @@
 PLUGIN_OPTIONS_CMAKE+= -DUSE_GME:BOOL=FALSE
 .endif

+.if defined(WITH_FFMPEG)  defined (WITH_FFMPEG_DEVEL)
+IGNORE=coose only one FFMPEG option
+.endif
+
 .ifndef(WITHOUT_FFMPEG)
 PLIST_SUB+=FFMPEG=
 LIB_DEPENDS+=  avcodec.1:${PORTSDIR}/multimedia/ffmpeg
@@ -458,6 +463,20 @@
 CMAKE_OUTSOURCE=yes
 CFLAGS+=   -I${LOCALBASE}/include -L${LOCALBASE}/lib

+.include bsd.port.pre.mk
+
+.if defined(WITH_FFMPEG)
+. if exists(${LOCALBASE}/include/libavcodec/vda.h)
+IGNORE=seems ffmpeg-devel is installed but OPTION is different
+. endif
+.endif
+
+.if defined(WITH_FFMPEG_DEVEL)
+. if exists(${LOCALBASE}/include/ffmpeg/sha1.h)
+IGNORE=seems ffmpeg is installed but OPTION is different
+. endif
+.endif
+
 post-patch:
${REINPLACE_CMD} -e 's| -ldl| $${CMAKE_DL_LIBS}|' \
${WRKSRC}/src/plugins/Effect/ladspa/CMakeLists.txt
@@ -495,4 +514,4 @@
cd ${WRKDIR} ; ${SED} -i -e '/PLIST.doc/ r PLIST.doc' ${TMPPLIST}
 .endif

-.include bsd.port.mk
+.include bsd.port.post.mk
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Chris Rees
On 5 February 2012 17:21, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 17:19, RyōTa 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-devel.
 As you know you should not select both of them, otherwise they may conflict
 with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEG        Support to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.

 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
          'make config' to choose the already installed one that Makefile
          knows.
  0x001.  Dare to go through and expect that the depending port deals with
          the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
          the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
          working.  (If option variables are allowed to be changed at
          testing stage.)

 Is there any recommended policy?  If so, what way or a set of ways should I
 choose?



 The following patch will do what you want, just polish the IGNORE messages.
 Hopefully the include files do not change with the next versions.




 --- Makefile.orig       2012-02-05 17:53:58.0 +0100
 +++ Makefile    2012-02-05 18:16:00.0 +0100
 @@ -35,6 +35,7 @@
                FLAC    Support to playback FLAC files on \
                MUSEPACK        Support to playback MPC files on \
                FFMPEG  Support to playback FFMPEG files on \
 +               FFMPEG_DEVEL    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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Olli Hauer
On 2012-02-05 18:23, Chris Rees wrote:
 On 5 February 2012 17:21, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 17:19, RyōTa 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-devel.
 As you know you should not select both of them, otherwise they may conflict
 with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEGSupport to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.

 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
  'make config' to choose the already installed one that Makefile
  knows.
  0x001.  Dare to go through and expect that the depending port deals with
  the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
  the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
  working.  (If option variables are allowed to be changed at
  testing stage.)

 Is there any recommended policy?  If so, what way or a set of ways should I
 choose?



 The following patch will do what you want, just polish the IGNORE messages.
 Hopefully the include files do not change with the next versions.




 --- Makefile.orig   2012-02-05 17:53:58.0 +0100
 +++ Makefile2012-02-05 18:16:00.0 +0100
 @@ -35,6 +35,7 @@
FLACSupport to playback FLAC files on \
MUSEPACKSupport to playback MPC files on \
FFMPEG  Support to playback FFMPEG files on \
 +   FFMPEG_DEVELSupport to playback FFMPEG-devel files on \
 
 Hm, breaks itself by default ;)

where?
(Maybe I had not enough sleep tomight)



 I still think depending on ffmpeg binary and defaulting to
 multimedia/ffmpeg and just having the one OPTION is the simplest
 solution.

Sure, but the OP maybe wants to give the ability to choose which ffmpeg version 
in case the ffmpeg port is not already installed.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Chris Rees
On 5 February 2012 17:37, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 18:23, Chris Rees wrote:
 On 5 February 2012 17:21, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 17:19, RyōTa 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-devel.
 As you know you should not select both of them, otherwise they may conflict
 with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEG        Support to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.

 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
          'make config' to choose the already installed one that Makefile
          knows.
  0x001.  Dare to go through and expect that the depending port deals with
          the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
          the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
          working.  (If option variables are allowed to be changed at
          testing stage.)

 Is there any recommended policy?  If so, what way or a set of ways should I
 choose?



 The following patch will do what you want, just polish the IGNORE messages.
 Hopefully the include files do not change with the next versions.




 --- Makefile.orig       2012-02-05 17:53:58.0 +0100
 +++ Makefile    2012-02-05 18:16:00.0 +0100
 @@ -35,6 +35,7 @@
                FLAC    Support to playback FLAC files on \
                MUSEPACK        Support to playback MPC files on \
                FFMPEG  Support to playback FFMPEG files on \
 +               FFMPEG_DEVEL    Support to playback FFMPEG-devel files on 
 \

 Hm, breaks itself by default ;)

 where?
 (Maybe I had not enough sleep tomight)

Here (both are on by default):

+.if defined(WITH_FFMPEG)  defined (WITH_FFMPEG_DEVEL)
+IGNORE=coose only one FFMPEG option
+.endif


 I still think depending on ffmpeg binary and defaulting to
 multimedia/ffmpeg and just having the one OPTION is the simplest
 solution.

 Sure, but the OP maybe wants to give the ability to choose which ffmpeg 
 version in case the ffmpeg port is not already installed.

I'm just pointing out that it's not easy, and probably not a good idea :)

If the user cares that much about which ffmpeg version is installed
s/he would have installed it already.

Chris
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Olli Hauer
On 2012-02-05 18:41, Chris Rees wrote:
 On 5 February 2012 17:37, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 18:23, Chris Rees wrote:
 On 5 February 2012 17:21, Olli Hauer oha...@freebsd.org wrote:
 On 2012-02-05 17:19, RyōTa 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-devel.
 As you know you should not select both of them, otherwise they may 
 conflict
 with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEGSupport to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
 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 installation
 would obey the user's order except when occationally both of them are
 enabled that results to fail with an alert message.  On the other hand, 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 use.

 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.  Unfortunately, the value LOCALBASE is not defined until
 bsd.port.options.mk macro is loaded, that means we don't have any proper
 steps to determine what version is already installed when the Makefile
 construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
  'make config' to choose the already installed one that Makefile
  knows.
  0x001.  Dare to go through and expect that the depending port deals with
  the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
  the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
  working.  (If option variables are allowed to be changed at
  testing stage.)

 Is there any recommended policy?  If so, what way or a set of ways should 
 I
 choose?



 The following patch will do what you want, just polish the IGNORE messages.
 Hopefully the include files do not change with the next versions.




 --- Makefile.orig   2012-02-05 17:53:58.0 +0100
 +++ Makefile2012-02-05 18:16:00.0 +0100
 @@ -35,6 +35,7 @@
FLACSupport to playback FLAC files on \
MUSEPACKSupport to playback MPC files on \
FFMPEG  Support to playback FFMPEG files on \
 +   FFMPEG_DEVELSupport to playback FFMPEG-devel files 
 on \

 Hm, breaks itself by default ;)

 where?
 (Maybe I had not enough sleep tomight)
 
 Here (both are on by default):

OK, not enough sleep ... good catch.


 +.if defined(WITH_FFMPEG)  defined (WITH_FFMPEG_DEVEL)
 +IGNORE=coose only one FFMPEG option
 +.endif
 

 I still think depending on ffmpeg binary and defaulting to
 multimedia/ffmpeg and just having the one OPTION is the simplest
 solution.

 Sure, but the OP maybe wants to give the ability to choose which ffmpeg 
 version in case the ffmpeg port is not already installed.
 
 I'm just pointing out that it's not easy, and probably not a good idea :)
 
 If the user cares that much about which ffmpeg version is installed
 s/he would have installed it already.

Valid argument.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: Any common policy against conflicting choice in Makefile OPTIONS?

2012-02-05 Thread Da Rock

On 02/06/12 03:41, Chris Rees wrote:

On 5 February 2012 17:37, Olli Haueroha...@freebsd.org  wrote:

On 2012-02-05 18:23, Chris Rees wrote:

On 5 February 2012 17:21, Olli Haueroha...@freebsd.org  wrote:

On 2012-02-05 17:19, RyōTa 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-devel.
As you know you should not select both of them, otherwise they may conflict
with each other.  I plan to provide an entry for each of them.
   | 
   | [*] FFMPEGSupport to playback by FFMPEG
   | [ ] FFMPEG_DEVEL  Support to playback by FFMPEG-devel
   | 
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 installation
would obey the user's order except when occationally both of them are
enabled that results to fail with an alert message.  On the other hand, 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 use.

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.  Unfortunately, the value LOCALBASE is not defined until
bsd.port.options.mk  macro is loaded, that means we don't have any proper
steps to determine what version is already installed when the Makefile
construct the OPTIONS set.  So 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.
  0x000.  Quit the session with alert message instructing user to retry
  'make config' to choose the already installed one that Makefile
  knows.
  0x001.  Dare to go through and expect that the depending port deals with
  the conflicting issue.
  0x002.  Use the installed version and omit the choice implicitly.
  0x004.  Warn with short pause, then use the installed version and omit
  the choice.
  0x010.  Store options into /var/db/ports/* as are that the user selects.
  0x020.  Store options into /var/db/ports/* with correction as actually
  working.  (If option variables are allowed to be changed at
  testing stage.)

Is there any recommended policy?  If so, what way or a set of ways should I
choose?



The following patch will do what you want, just polish the IGNORE messages.
Hopefully the include files do not change with the next versions.




--- Makefile.orig   2012-02-05 17:53:58.0 +0100
+++ Makefile2012-02-05 18:16:00.0 +0100
@@ -35,6 +35,7 @@
FLACSupport to playback FLAC files on \
MUSEPACKSupport to playback MPC files on \
FFMPEG  Support to playback FFMPEG files on \
+   FFMPEG_DEVELSupport to playback FFMPEG-devel files on \

Hm, breaks itself by default ;)

where?
(Maybe I had not enough sleep tomight)

Here (both are on by default):

+.if defined(WITH_FFMPEG)  defined (WITH_FFMPEG_DEVEL)
+IGNORE=coose only one FFMPEG option
+.endif


I still think depending on ffmpeg binary and defaulting to
multimedia/ffmpeg and just having the one OPTION is the simplest
solution.

Sure, but the OP maybe wants to give the ability to choose which ffmpeg version 
in case the ffmpeg port is not already installed.

I'm just pointing out that it's not easy, and probably not a good idea :)

If the user cares that much about which ffmpeg version is installed
s/he would have installed it already.

True +1.

Usually it is this that breaks most similar ports (xine, mplayer, etc). 
Can't install devel without breaking, and to fix you have to install the 
non devel version.


JIC: this is not an official complaint, or a stolen thread. Just an 
observation for the OP to consider when setting their own port.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org