pkgsrc/graphics/librsvg/available.mk
leot 284dcb54c5 librsvg: Add available.mk and tool.mk mk fragments
Rename LIBRSVG_USE_RUST to LIBRSVG_TYPE.

Isolate the LIBRSVG_TYPE logic in available.mk mk fragments in
order that can be used by other librsvg mk (e.g. tool.mk) or by
other package to check the preferred librsvg implementation to be
used. (e.g. devel/pango, fonts/harfbuzz and misc/libreoffice).

Add a tool.mk mk fragment in order to be able to specify librsvg
as a tool dependency honoring user's LIBRSVG_TYPE.
Thanks to <wiz> for suggesting that!

Discussed on tech-pkg@:

 <https://mail-index.NetBSD.org/tech-pkg/2019/06/05/msg021393.html>
2019-06-08 19:51:38 +00:00

27 lines
586 B
Makefile

# $NetBSD: available.mk,v 1.1 2019/06/08 19:51:38 leot Exp $
#
# This mk fragment define LIBRSVG_TYPE variable used in other librsvg mk
# fragments.
#
# User-settable variables:
#
# LIBRSVG_TYPE
# Type of used librsvg implementation.
#
# Possible values: c rust
# Default: rust on platforms were Rust is supported
#
.if !defined(LIBRSVG_AVAILABLE_MK)
LIBRSVG_AVAILABLE_MK= defined
.include "../../mk/bsd.prefs.mk"
.include "../../lang/rust/platform.mk"
.if !empty(PLATFORM_SUPPORTS_RUST:M[Yy][Ee][Ss])
LIBRSVG_TYPE?= rust
.else
LIBRSVG_TYPE?= c
.endif
.endif # LIBRSVG_AVAILABLE_MK