summaryrefslogtreecommitdiff
path: root/devel/stylua/Makefile
blob: 7512246f7628329004d6801e66a65d8ff5f557cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
PORTNAME=	stylua
DISTVERSIONPREFIX=	v
DISTVERSION=	0.18.0
CATEGORIES=	devel

MAINTAINER=	lcook@FreeBSD.org
COMMENT=	Opinionated Lua code formatter
WWW=		https://github.com/JohnnyMorganz/StyLua

LICENSE=	MPL20
LICENSE_FILE=	${WRKSRC}/LICENSE.md

USES=		cargo
USE_GITHUB=	yes
GH_ACCOUNT=	JohnnyMorganz
GH_PROJECT=	StyLua

PLIST_FILES=	bin/${PORTNAME}
PORTDOCS=	CHANGELOG.md README.md

OPTIONS_DEFINE=		DOCS EDITORCONFIG LUAU
OPTIONS_DEFAULT=	EDITORCONFIG LUAU

EDITORCONFIG_DESC=	Build with EditorConfig support
LUAU_DESC=		Build with Luau support

EDITORCONFIG_VARS=	CARGO_FEATURES+=editorconfig
LUAU_VARS=		CARGO_FEATURES+=luau

.for _ver in 5.2 5.3 5.4
OPTIONS_DEFINE+=	LUA${_ver:C/\.//}
OPTIONS_DEFAULT+=	LUA${_ver:C/\.//}
LUA${_ver:C/\.//}_DESC=	Build with Lua ${_ver} support
LUA${_ver:C/\.//}_VARS=	CARGO_FEATURES+=lua${_ver:C/\.//}
.endfor

post-install:
	${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/${PORTNAME}

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} \
		${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>