Index: Mk/Uses/sdl.mk =================================================================== --- Mk/Uses/sdl.mk +++ Mk/Uses/sdl.mk @@ -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 +# 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: head/Mk/bsd.sdl.mk 433963 2017-02-12 20:39:55Z rene $ -# +.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 + Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -364,8 +364,6 @@ # 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 @@ 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 @@ .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 @@ .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*} )) Index: Mk/bsd.sanity.mk =================================================================== --- Mk/bsd.sanity.mk +++ Mk/bsd.sanity.mk @@ -86,6 +86,10 @@ 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 Index: Mk/bsd.sdl.mk =================================================================== --- Mk/bsd.sdl.mk +++ Mk/bsd.sdl.mk @@ -1,185 +0,0 @@ -#-*- tab-width: 4; -*- -# ex:ts=4 -# -# bsd.sdl.mk - Support for SDL-based ports. -# -# Created by: Edwin Groothuis -# -# 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. -# -# 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. -# - -# -# $FreeBSD$ -# - -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 - -# -# 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 -# - -_SUBDIR_console= devel -_PORTDIR_console= sdl_console -_LIB_console= libSDL_console.so -_REQUIRES_console= sdl - -_SUBDIR_gfx= graphics -_PORTDIR_gfx= sdl_gfx -_LIB_gfx= libSDL_gfx.so -_REQUIRES_gfx= sdl - -_SUBDIR_image= graphics -_PORTDIR_image= sdl_image -_LIB_image= libSDL_image.so -_REQUIRES_image=sdl - -_SUBDIR_mixer= audio -_PORTDIR_mixer= sdl_mixer -_LIB_mixer= libSDL_mixer.so -_REQUIRES_mixer=sdl - -_SUBDIR_mm= devel -_PORTDIR_mm= sdlmm -_LIB_mm= libSDLmm.so -_REQUIRES_mm= sdl - -_SUBDIR_net= net -_PORTDIR_net= sdl_net -_LIB_net= libSDL_net.so -_REQUIRES_net= sdl - -_SUBDIR_pango= x11-toolkits -_PORTDIR_pango= sdl_pango -_LIB_pango= libSDL_Pango.so -_REQUIRES_pango=sdl - -_SUBDIR_sdl= devel -_PORTDIR_sdl= sdl12 -_LIB_sdl= libSDL.so -_REQUIRES_sdl= - -_SUBDIR_sound= audio -_PORTDIR_sound= sdl_sound -_LIB_sound= libSDL_sound.so -_REQUIRES_sound=sdl - -_SUBDIR_ttf= graphics -_PORTDIR_ttf= sdl_ttf -_LIB_ttf= libSDL_ttf.so -_REQUIRES_ttf= sdl - -_SUBDIR_gfx2= graphics -_PORTDIR_gfx2= sdl2_gfx -_LIB_gfx2= libSDL2_gfx.so -_REQUIRES_gfx2= sdl2 - -_SUBDIR_image2= graphics -_PORTDIR_image2= sdl2_image -_LIB_image2= libSDL2_image.so -_REQUIRES_image2= sdl2 - -_SUBDIR_mixer2= audio -_PORTDIR_mixer2= sdl2_mixer -_LIB_mixer2= libSDL2_mixer.so -_REQUIRES_mixer2= sdl2 - -_SUBDIR_net2= net -_PORTDIR_net2= sdl2_net -_LIB_net2= libSDL2_net.so -_REQUIRES_net2= sdl2 - -_SUBDIR_sdl2= devel -_PORTDIR_sdl2= sdl20 -_LIB_sdl2= libSDL2.so -_REQUIRES_sdl2= - -_SUBDIR_ttf2= graphics -_PORTDIR_ttf2= sdl2_ttf -_LIB_ttf2= libSDL2_ttf.so -_REQUIRES_ttf2= sdl2 - -# -# 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= -.for component in ${USE_SDL} -. if ${_USE_SDL_ALL:M${component}}=="" -IGNORE= cannot install: unknown SDL component ${component} -. 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 -.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} -SDL_CONFIG?= ${LOCALBASE}/bin/sdl-config -CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} -MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} -.endif -.if ${__USE_SDL:Msdl2} != "" -BUILD_DEPENDS+= ${SDL2_CONFIG}:${_SUBDIR_sdl2}/${_PORTDIR_sdl2} -SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config -CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} -MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} -.endif - -.endif -.endif -.endif