Bug 105868 - Management of auto-detected configure options (includes a live example with amarok)
Summary: Management of auto-detected configure options (includes a live example with a...
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: Michael Landin Hostbaek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-26 17:10 UTC by ganael.laplanche
Modified: 2006-11-30 13:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ganael.laplanche 2006-11-26 17:10:10 UTC
	Some ports activate a --with- or --enable- configure option if a variable is defined, but don't add the corresponding --without- or --disable- option if the variable is not defined.

Unfortunately this way of handling options is not very accurate, since configure scripts often try to detect what you have on your system and activate options following what has been detected. This way, having unchecked an option in the port's 'make config' may result in having the feature activated anyway... Even worse, if this detected feature requires a special library, the dependency is *not* recorded in the DB, so anyone may break the application by uninstalling the library.

An example with the audio/amarok port :

- I have libgpod installed on my system (not used by any program)
- I don't want Amarok to be built with iPod support so I uncheck the option
- The configure script is run and detects the lib
- Amarok *is* built with the gpod option
- I can uninstall libgpod (no dependency recorded)

Fix: I have attached a patch to correct the amarok example. Unfortunately, this may happen for a lot of ports !

How can it be fixed ? No idea. Should each porter add (force) the corresponding --disable- or --without- option for each --enable- or --with one (as it I had done in net-p2p/amule2) ? This is quite painful and may result in a heterogenous ports tree. Or could it be done automatically by the modifying the way .mk files manage options (not pretty sure about that, since options are not predictable) ?



.if !defined(WITH_GPOD)
 PLIST_SUB+=    GPOD="@comment "
+CONFIGURE_ARGS+=--without-libgpod
 .else
 LIB_DEPENDS+=  gpod.400:${PORTSDIR}/audio/libgpod
 CONFIGURE_ARGS+=--with-libgpod%--eK4Xc5pJqIeur5CftPdRwHik2N9T72itPaj4JCNM2Fjk8XHl
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- Makefile.old        Wed Nov  8 15:25:40 2006
+++ Makefile    Sun Nov 26 12:07:00 2006
@@ -49,6 +49,7 @@
How-To-Repeat: 	Just try the example above...
Comment 1 alexbl freebsd_committer 2006-11-27 06:54:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mich

It'd be difficult to get everything just right if we tried to make 
this logic implicit, the patch you supplied seems to be the canonical 
way to deal with this issue, so pass it to mich@ so he can deal with it 
(as maintainer of audio/amarok).
Comment 2 ganael.laplanche 2006-11-27 11:13:57 UTC
Hi,

I've sent a mail to mich@ to ask him if he could take a look at this patch.

Maybe we could add a small chapter in the porter's Handbook 'Dos and Don'ts' to
warn porters about this situation and advise them to add --without- and
--disable- options whenever possible ?

Best regards,

Ganaël LAPLANCHE
ganael.laplanche@martymac.com
http://www.martymac.com
Tel : (+33)6.84.03.57.24.
Comment 3 Michael Landin Hostbaek freebsd_committer 2006-11-28 09:55:22 UTC
State Changed
From-To: open->closed

Committed, thanks !
Comment 4 dfilter freebsd_committer 2006-11-28 09:55:27 UTC
mich        2006-11-28 09:55:01 UTC

  FreeBSD ports repository

  Modified files:
    audio/amarok         Makefile 
  Log:
  - actually disable libgpod if we do not enable it
  
  PR:             ports/105868
  Submitted by:   Ganael LAPLANCHE <ganael.laplanche@martymac.com>
  
  Revision  Changes    Path
  1.59      +1 -0      ports/audio/amarok/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 ganael.laplanche 2006-11-30 13:37:54 UTC
Hi,

As I suggested, I've sent a patch for the porter's handbook. See PR/106065.

Best regards,

Ganaël LAPLANCHE
ganael.laplanche@martymac.com
http://www.martymac.com
Tel : (+33)6.84.03.57.24.