summaryrefslogtreecommitdiff
path: root/editors/lapce/Makefile
blob: 7ebfd4bd10b0a0d8285095795c181304f641df30 (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
PORTNAME=	lapce
DISTVERSIONPREFIX=	v
DISTVERSION=	0.4.0-94 # Cargo.lock patched: `make patch cargo-crates`
DISTVERSIONSUFFIX=	-gdc9a24d8
CATEGORIES=	editors

MAINTAINER=	eduardo@FreeBSD.org
COMMENT=	Lightning-fast and Powerful Code Editor
WWW=		https://lapce.dev/

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE

NOT_FOR_ARCHS=	i386
NOT_FOR_ARCHS_REASON_i386=	doesn't build: [zstd-sys 2.0.1+zstd.1.5.2] AR_i686_unknown_freebsd = None

LIB_DEPENDS=	libssh2.so:security/libssh2 \
		libgit2.so:devel/libgit2
RUN_DEPENDS=	xdg-desktop-portal>0:deskutils/xdg-desktop-portal

USES=		cargo desktop-file-utils dos2unix gmake localbase:ldflags perl5 pkgconfig ssl xorg
USE_GITHUB=	yes
USE_XORG=	xcb

DOS2UNIX_FILES=	cargo-crates/slotmap-1.0.7/src/lib.rs

PLIST_FILES=	bin/lapce \
		bin/lapce-proxy \
		share/applications/dev.lapce.lapce.desktop \
		share/pixmaps/dev.lapce.lapce.png

PORTSCOUT=	skipv:0.6.0

# OPENSSL_NO_VENDOR needs openssl-src present so I'm using Cargo.lock and lapce-proxy/Cargo.toml patches:
# first to not fetch openssl-src tarball and later to remove git2 ossl vendored feature.
CARGO_ENV=	RUSTC_BOOTSTRAP=1 OPENSSL_NO_VENDOR=1

# Do not LTO and strip binaries while WIP:
# https://github.com/lapce/lapce/issues/2748
LTO_UNSAFE=	yes
post-install:
#	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lapce
#	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lapce-proxy
	${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
	${INSTALL_DATA} ${WRKSRC}/extra/images/logo.png \
		${STAGEDIR}${PREFIX}/share/pixmaps/dev.lapce.lapce.png
	${INSTALL_DATA} ${WRKSRC}/extra/linux/dev.lapce.lapce.desktop \
		${STAGEDIR}${PREFIX}/share/applications

post-patch:
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/cargo-crates/fontdb-0.16.2/src/lib.rs

.include <bsd.port.mk>