summaryrefslogtreecommitdiff
path: root/editors/lite/Makefile
blob: 4d989df3a9358fb076254a5dcb9650e4ec0eb7f7 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>

PORTNAME=	lite
PORTVERSION=	1.11
CATEGORIES=	editors
PKGNAMESUFFIX=	-editor		# PORTNAME alone is too vague

MAINTAINER=	danfe@FreeBSD.org
COMMENT=	Lightweight text editor written mostly in Lua

PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES=	a38b89ca26dde1353cf1.patch:-p1

LICENSE=	MIT

USES=		gmake lua pkgconfig sdl
USE_SDL=	sdl2

USE_GITHUB=	yes
GH_ACCOUNT=	rxi
GH_PROJECT=	${PORTNAME}-colors:colors ${PORTNAME}-plugins:plugins
GH_TAGNAME=	38bd9b3 5b77292:colors 4a9e1f3:plugins

BUILD_WRKSRC=	${WRKSRC}/src
MAKEFILE=	${FILESDIR}/makefile

PORTDOCS=	usage.md

OPTIONS_DEFINE=	DOCS

post-extract:
# Prevent accidental build/use of bundled code/headers
	@${RM} -r ${BUILD_WRKSRC}/lib/lua52 ${WRKSRC}/winlib

post-patch:
	@${REINPLACE_CMD} -e '/^#include/s,lib/lua52/,,' \
		${BUILD_WRKSRC}/api/api.h
	@${REINPLACE_CMD} -e 's,%%DATADIR%%,${DATADIR},' \
		${BUILD_WRKSRC}/main.c

do-install:
	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} \
		${STAGEDIR}${PREFIX}/bin
	${CP} -a ${WRKSRC}/data ${STAGEDIR}${DATADIR}
	${CP} -a ${WRKSRC_colors}/colors ${STAGEDIR}${DATADIR}/user
	${MV} ${WRKSRC_plugins}/plugins/language_*.lua \
		${STAGEDIR}${DATADIR}/plugins
	${CP} -a ${WRKSRC_plugins}/plugins \
		${STAGEDIR}${DATADIR}/plugins/extra

do-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>