Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/sdl.mk
- This file was moved from Mk/bsd.sdl.mk.
#-*- tab-width: 4; -*- | # $FreeBSD$ | ||||
# ex:ts=4 | |||||
# | # | ||||
# 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: | # USE_SDL specifies which SDL components to add as dependencies. | ||||
# - Changes in the version number of the shared libraries are encouraged. | # Not specifying USE_SDL with USES=sdl is an error. | ||||
# - For the rest, please try to run them via the maintainer but feel free | # USE_SDL=yes implies USE_SDL=sdl. This is deprecated | ||||
# to commit themselves if nothing breaks. | |||||
# | # | ||||
# For ports-developers: | # MAINTAINER: amdmi3@FreeBSD.org | ||||
# 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. | |||||
# | |||||
# | .if !defined(_INCLUDE_USES_SDL_MK) | ||||
# $FreeBSD: head/Mk/bsd.sdl.mk 433963 2017-02-12 20:39:55Z rene $ | _INCLUDE_USES_SDL_MK= yes | ||||
# | |||||
SDL_Include_MAINTAINER= ports@FreeBSD.org | |||||
# | |||||
# These are the current supported SDL1.2 modules | # These are the current supported SDL1.2 modules | ||||
# | _SDL_USE_ALL= sdl console gfx image mixer mm net pango sound ttf | ||||
_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_sdl_LIB_DEPENDS= libSDL.so:devel/sdl12 | ||||
# 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 | _SDL_console_LIB_DEPENDS= libSDL_console.so:devel/sdl_console | ||||
_PORTDIR_console= sdl_console | _SDL_console_REQUIRES= sdl | ||||
_LIB_console= libSDL_console.so | |||||
_REQUIRES_console= sdl | |||||
_SUBDIR_gfx= graphics | _SDL_gfx_LIB_DEPENDS= libSDL_gfx.so:graphics/sdl_gfx | ||||
_PORTDIR_gfx= sdl_gfx | _SDL_gfx_REQUIRES= sdl | ||||
_LIB_gfx= libSDL_gfx.so | |||||
_REQUIRES_gfx= sdl | |||||
_SUBDIR_image= graphics | _SDL_image_LIB_DEPENDS= libSDL_image.so:graphics/sdl_image | ||||
_PORTDIR_image= sdl_image | _SDL_image_REQUIRES= sdl | ||||
_LIB_image= libSDL_image.so | |||||
_REQUIRES_image=sdl | |||||
_SUBDIR_mixer= audio | _SDL_mixer_LIB_DEPENDS= libSDL_mixer.so:audio/sdl_mixer | ||||
_PORTDIR_mixer= sdl_mixer | _SDL_mixer_REQUIRES= sdl | ||||
_LIB_mixer= libSDL_mixer.so | |||||
_REQUIRES_mixer=sdl | |||||
_SUBDIR_mm= devel | _SDL_mm_LIB_DEPENDS= libSDLmm.so:devel/sdlmm | ||||
_PORTDIR_mm= sdlmm | _SDL_mm_REQUIRES= sdl | ||||
_LIB_mm= libSDLmm.so | |||||
_REQUIRES_mm= sdl | |||||
_SUBDIR_net= net | _SDL_net_LIB_DEPENDS= libSDL_net.so:net/sdl_net | ||||
_PORTDIR_net= sdl_net | _SDL_net_REQUIRES= sdl | ||||
_LIB_net= libSDL_net.so | |||||
_REQUIRES_net= sdl | |||||
_SUBDIR_pango= x11-toolkits | _SDL_pango_LIB_DEPENDS= libSDL_Pango.so:x11-toolkits/sdl_pango | ||||
_PORTDIR_pango= sdl_pango | _SDL_pango_REQUIRES= sdl | ||||
_LIB_pango= libSDL_Pango.so | |||||
_REQUIRES_pango=sdl | |||||
_SUBDIR_sdl= devel | _SDL_sound_LIB_DEPENDS= libSDL_sound.so:audio/sdl_sound | ||||
_PORTDIR_sdl= sdl12 | _SDL_sound_REQUIRES= sdl | ||||
_LIB_sdl= libSDL.so | |||||
_REQUIRES_sdl= | |||||
_SUBDIR_sound= audio | _SDL_ttf_LIB_DEPENDS= libSDL_ttf.so:graphics/sdl_ttf | ||||
_PORTDIR_sound= sdl_sound | _SDL_ttf_REQUIRES= sdl | ||||
_LIB_sound= libSDL_sound.so | |||||
_REQUIRES_sound=sdl | |||||
_SUBDIR_ttf= graphics | # These are the current supported SDL2 modules | ||||
_PORTDIR_ttf= sdl_ttf | _SDL_USE_ALL+= sdl2 gfx2 image2 mixer2 net2 ttf2 | ||||
_LIB_ttf= libSDL_ttf.so | |||||
_REQUIRES_ttf= sdl | |||||
_SUBDIR_gfx2= graphics | _SDL_sdl2_LIB_DEPENDS= libSDL2.so:devel/sdl20 | ||||
_PORTDIR_gfx2= sdl2_gfx | |||||
_LIB_gfx2= libSDL2_gfx.so | |||||
_REQUIRES_gfx2= sdl2 | |||||
_SUBDIR_image2= graphics | _SDL_gfx2_LIB_DEPENDS= libSDL2_gfx.so:graphics/sdl2_gfx | ||||
_PORTDIR_image2= sdl2_image | _SDL_gfx2_REQUIRES= sdl2 | ||||
_LIB_image2= libSDL2_image.so | |||||
_REQUIRES_image2= sdl2 | |||||
_SUBDIR_mixer2= audio | _SDL_image2_LIB_DEPENDS= libSDL2_image.so:graphics/sdl2_image | ||||
_PORTDIR_mixer2= sdl2_mixer | _SDL_image2_REQUIRES= sdl2 | ||||
_LIB_mixer2= libSDL2_mixer.so | |||||
_REQUIRES_mixer2= sdl2 | |||||
_SUBDIR_net2= net | _SDL_mixer2_LIB_DEPENDS= libSDL2_mixer.so:audio/sdl2_mixer | ||||
_PORTDIR_net2= sdl2_net | _SDL_mixer2_REQUIRES= sdl2 | ||||
_LIB_net2= libSDL2_net.so | |||||
_REQUIRES_net2= sdl2 | |||||
_SUBDIR_sdl2= devel | _SDL_net2_LIB_DEPENDS= libSDL2_net.so:net/sdl2_net | ||||
_PORTDIR_sdl2= sdl20 | _SDL_net2_REQUIRES= sdl2 | ||||
_LIB_sdl2= libSDL2.so | |||||
_REQUIRES_sdl2= | |||||
_SUBDIR_ttf2= graphics | _SDL_ttf2_LIB_DEPENDS= libSDL2_ttf.so:graphics/sdl2_ttf | ||||
_PORTDIR_ttf2= sdl2_ttf | _SDL_ttf2_REQUIRES= sdl2 | ||||
_LIB_ttf2= libSDL2_ttf.so | |||||
_REQUIRES_ttf2= sdl2 | |||||
# | # Basic checks | ||||
# If USE_SDL is defined, make dependencies for the libraries | .if !empty(sdl_ARGS) | ||||
# | IGNORE= USES=sdl takes no arguments | ||||
.if !defined(BEFOREPORTMK) | .endif | ||||
.if !defined(SDL_Include_post) | |||||
.if defined(USE_SDL) | |||||
SDL_Include_post= bsd.sdl.mk | .if !defined(USE_SDL) | ||||
IGNORE= need to specify sdl component(s) with USE_SDL | |||||
# | |||||
# Keep some backward compatibility | |||||
# | |||||
.if ${USE_SDL}=="yes" | |||||
USE_SDL= sdl | |||||
.endif | .endif | ||||
mat: It would probably be a better idea to change this to a `DEV_ERROR`, and to move it in Mk/bsd. | |||||
Done Inline ActionsAgreed, already working on this. AMDmi3: Agreed, already working on this. | |||||
# | # Expand implied dependencies on main SDL/SDL2 ports | ||||
# Check if all the values given in USE_SDL are valid. | |||||
# | |||||
_USE_SDL= | _USE_SDL= | ||||
.for component in ${USE_SDL} | .for _component in ${USE_SDL} | ||||
. if ${_USE_SDL_ALL:M${component}}=="" | . if !${_SDL_USE_ALL:M${_component}} | ||||
IGNORE= cannot install: unknown SDL component ${component} | IGNORE= uses unknown SDL component ${_component} | ||||
. else | |||||
_USE_SDL+= ${_component} ${_SDL_${_component}_REQUIRES} | |||||
. endif | . endif | ||||
_USE_SDL+= ${_REQUIRES_${component}} ${component} | |||||
.endfor | .endfor | ||||
# | # Provide LIB_DEPENDS | ||||
# Uniquefy[sp] the list of libs required | .for _component in ${_USE_SDL:O:u} | ||||
# | LIB_DEPENDS+= ${_SDL_${_component}_LIB_DEPENDS} | ||||
__USE_SDL= | |||||
.for component in ${_USE_SDL} | |||||
. if ${__USE_SDL:M${component}}=="" | |||||
__USE_SDL+= ${component} | |||||
. endif | |||||
.endfor | .endfor | ||||
# | # Provide dependency on main SDL ports | ||||
# Finally make the list of libs required | .if ${_USE_SDL:Msdl} | ||||
# | |||||
.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 | SDL_CONFIG?= ${LOCALBASE}/bin/sdl-config | ||||
BUILD_DEPENDS+= ${SDL_CONFIG}:devel/sdl12 | |||||
CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} | CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} | ||||
MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} | MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} | ||||
.endif | .endif | ||||
.if ${__USE_SDL:Msdl2} != "" | |||||
BUILD_DEPENDS+= ${SDL2_CONFIG}:${_SUBDIR_sdl2}/${_PORTDIR_sdl2} | .if ${_USE_SDL:Msdl2} | ||||
SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config | SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config | ||||
BUILD_DEPENDS+= ${SDL2_CONFIG}:devel/sdl20 | |||||
CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} | CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} | ||||
MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} | MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG} | ||||
.endif | .endif | ||||
# _INCLUDE_USES_SDL_MK | |||||
.endif | .endif | ||||
.endif | |||||
.endif |
It would probably be a better idea to change this to a DEV_ERROR, and to move it in Mk/bsd.sanity.mk, and to patch the dozen ports or so that use USE_SDL=yes or opt_USE= sdl=yes.