NetBSD Problem Report #43480

From sjamaan@frohike.homeunix.org  Tue Jun 15 19:45:57 2010
Return-Path: <sjamaan@frohike.homeunix.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id ECB2963B873
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 15 Jun 2010 19:45:56 +0000 (UTC)
Message-Id: <20100615194632.2CBC9F7E020@frohike.homeunix.org>
Date: Tue, 15 Jun 2010 21:46:32 +0200 (CEST)
From: Peter.Bex@xs4all.nl
Reply-To: Peter.Bex@xs4all.nl
To: gnats-bugs@gnats.NetBSD.org
Subject: audio/SDL_mixer's optional dependencies should be PKG_OPTIONs
X-Send-Pr-Version: 3.95

>Number:         43480
>Category:       pkg
>Synopsis:       SDL_mixer has a couple of libraries which are optional. They should be optional in pkgsrc too
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 15 19:50:00 +0000 2010
>Last-Modified:  Mon Jun 21 03:20:02 +0000 2010
>Originator:     Peter Bex
>Release:        NetBSD 5.0.1_PATCH
>Organization:

>Environment:


System: NetBSD frohike.homeunix.org 5.0.1_PATCH NetBSD 5.0.1_PATCH (FROHIKE) #0: Tue Aug 11 22:31:56 CEST 2009 sjamaan@frohike.homeunix.org:/usr/obj/sys/arch/amd64/compile/FROHIKE amd64
Architecture: x86_64
Machine: amd64
>Description:
	It's annoying that SDL_mixer uses so many dependencies when you
	need it to play only one or two games which don't use mp3, mod,
	ogg or flac files.

	The MP3 format is still plagued by patents and there are people
	who prefer to avoid MP3 if possible.  Those might like to be able
	to disable mp3 support in SDL_mixer.

	Besides, libmikmod has four current vulnerabilities which are not
	yet fixed.  Disabling libmikmod in all packages until there is an
	updated package is a good workaround.  This is another excellent
	reason to make it optional in SDL_mixer.
>How-To-Repeat:
	$ cd /usr/pkgsrc/audio/SDL_mixer
	$ make print-run-depends-list
>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/audio/SDL_mixer/Makefile,v
retrieving revision 1.38
diff -u -r1.38 Makefile
--- Makefile	15 Nov 2009 21:05:40 -0000	1.38
+++ Makefile	15 Jun 2010 19:34:48 -0000
@@ -35,10 +35,7 @@

 BUILDLINK_API_DEPENDS.SDL+=	SDL>=1.2.10

-.include "../../audio/flac/buildlink3.mk"
-.include "../../audio/libmikmod/buildlink3.mk"
-.include "../../audio/libvorbis/buildlink3.mk"
+.include "options.mk"
+
 .include "../../devel/SDL/buildlink3.mk"
-.include "../../multimedia/libogg/buildlink3.mk"
-.include "../../multimedia/smpeg/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: options.mk
===================================================================
RCS file: options.mk
diff -N options.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ options.mk	15 Jun 2010 19:34:48 -0000
@@ -0,0 +1,56 @@
+# $NetBSD$
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.SDL_mixer
+PKG_SUPPORTED_OPTIONS=	flac mikmod ogg mp3
+PKG_SUGGESTED_OPTIONS=	flac mikmod ogg mp3
+
+.include "../../mk/bsd.options.mk"
+
+###
+### flac
+###
+.if !empty(PKG_OPTIONS:Mflac)
+.include "../../audio/flac/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-music-flac
+CONFIGURE_ARGS+=	--enable-music-flac-shared
+.else
+CONFIGURE_ARGS+=	--disable-music-flac
+CONFIGURE_ARGS+=	--disable-music-flac-shared
+.endif
+
+###
+### mikmod
+###
+.if !empty(PKG_OPTIONS:Mmikmod)
+.include "../../audio/libmikmod/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-music-mod
+CONFIGURE_ARGS+=	--enable-music-mod-shared
+.else
+CONFIGURE_ARGS+=	--disable-music-mod
+CONFIGURE_ARGS+=	--disable-music-mod-shared
+.endif
+
+###
+### ogg
+###
+.if !empty(PKG_OPTIONS:Mogg)
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../multimedia/libogg/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-music-ogg
+CONFIGURE_ARGS+=	--enable-music-ogg-shared
+.else
+CONFIGURE_ARGS+=	--disable-music-ogg
+CONFIGURE_ARGS+=	--disable-music-ogg-shared
+.endif
+
+###
+### mp3
+###
+.if !empty(PKG_OPTIONS:Mmp3)
+.include "../../multimedia/smpeg/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-music-mp3
+CONFIGURE_ARGS+=	--enable-music-mp3-shared
+.else
+CONFIGURE_ARGS+=	--disable-music-mp3
+CONFIGURE_ARGS+=	--disable-music-mp3-shared
+.endif

