aboutsummaryrefslogtreecommitdiff
path: root/editors/codelite/Makefile
blob: 413b9a02cf53dd6bdf6253ce52d821ea438e8021 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Created by: gahr
# $FreeBSD$

PORTNAME=	codelite
PORTVERSION=	10.0
PORTREVISION=	1
CATEGORIES=	editors devel

MAINTAINER=	mmokhi@FreeBSD.org
COMMENT=	Open Source IDE for C/C++

LICENSE=	GPLv2+

RUN_DEPENDS=	xterm:x11/xterm
LIB_DEPENDS+=	libhunspell-1.6.so:textproc/hunspell

BROKEN_armv6=		fails to configure: has leading or trailing whitespace.  This is now an error according to policy CMP0004

USE_GITHUB=	yes
GH_ACCOUNT=	eranif

USES=		cmake:outsource,noninja compiler:c++11-lib dos2unix execinfo gettext \
		pathfix shebangfix sqlite
USE_GNOME+=	cairo gtk20
DOS2UNIX_GLOB=	*.cpp *.txt
SHEBANG_FILES=	Runtime/codelite_xterm
bash_CMD=	/bin/sh
USE_WX=		3.0
CMAKE_ARGS=	-DPREFIX:STRING="${PREFIX}" \
		-DIS_FREEBSD:STRING=1 \
		-DCL_WX_CONFIG:STRING="${WX_CONFIG:T}"
USE_LDCONFIG=	${PREFIX}/lib/codelite
INSTALLS_ICONS=	yes

CXXFLAGS+=	${EXECINFO_CPPFLAGS}
LDFLAGS+=	${EXECINFO_LDFLAGS}

OPTIONS_DEFINE=		CSCOPE SFTP
OPTIONS_RADIO=		CLANG
OPTIONS_SUB=		yes

CSCOPE_DESC=		CScope integration
CSCOPE_RUN_DEPENDS=	cscope:devel/cscope
SFTP_DESC=		Secure FTP support via libssh
SFTP_LIB_DEPENDS=	libssh.so:security/libssh
SFTP_CMAKE_OFF=		-DENABLE_SFTP:STRING=0
SFTP_USES=		localbase

CLANG_DESC=		Clang code-completion

.for v in 34 35 36 37 38 39
OPTIONS_RADIO_CLANG+=	CLANG$v
CLANG$v_DESC=		Clang ${v:C/(.)(.)/\1.\2.x/}
.if $v == 39
CLANG$v_BUILD_DEPENDS=	llvm$v>0:devel/llvm$v
CLANG$v_RUN_DEPENDS=	llvm$v>0:devel/llvm$v
.else
CLANG$v_BUILD_DEPENDS=	clang$v>0:lang/clang$v
CLANG$v_RUN_DEPENDS=	clang$v>0:lang/clang$v
.endif

post-patch-CLANG$v-on:
	@${REINPLACE_CMD} -e \
		's|/usr/lib/llvm-.*/|${LOCALBASE}/llvm$v/|' \
		${WRKSRC}/cmake/Modules/FindLibClang.cmake \
		${WRKSRC}/cmake/Modules/FindLibLLDB.cmake
.endfor

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCLANG*}
CMAKE_ARGS+=	-DENABLE_LLDB:STRING=1 -DENABLE_CLANG:STRING=1
.else
CMAKE_ARGS+=	-DENABLE_LLDB:STRING=0 -DENABLE_CLANG:STRING=0
.endif

post-patch:
#	Use the correct wx-config
	@${REINPLACE_CMD} -e \
		'/ IS_FREEBSD/s|^|#| ; \
		 / CL_WX_CONFIG/s|^|#| ; \
		 / -Wno-/s|^|#| ; \
		 / -O2/s|^|#| ; \
		 s|"-s"|""|' \
		${WRKSRC}/CMakeLists.txt
	@${REINPLACE_CMD} -e \
		's|"-lkvm"|"-lkvm -lutil"| ; \
		 s|share/man|man|' \
		${WRKSRC}/LiteEditor/CMakeLists.txt
	@${REINPLACE_CMD} -e \
		's|"-lutil"|"-lkvm -lutil"|' \
		${WRKSRC}/codelite_terminal/CMakeLists.txt
	@${REINPLACE_CMD} -e \
		'/ADDITIONAL_LIBRARIES/s|""|"-lexecinfo"|' \
		${WRKSRC}/sdk/codelite_cppcheck/CMakeLists.txt
	@${REINPLACE_CMD} -e \
		's|/bin/grep|/usr/bin/grep|' \
		${WRKSRC}/cmake/Modules/FindLibClang.cmake

.include <bsd.port.mk>