From owner-svn-ports-all@freebsd.org  Mon Feb 11 15:21:27 2019
Return-Path: <owner-svn-ports-all@freebsd.org>
Delivered-To: svn-ports-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7AE14D9D40;
 Mon, 11 Feb 2019 15:21:26 +0000 (UTC)
 (envelope-from amdmi3@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9373572160;
 Mon, 11 Feb 2019 15:21:26 +0000 (UTC)
 (envelope-from amdmi3@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 882691A87;
 Mon, 11 Feb 2019 15:21:26 +0000 (UTC)
 (envelope-from amdmi3@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1BFLQLn033621;
 Mon, 11 Feb 2019 15:21:26 GMT (envelope-from amdmi3@FreeBSD.org)
Received: (from amdmi3@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1BFLQJo033618;
 Mon, 11 Feb 2019 15:21:26 GMT (envelope-from amdmi3@FreeBSD.org)
Message-Id: <201902111521.x1BFLQJo033618@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to
 amdmi3@FreeBSD.org using -f
From: Dmitry Marakasov <amdmi3@FreeBSD.org>
Date: Mon, 11 Feb 2019 15:21:26 +0000 (UTC)
To: ports-committers@freebsd.org, svn-ports-all@freebsd.org,
 svn-ports-head@freebsd.org
Subject: svn commit: r492696 - in head/Mk: . Uses
X-SVN-Group: ports-head
X-SVN-Commit-Author: amdmi3
X-SVN-Commit-Paths: in head/Mk: . Uses
X-SVN-Commit-Revision: 492696
X-SVN-Commit-Repository: ports
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 9373572160
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
 local_wl_from(0.00)[FreeBSD.org];
 NEURAL_HAM_MEDIUM(-1.00)[-0.997,0];
 NEURAL_HAM_SHORT(-0.97)[-0.972,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]
X-BeenThere: svn-ports-all@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the ports tree <svn-ports-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-ports-all>,
 <mailto:svn-ports-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-ports-all/>
List-Post: <mailto:svn-ports-all@freebsd.org>
List-Help: <mailto:svn-ports-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-ports-all>,
 <mailto:svn-ports-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Feb 2019 15:21:27 -0000

Author: amdmi3
Date: Mon Feb 11 15:21:25 2019
New Revision: 492696
URL: https://svnweb.freebsd.org/changeset/ports/492696

Log:
  Convert bsd.sdl.mk to Uses/sdl.mk
  
  Frow now on, USES=sdl should be used to specify dependency on SDL
  libraries.
  USE_SDL is still required to specify components, specifying it
  without USES=sdl is still supported, but deprecated, and leads to
  a warning. USE_SDL=yes support was removed, and now leads to error,
  USE_SDL=sdl should be used instead (all ports which still used
  USE_SDL=yes were fixed). sdl.mk was simplified and modernized along
  the way.
  
  PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235561
  Approved by:	portmgr (mat)
  Exp-run by:	antoine
  Differential Revision:	https://reviews.freebsd.org/D19075

Added:
  head/Mk/Uses/sdl.mk
     - copied, changed from r492695, head/Mk/bsd.sdl.mk
Deleted:
  head/Mk/bsd.sdl.mk
Modified:
  head/Mk/bsd.port.mk
  head/Mk/bsd.sanity.mk

Copied and modified: head/Mk/Uses/sdl.mk (from r492695, head/Mk/bsd.sdl.mk)
==============================================================================
--- head/Mk/bsd.sdl.mk	Mon Feb 11 14:23:58 2019	(r492695, copy source)
+++ head/Mk/Uses/sdl.mk	Mon Feb 11 15:21:25 2019	(r492696)
@@ -1,185 +1,112 @@
-#-*- tab-width: 4; -*-
-# ex:ts=4
+# $FreeBSD$
 #
-# bsd.sdl.mk - Support for SDL-based ports.
+# Support for SDL-based ports
 #
-# Created by: Edwin Groothuis <edwin@freebsd.org>
+# Feature:	sdl
+# Usage:	USES=sdl
+#		USE_SDL=sdl console gfx image mixer mm net pango sound ttf
+#		        sdl2 gfx2 image2 mixer2 net2 ttf2
 #
-# For FreeBSD committers:
-# - Changes in the version number of the shared libraries are encouraged.
-# - For the rest, please try to run them via the maintainer but feel free
-#   to commit themselves if nothing breaks.
+#		USE_SDL specifies which SDL components to add as dependencies.
+#		Not specifying USE_SDL with USES=sdl is an error.
+#		USE_SDL=yes implies USE_SDL=sdl.  This is deprecated
 #
-# For ports-developers:
-# If your port needs SDL or one of the SDL modules, you can easily
-# include them with the "USE_SDL=" statement. For example if you need
-# the standard SDL and SDL_sound, use "USE_SDL=sdl sound" and the
-# required libraries are included in your LIB_DEPENDS.
-#
+# MAINTAINER:	amdmi3@FreeBSD.org
 
-#
-# $FreeBSD$
-#
+.if !defined(_INCLUDE_USES_SDL_MK)
+_INCLUDE_USES_SDL_MK=		yes
 
-SDL_Include_MAINTAINER=		ports@FreeBSD.org
-
-#
 # These are the current supported SDL1.2 modules
-#
-_USE_SDL_ALL=	console gfx image mixer mm net pango sdl sound ttf
-#
-# These are the current supported SDL2 modules
-#
-_USE_SDL_ALL+=	gfx2 image2 mixer2 net2 sdl2 ttf2
+_SDL_USE_ALL=	sdl console gfx image mixer mm net pango sound ttf
 
-#
-# Variables used to determine what is needed:
-# _SUBDIR_xxx	subdirectory below ${PORTSDIR} (required)
-# _PORTDIR_xxx	subdirectory below ${PORTSDIR}/${_SUBDIR_xxx}
-# _LIB_xxx		name of the shared lib
-# _REQUIRES_xxx	also needs these SDL libraries
-#
+_SDL_sdl_LIB_DEPENDS=		libSDL.so:devel/sdl12
 
-_SUBDIR_console=	devel
-_PORTDIR_console=	sdl_console
-_LIB_console=		libSDL_console.so
-_REQUIRES_console=	sdl
+_SDL_console_LIB_DEPENDS=	libSDL_console.so:devel/sdl_console
+_SDL_console_REQUIRES=		sdl
 
-_SUBDIR_gfx=	graphics
-_PORTDIR_gfx=	sdl_gfx
-_LIB_gfx=	libSDL_gfx.so
-_REQUIRES_gfx=	sdl
+_SDL_gfx_LIB_DEPENDS=		libSDL_gfx.so:graphics/sdl_gfx
+_SDL_gfx_REQUIRES=		sdl
 
-_SUBDIR_image=	graphics
-_PORTDIR_image=	sdl_image
-_LIB_image=	libSDL_image.so
-_REQUIRES_image=sdl
+_SDL_image_LIB_DEPENDS=		libSDL_image.so:graphics/sdl_image
+_SDL_image_REQUIRES=		sdl
 
-_SUBDIR_mixer=	audio
-_PORTDIR_mixer=	sdl_mixer
-_LIB_mixer=	libSDL_mixer.so
-_REQUIRES_mixer=sdl
+_SDL_mixer_LIB_DEPENDS=		libSDL_mixer.so:audio/sdl_mixer
+_SDL_mixer_REQUIRES=		sdl
 
-_SUBDIR_mm=	devel
-_PORTDIR_mm=	sdlmm
-_LIB_mm=	libSDLmm.so
-_REQUIRES_mm=	sdl
+_SDL_mm_LIB_DEPENDS=		libSDLmm.so:devel/sdlmm
+_SDL_mm_REQUIRES=		sdl
 
-_SUBDIR_net=	net
-_PORTDIR_net=	sdl_net
-_LIB_net=	libSDL_net.so
-_REQUIRES_net=	sdl
+_SDL_net_LIB_DEPENDS=		libSDL_net.so:net/sdl_net
+_SDL_net_REQUIRES=		sdl
 
-_SUBDIR_pango=	x11-toolkits
-_PORTDIR_pango=	sdl_pango
-_LIB_pango=	libSDL_Pango.so
-_REQUIRES_pango=sdl
+_SDL_pango_LIB_DEPENDS=		libSDL_Pango.so:x11-toolkits/sdl_pango
+_SDL_pango_REQUIRES=		sdl
 
-_SUBDIR_sdl=	devel
-_PORTDIR_sdl=	sdl12
-_LIB_sdl=	libSDL.so
-_REQUIRES_sdl=
+_SDL_sound_LIB_DEPENDS=		libSDL_sound.so:audio/sdl_sound
+_SDL_sound_REQUIRES=		sdl
 
-_SUBDIR_sound=	audio
-_PORTDIR_sound=	sdl_sound
-_LIB_sound=	libSDL_sound.so
-_REQUIRES_sound=sdl
+_SDL_ttf_LIB_DEPENDS=		libSDL_ttf.so:graphics/sdl_ttf
+_SDL_ttf_REQUIRES=		sdl
 
-_SUBDIR_ttf=	graphics
-_PORTDIR_ttf=	sdl_ttf
-_LIB_ttf=	libSDL_ttf.so
-_REQUIRES_ttf=	sdl
+# These are the current supported SDL2 modules
+_SDL_USE_ALL+=	sdl2 gfx2 image2 mixer2 net2 ttf2
 
-_SUBDIR_gfx2=	graphics
-_PORTDIR_gfx2=	sdl2_gfx
-_LIB_gfx2=	libSDL2_gfx.so
-_REQUIRES_gfx2=	sdl2
+_SDL_sdl2_LIB_DEPENDS=		libSDL2.so:devel/sdl20
 
-_SUBDIR_image2=		graphics
-_PORTDIR_image2=	sdl2_image
-_LIB_image2=		libSDL2_image.so
-_REQUIRES_image2=	sdl2
+_SDL_gfx2_LIB_DEPENDS=		libSDL2_gfx.so:graphics/sdl2_gfx
+_SDL_gfx2_REQUIRES=		sdl2
 
-_SUBDIR_mixer2=		audio
-_PORTDIR_mixer2=	sdl2_mixer
-_LIB_mixer2=		libSDL2_mixer.so
-_REQUIRES_mixer2=	sdl2
+_SDL_image2_LIB_DEPENDS=	libSDL2_image.so:graphics/sdl2_image
+_SDL_image2_REQUIRES=		sdl2
 
-_SUBDIR_net2=	net
-_PORTDIR_net2=	sdl2_net
-_LIB_net2=	libSDL2_net.so
-_REQUIRES_net2=	sdl2
+_SDL_mixer2_LIB_DEPENDS=	libSDL2_mixer.so:audio/sdl2_mixer
+_SDL_mixer2_REQUIRES=		sdl2
 
-_SUBDIR_sdl2=	devel
-_PORTDIR_sdl2=	sdl20
-_LIB_sdl2=	libSDL2.so
-_REQUIRES_sdl2=
+_SDL_net2_LIB_DEPENDS=		libSDL2_net.so:net/sdl2_net
+_SDL_net2_REQUIRES=		sdl2
 
-_SUBDIR_ttf2=	graphics
-_PORTDIR_ttf2=	sdl2_ttf
-_LIB_ttf2=	libSDL2_ttf.so
-_REQUIRES_ttf2=	sdl2
+_SDL_ttf2_LIB_DEPENDS=		libSDL2_ttf.so:graphics/sdl2_ttf
+_SDL_ttf2_REQUIRES=		sdl2
 
-#
-# If USE_SDL is defined, make dependencies for the libraries
-#
-.if !defined(BEFOREPORTMK)
-.if !defined(SDL_Include_post)
-.if defined(USE_SDL)
+# Basic checks
+.if !empty(sdl_ARGS)
+IGNORE=		USES=sdl takes no arguments
+.endif
 
-SDL_Include_post=	bsd.sdl.mk
-
-#
-# Keep some backward compatibility
-#
-.if ${USE_SDL}=="yes"
-USE_SDL=	sdl
+.if !defined(USE_SDL)
+IGNORE=		need to specify sdl component(s) with USE_SDL
 .endif
 
-#
-# Check if all the values given in USE_SDL are valid.
-#
+# Expand implied dependencies on main SDL/SDL2 ports
 _USE_SDL=
-.for component in ${USE_SDL}
-. if ${_USE_SDL_ALL:M${component}}==""
-IGNORE=	cannot install: unknown SDL component ${component}
+.for _component in ${USE_SDL}
+. if !${_SDL_USE_ALL:M${_component}}
+IGNORE=		uses unknown SDL component ${_component}
+. else
+_USE_SDL+=	${_component} ${_SDL_${_component}_REQUIRES}
 . endif
-_USE_SDL+=	${_REQUIRES_${component}} ${component}
 .endfor
 
-#
-# Uniquefy[sp] the list of libs required
-#
-__USE_SDL=
-.for component in ${_USE_SDL}
-. if ${__USE_SDL:M${component}}==""
-__USE_SDL+= ${component}
-. endif
+# Provide LIB_DEPENDS
+.for _component in ${_USE_SDL:O:u}
+LIB_DEPENDS+=	${_SDL_${_component}_LIB_DEPENDS}
 .endfor
 
-#
-# Finally make the list of libs required
-#
-.for component in ${__USE_SDL}
-LIB_DEPENDS+=	${_LIB_${component}}:${_SUBDIR_${component}}/${_PORTDIR_${component}}
-.endfor
-
-#
-# "Normal" dependencies and variables
-#
-.if ${__USE_SDL:Msdl} != ""
-BUILD_DEPENDS+=	${SDL_CONFIG}:${_SUBDIR_sdl}/${_PORTDIR_sdl}
+# Provide dependency on main SDL ports
+.if ${_USE_SDL:Msdl}
 SDL_CONFIG?=	${LOCALBASE}/bin/sdl-config
+BUILD_DEPENDS+=	${SDL_CONFIG}:devel/sdl12
 CONFIGURE_ENV+=	SDL_CONFIG=${SDL_CONFIG}
-MAKE_ENV+=		SDL_CONFIG=${SDL_CONFIG}
+MAKE_ENV+=	SDL_CONFIG=${SDL_CONFIG}
 .endif
-.if ${__USE_SDL:Msdl2} != ""
-BUILD_DEPENDS+=	${SDL2_CONFIG}:${_SUBDIR_sdl2}/${_PORTDIR_sdl2}
+
+.if ${_USE_SDL:Msdl2}
 SDL2_CONFIG?=	${LOCALBASE}/bin/sdl2-config
+BUILD_DEPENDS+=	${SDL2_CONFIG}:devel/sdl20
 CONFIGURE_ENV+=	SDL2_CONFIG=${SDL2_CONFIG}
-MAKE_ENV+=		SDL2_CONFIG=${SDL2_CONFIG}
+MAKE_ENV+=	SDL2_CONFIG=${SDL2_CONFIG}
 .endif
 
+# _INCLUDE_USES_SDL_MK
 .endif
-.endif
-.endif
+

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Mon Feb 11 14:23:58 2019	(r492695)
+++ head/Mk/bsd.port.mk	Mon Feb 11 15:21:25 2019	(r492696)
@@ -364,8 +364,6 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 #				 Append the cxxflags to CXXFLAGS only on the specified architecture
 ##
 # LDFLAGS_${ARCH} Append the ldflags to LDFLAGS only on the specified architecture
-# USE_SDL		- If set, this port uses the sdl libraries.
-#				  See bsd.sdl.mk for more information.
 ##
 # USE_OPENLDAP	- If set, this port uses the OpenLDAP libraries.
 #				  Implies: WANT_OPENLDAP_VER?=24
@@ -1425,6 +1423,11 @@ DEV_WARNING+=	"Using USE_GL alone is deprecated, pleas
 USES+=	gl
 .endif
 
+.if defined(USE_SDL) && (!defined(USES) || !${USES:Msdl})
+DEV_WARNING+=	"Using USE_SDL alone is deprecated, please add USES=sdl."
+USES+=	sdl
+.endif
+
 .if defined(USE_MYSQL)
 USE_MYSQL:=		${USE_MYSQL:N[yY][eE][sS]:Nclient}
 .if defined(WANT_MYSQL_VER)
@@ -1445,10 +1448,6 @@ USES+=mysql:${USE_MYSQL}
 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
 .endif
 
-.if defined(USE_SDL)
-.include "${PORTSDIR}/Mk/bsd.sdl.mk"
-.endif
-
 .if !defined(UID)
 UID!=	${ID} -u
 .endif
@@ -1942,10 +1941,6 @@ _FORCE_POST_PATTERNS=	rmdir kldxref mkfontscale mkfont
 
 .if defined(USE_OCAML)
 .include "${PORTSDIR}/Mk/bsd.ocaml.mk"
-.endif
-
-.if defined(USE_SDL)
-.include "${PORTSDIR}/Mk/bsd.sdl.mk"
 .endif
 
 .if defined(USE_PHP) && (!defined(USES) || ( defined(USES) && !${USES:Mphp*} ))

Modified: head/Mk/bsd.sanity.mk
==============================================================================
--- head/Mk/bsd.sanity.mk	Mon Feb 11 14:23:58 2019	(r492695)
+++ head/Mk/bsd.sanity.mk	Mon Feb 11 15:21:25 2019	(r492696)
@@ -86,6 +86,10 @@ DEV_ERROR+=	"USE_GNOME=pkgconfig is unsupported, pleas
 DEV_ERROR+=	"USE_ZOPE=yes is unsupported, please use USES=zope instead"
 .endif
 
+.if defined(USE_SDL) && ${USE_SDL} == yes
+DEV_ERROR+=	"USE_SDL=yes is unsupported, please use USE_SDL=sdl instead"
+.endif
+
 .if defined(USE_GITHUB) && defined(GH_COMMIT)
 DEV_ERROR+=	"GH_COMMIT is unsupported, please convert GHL-\>GH in MASTER_SITES and set GH_TAGNAME to tag or commit hash and remove GH_COMMIT"
 .endif