From owner-freebsd-ports@FreeBSD.ORG Sun Feb 5 17:42:00 2012 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C2C1106564A; Sun, 5 Feb 2012 17:42:00 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 16B9C8FC0A; Sun, 5 Feb 2012 17:41:59 +0000 (UTC) Received: by iaeo4 with SMTP id o4so11175971iae.13 for ; Sun, 05 Feb 2012 09:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=7hzQjSx/LlICmH8Cnyn7Ps1Ldrw7lX7IIv0FGAzMe8U=; b=H5JNFmQWebBCqkSJAY4CXqbbgJupkW1t5gEd5PoKcmXM5quesVc0FoEtUrXlVj/x37 RMY4TnKq1jY8dN6o+JRDACNiSx+1GjD8vOMvb89yeoal3VCfJgO/sXc7tSRgg8i8a/EC UAWreKhvkd3f4E4d/QxOUOfZ/rMMe4CtG7o5o= Received: by 10.42.131.136 with SMTP id z8mr14514006ics.5.1328463719474; Sun, 05 Feb 2012 09:41:59 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.183.21 with HTTP; Sun, 5 Feb 2012 09:41:29 -0800 (PST) In-Reply-To: <4F2EBE70.8000405@FreeBSD.org> References: <4F2EBAA5.2080004@FreeBSD.org> <4F2EBE70.8000405@FreeBSD.org> From: Chris Rees Date: Sun, 5 Feb 2012 17:41:29 +0000 X-Google-Sender-Auth: cHszsWV07IuJ3i0y5632xnwhT14 Message-ID: To: ohauer@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: =?UTF-8?Q?Ry=C5=8DTa_SimaMoto?= , ports@freebsd.org Subject: Re: Any common policy against conflicting choice in Makefile OPTIONS? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 17:42:00 -0000 On 5 February 2012 17:37, Olli Hauer wrote: > On 2012-02-05 18:23, Chris Rees wrote: >> On 5 February 2012 17:21, Olli Hauer 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 ffmpe= g, >>>> 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-de= vel. >>>> As you know you should not select both of them, otherwise they may con= flict >>>> 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 = FFMPEG >>>> =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 installa= tion >>>> 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= hand, if >>>> one of them are already installed, Makefile would know which one is >>>> installed using 'exists(${LOCALBASE}/include/libavcodec/vda.h)' comman= d. >>>> 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 correspon= ds >>>> to the existing version and hides the other entry that should not be >>>> choosen. =C2=A0Unfortunately, the value LOCALBASE is not defined until >>>> macro is loaded, that means we don't have any pr= oper >>>> 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 t= he 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 use= r to retry >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'make config' to choose the already = installed 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 po= rt 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 impli= citly. >>>> =C2=A00x004. =C2=A0Warn with short pause, then use the installed versi= on 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 = user 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 = are 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 way= s should I >>>> choose? >>>> >>>> >>> >>> The following patch will do what you want, just polish the IGNORE messa= ges. >>> 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 +0= 100 >>> +++ 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"Su= pport 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 ;) > > where? > (Maybe I had not enough sleep tomight) Here (both are on by default): +.if defined(WITH_FFMPEG) && defined (WITH_FFMPEG_DEVEL) +IGNORE=3D 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 v= ersion 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