Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 23:16:12 +1100 (EST)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61877: [maintainer update] enhance bsd.sdl.mk with WANT_SDL
Message-ID:  <20040125121612.E9D6A6A7101@k7.mavetju>
Resent-Message-ID: <200401251220.i0PCKFUh068233@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <bsd.port.pre.mk>
+#	.if ${HAVE_SDL:Mgraphics}
+#	USE_SDL+=	graphics
+#	.endif
+#	.include <bsd.port.post.mk>
+# 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040125121612.E9D6A6A7101>