>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/43480: audio/SDL_mixer's optional dependencies should be
 PKG_OPTIONs
Date: Sun, 20 Jun 2010 13:08:56 +0200

 On Tue, Jun 15, 2010 at 07:50:01PM +0000, Peter.Bex@xs4all.nl wrote:
 > 	It's annoying that SDL_mixer uses so many dependencies when you
 > 	need it to play only one or two games which don't use mp3, mod,
 > 	ogg or flac files.
 > 
 > 	The MP3 format is still plagued by patents and there are people
 > 	who prefer to avoid MP3 if possible.  Those might like to be able
 > 	to disable mp3 support in SDL_mixer.
 > 
 > 	Besides, libmikmod has four current vulnerabilities which are not
 > 	yet fixed.  Disabling libmikmod in all packages until there is an
 > 	updated package is a good workaround.  This is another excellent
 > 	reason to make it optional in SDL_mixer.

 I like the idea.
 We should have a standard way to let a package specify it needs
 SDL_mixer built e.g. with the mp3 option on, though. Ideas for that?
  Thomas

From: Peter Bex <Peter.Bex@xs4all.nl>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43480: audio/SDL_mixer's optional dependencies should be PKG_OPTIONs
Date: Sun, 20 Jun 2010 13:24:19 +0200

 On Sun, Jun 20, 2010 at 11:10:09AM +0000, Thomas Klausner wrote:
 >  I like the idea.
 >  We should have a standard way to let a package specify it needs
 >  SDL_mixer built e.g. with the mp3 option on, though. Ideas for that?

 That sounds like a good idea; that problem had occurred to me before and
 initially I thought a user ought to know what he's doing when he
 overrides the PKG_SUGGESTED_OPTIONS for this package.

 It sounds like this ought to be a new infrastructure option;
 PKG_REQUIRED_OPTIONS.SDL_mixer perhaps?  The building package could set
 the options that it needs and if SDL_mixer isn't built yet it could
 override the options in such a way that it always includes the needed
 options.  This may result in very confusing behaviour if we aren't
 careful: users might set PKG_OPTIONS.SDL_mixer or perhaps
 PKG_DEFAULT_OPTIONS to get rid of an annoying package.  It would be
 quite unexpected if the required options could override that.

 Also, what happens when SDL_mixer is already installed?  AFAIK there's
 no way to determine what options were set for an installed package at
 the time it was built.  Maybe a MESSAGE to tell the user that if he
 doesn't hear sound he should rebuild SDL_mixer with the right options?

 Cheers,
 Peter

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43480: audio/SDL_mixer's optional dependencies should be
 PKG_OPTIONs
Date: Sun, 20 Jun 2010 13:07:30 -0400

 On Sun, 20 Jun 2010 12:35:02 +0000 (UTC)
 Peter Bex <Peter.Bex@xs4all.nl> wrote:

 >  Also, what happens when SDL_mixer is already installed?  AFAIK there's
 >  no way to determine what options were set for an installed package at
 >  the time it was built.  Maybe a MESSAGE to tell the user that if he
 >  doesn't hear sound he should rebuild SDL_mixer with the right options?

 Perhaps using pkg_info -B <package> | grep PKG_OPTIONS
 -- 
 Matt

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43480: audio/SDL_mixer's optional dependencies should be
	PKG_OPTIONs
Date: Mon, 21 Jun 2010 03:16:53 +0000

 On Sun, Jun 20, 2010 at 05:10:05PM +0000, Matthew Mondor wrote:
  >>  Also, what happens when SDL_mixer is already installed?  AFAIK there's
  >>  no way to determine what options were set for an installed package at
  >>  the time it was built.  Maybe a MESSAGE to tell the user that if he
  >>  doesn't hear sound he should rebuild SDL_mixer with the right options?
  >  
  >  Perhaps using pkg_info -B <package> | grep PKG_OPTIONS

 This discussion should really be held in tech-pkg, not in gnats :-)

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.