-
Notifications
You must be signed in to change notification settings - Fork 158
/
Makefile
66 lines (55 loc) · 2.2 KB
/
Makefile
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
56
57
58
59
60
61
62
63
64
65
66
# $NetBSD: Makefile,v 1.8 2022/12/07 17:08:38 jperkin Exp $
GITHUB_PROJECT= helix
DISTNAME= 22.12
PKGNAME= ${GITHUB_PROJECT}-${DISTNAME}
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_GITHUB:=helix-editor/}
DIST_SUBDIR= ${GITHUB_PROJECT}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://helix-editor.com/
COMMENT= Modal editor inspired by kakoune / neovim
# Additionally, the tree-sitter sources have various licenses.
LICENSE= mpl-2.0
WRKSRC= ${WRKDIR}/${GITHUB_PROJECT}-${DISTNAME}
USE_LANGUAGES+= c c++
USE_TOOLS+= pax
INSTALLATION_DIRS+= share/helix/runtime/grammars
INSTALLATION_DIRS+= bin
INSTALLATION_DIRS+= share/examples/helix/completion
.include "cargo-depends.mk"
.include "tree-sitter-depends.mk"
post-extract:
${MKDIR} ${WRKSRC}/runtime/grammars/sources
.for name rev url path in ${TS_FILES}
${LN} -s ${WRKDIR}/${name}-${rev} ${WRKSRC}/runtime/grammars/sources/${path}
.endfor
SUBST_CLASSES+= datadir
SUBST_STAGE.datadir= pre-configure
SUBST_MESSAGE.datadir= Fixing datadir
SUBST_FILES.datadir= helix-loader/src/lib.rs
SUBST_SED.datadir+= -e 's,%%DATADIR%%,${PREFIX}/share/helix,g'
.include "../../mk/bsd.prefs.mk"
post-build:
${RUN} cd ${WRKSRC} && env HELIX_RUNTIME=${WRKSRC}/runtime \
./target/release/hx --grammar build
.if ${OPSYS} == "Darwin"
${RUN} cd ${WRKSRC}/runtime/grammars && \
for f in *.so; do \
install_name_tool \
-id ${PREFIX}/share/helix/runtime/grammars/$${f} \
$${f}; \
done
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/target/release/hx ${DESTDIR}${PREFIX}/bin
cd ${WRKSRC}/runtime && ${PAX} -rw themes ${DESTDIR}${PREFIX}/share/helix/runtime/
cd ${WRKSRC}/runtime && ${PAX} -rw queries ${DESTDIR}${PREFIX}/share/helix/runtime/
cd ${WRKSRC}/contrib && ${PAX} -rw completion ${DESTDIR}${PREFIX}/share/examples/helix/
${INSTALL_DATA} ${WRKSRC}/runtime/tutor ${DESTDIR}${PREFIX}/share/helix/runtime/tutor
${INSTALL_LIB} ${WRKSRC}/runtime/grammars/*.so ${DESTDIR}${PREFIX}/share/helix/runtime/grammars/
.PHONY: print-tree-sitter-depends
print-tree-sitter-depends:
${RUN}${AWK} -f ${FILESDIR}/print-depends.awk ${WRKSRC}/languages.toml
.include "../../lang/rust/cargo.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"