From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jan 25 04:20:19 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D7C916A4CF for ; Sun, 25 Jan 2004 04:20:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30AA843D48 for ; Sun, 25 Jan 2004 04:20:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0PCKFFR068234 for ; Sun, 25 Jan 2004 04:20:15 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0PCKFUh068233; Sun, 25 Jan 2004 04:20:15 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 25 Jan 2004 04:20:15 -0800 (PST) Resent-Message-Id: <200401251220.i0PCKFUh068233@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Edwin Groothuis Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C0E016A4CF for ; Sun, 25 Jan 2004 04:16:22 -0800 (PST) Received: from mag.barnet.com.au (mag.barnet.com.au [218.185.88.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DBA843D45 for ; Sun, 25 Jan 2004 04:16:19 -0800 (PST) (envelope-from edwin@mavetju.org) Received: from extmail.barnet.com.au (tim.direct.int.barnet.com.au [10.10.10.2]) by mag.barnet.com.au (Postfix) with ESMTP id ED13A243 for ; Sun, 25 Jan 2004 23:16:16 +1100 (EST) Received: from extmail-auth.barnet.com.au (localhost [127.0.0.1]) by extmail.barnet.com.au (Postfix) with ESMTP id 9AAF01E0C for ; Sun, 25 Jan 2004 23:16:16 +1100 (EST) Received: from k7.mavetju (unknown [192.168.1.1]) by extmail-auth.barnet.com.au (Postfix) with ESMTP id C47911E07 for ; Sun, 25 Jan 2004 23:16:15 +1100 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id E9D6A6A7101; Sun, 25 Jan 2004 23:16:12 +1100 (EST) Message-Id: <20040125121612.E9D6A6A7101@k7.mavetju> Date: Sun, 25 Jan 2004 23:16:12 +1100 (EST) From: Edwin Groothuis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/61877: [maintainer update] enhance bsd.sdl.mk with WANT_SDL X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Edwin Groothuis List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2004 12:20:19 -0000 >Number: 61877 >Category: ports >Synopsis: [maintainer update] enhance bsd.sdl.mk with WANT_SDL >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Jan 25 04:20:14 PST 2004 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 4.8-RELEASE i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 4.8-RELEASE FreeBSD 4.8-RELEASE #1: Mon Jan 5 18:59:31 EST 2004 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386 >Description: Certain ports like to check for the availability of SDL libraries before including them, for example multimedia/mjpegtools. >How-To-Repeat: >Fix: Just like bsd.gnome.mk has WANT_GNOME, introduce a WANT_SDL. It will return a list of all available SDL libraries. Then the port modify USE_SDL where needed. For example for multimedia/mjpegtools, the makefile should have be changed to: Index: Makefile =================================================================== RCS file: /home/pcvs/ports/multimedia/mjpegtools/Makefile,v retrieving revision 1.24 diff -u -r1.24 Makefile --- Makefile 28 Jun 2003 21:55:28 -0000 1.24 +++ Makefile 25 Jan 2004 12:14:36 -0000 @@ -28,6 +28,7 @@ LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS:S/"//g}" \ PTHREAD_LIBS="${PTHREAD_LIBS:S/"//g}" WANT_GNOME= yes +WANT_SDL= yes MAN1= divxdec.1 jpeg2yuv.1 lav2divx.1 lav2mpeg.1 lav2wav.1 lav2yuv.1 \ lavpipe.1 lavplay.1 lavrec.1 lavtrans.1 mjpegtools.1 mp2enc.1 \ @@ -77,7 +76,7 @@ WITH_QUICKTIME= yes .endif # SDL -.if exists(${LOCALBASE}/lib/libSDL-1.1.so.5) +.if ${HAVE_SDL:Msdl}!="" WITH_SDL= yes .endif See. No more evil version numbers. This is the patch to bsd.port.mk and bsd.sdl.mk: Index: bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.483 diff -u -r1.483 bsd.port.mk --- bsd.port.mk 24 Jan 2004 01:26:30 -0000 1.483 +++ bsd.port.mk 25 Jan 2004 12:04:23 -0000 @@ -362,6 +362,7 @@ # Used only when USE_MOTIF is set. Implies # NO_OPENMOTIF. # USE_SDL - Says that the port uses the sdl libraries. +# See bsd.sdl.mk for more information. # USE_XPM - Says that the port uses the xpm graphics libraries. ## # USE_OPENSSL - Says that the port relies on the OpenSSL package. @@ -1214,6 +1215,7 @@ .endif .include "${PORTSDIR}/Mk/bsd.gnome.mk" +.include "${PORTSDIR}/Mk/bsd.sdl.mk" # defaults to 4.x for 5.0-CURRENT and 4.5-STABLE; and 3.3.6 for all other branches .if ${OSVERSION} > 500025 || ( ${OSVERSION} >= 450005 && ${OSVERSION} < 500000 ) @@ -1623,10 +1625,6 @@ RUN_DEPENDS+= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base .endif -.if defined(USE_SDL) -.include "${PORTSDIR}/Mk/bsd.sdl.mk" -.endif - .if defined(USE_MOTIF) USE_XPM= yes .if defined(WANT_LESSTIF) @@ -1757,6 +1755,7 @@ .endif .include "${PORTSDIR}/Mk/bsd.gnome.mk" +.include "${PORTSDIR}/Mk/bsd.sdl.mk" .if defined(USE_PYTHON) .include "${PORTSDIR}/Mk/bsd.python.mk" Index: bsd.sdl.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.sdl.mk,v retrieving revision 1.2 diff -u -r1.2 bsd.sdl.mk --- bsd.sdl.mk 21 Jan 2004 10:01:54 -0000 1.2 +++ bsd.sdl.mk 25 Jan 2004 12:04:23 -0000 @@ -16,14 +16,22 @@ # the standard SDL and SDL_sound, use "USE_SDL=sdl sound" and the # required libraries are included in your LIB_DEPENDS. # +# If you want to check for the availability for certain SDL ports, you +# can set WANT_SDL and run it through bsd.port.pre.mk: +# WANT_SDL= yes +# USE_SDL= sdl +# .include +# .if ${HAVE_SDL:Mgraphics} +# USE_SDL+= graphics +# .endif +# .include +# Run "make -v USE_SDL" to see which libs are asked for at the end. +# # # $FreeBSD: ports/Mk/bsd.sdl.mk,v 1.2 2004/01/21 10:01:54 krion Exp $ # -.if !defined(SDL_Include) - -SDL_Include= bsd.sdl.mk SDL_Include_MAINTAINER= edwin@FreeBSD.org # @@ -32,13 +40,6 @@ _USE_SDL_ALL= gfx gui image mixer ldbad mm net sdl sound ttf # -# Keep some backward compatibility -# -.if ${USE_SDL}=="yes" -USE_SDL=sdl -.endif - -# # Variables used to determine what is needed: # _VERSION_xxx version of the shared library (required) # _SUBDIR_xxx subdirectory below ${PORTSDIR} (required) @@ -107,6 +108,41 @@ .endfor # +# If WANT_SDL is defined, check for the available libraries +# +.if !defined(AFTERPORTMK) +.if !defined(SDL_Include_pre) + +SDL_Include_pre= bsd.sdl.mk + +.if defined(WANT_SDL) +.for component in ${_USE_SDL_ALL} +.if exists(${LOCALBASE}/lib/lib${_LIB_${component}}.so.${_VERSION_${component}}) +HAVE_SDL+= ${component} +.endif +.endfor +.endif + +.endif +.endif + +# +# If USE_SDL is defined, make dependencies for the libraries +# +.if !defined(BEFOREPORTMK) +.if !defined(SDL_Include_post) +.if defined(USE_SDL) + +SDL_Include_post= bsd.sdl.mk + +# +# Keep some backward compatibility +# +.if ${USE_SDL}=="yes" +USE_SDL= sdl +.endif + +# # Check if all the values given in USE_SDL are valid. # _USE_SDL= @@ -142,4 +178,6 @@ CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} +.endif +.endif .endif >Release-Note: >Audit-Trail: >Unformatted: