aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/qscintilla/Makefile
blob: bd1fc047dc7857c66c3cac198f7c8d1273c47f25 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# New ports collection makefile for:	qscintilla
# Date created:				2003-08-02
# Whom:					arved
#
# $FreeBSD$

PORTNAME=	qscintilla
PORTVERSION=	1.7.1
PORTREVISION=	8
CATEGORIES=	x11-toolkits
MASTER_SITES=	http://www.riverbankcomputing.com/static/Downloads/QScintilla1/ \
		http://ns.ael.ru/~fluffy.khv/pyqt/QScintilla1/
DISTNAME=	QScintilla-1.71-gpl-${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	QT port of the Scintilla C++ editor class

BUILD_DEPENDS=	qmake:${PORTSDIR}/devel/qmake

USE_QT_VER=	3
MAKE_ENV=	QTDIR="${QT_PREFIX}"
USE_LDCONFIG=	yes

OPTIONS_DEFINE=	DESIGNER_PLUGIN DOCS EXAMPLES LANG_DE LANG_FR LANG_PTBR LANG_RU
OPTIONS_DEFAULT=	DESIGNER_PLUGIN DOCS EXAMPLES LANG_DE LANG_FR LANG_PTBR LANG_RU

DESIGNER_PLUGIN_DESC=	Install plugin for Qt Designer
LANG_DE_DESC=		Install German translation
LANG_FR_DESC=		Install French translation
LANG_PTBR_DESC=		Install Brazilian Portuguese translation
LANG_RU_DESC=		Install Russian translation

QMAKE=		${LOCALBASE}/bin/qmake
SPEC=		${LOCALBASE}/share/qt/mkspecs/freebsd-g++
PLUGINDIR=	${LOCALBASE}/lib/plugins/designer

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MDOCS}
PLIST_SUB+=	DOCS=""
.else
PLIST_SUB+=	DOCS="@comment "
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
PLIST_SUB+=	EXAMPLES=""
.else
PLIST_SUB+=	EXAMPLES="@comment "
.endif
.if ${PORT_OPTIONS:MDESIGNER_PLUGIN}
PLIST_SUB+=	DESIGNER_PLUGIN=""
.else
PLIST_SUB+=	DESIGNER_PLUGIN="@comment "
.endif
.if ${PORT_OPTIONS:MLANG_DE}
PLIST_SUB+=	LANG_DE=""
.else
PLIST_SUB+=	LANG_DE="@comment "
.endif
.if ${PORT_OPTIONS:MLANG_FR}
PLIST_SUB+=	LANG_FR=""
.else
PLIST_SUB+=	LANG_FR="@comment "
.endif
.if ${PORT_OPTIONS:MLANG_PTBR}
PLIST_SUB+=	LANG_PTBR=""
.else
PLIST_SUB+=	LANG_PTBR="@comment "
.endif
.if ${PORT_OPTIONS:MLANG_RU}
PLIST_SUB+=	LANG_RU=""
.else
PLIST_SUB+=	LANG_RU="@comment "
.endif
.if !empty(PORT_OPTIONS:MLANG_DE) && !empty(PORT_OPTIONS:MLANG_FR) && !empty(PORT_OPTIONS:MLANG_PTBR) && !empty(PORT_OPTIONS:MLANG_RU)
PLIST_SUB+=	TRANSLATIONS=""
.else
PLIST_SUB+=	TRANSLATIONS="@comment "
.endif

do-configure:
	( cd ${WRKSRC}/qt && \
		${SETENV} ${MAKE_ENV} ${QMAKE} -spec ${SPEC} qscintilla.pro )

post-configure:
	( cd ${WRKSRC}/qt && \
		${CAT} qscintilla.pro | ${GREP} -v DESTDIR > qscintilla.tmp && \
		${CAT} Makefile | ${GREP} -v DEL_FILE | ${GREP} -v MOVE | \
			${GREP} -v DESTDIR > Makefile.tmp && \
		${MV} qscintilla.tmp qscintilla.pro && \
		${MV} Makefile.tmp Makefile && \
		cd ${WRKSRC}/designer && \
		${CAT} designer.pro | ${GREP} -v lqscintilla > designer.tmp && \
		${ECHO} "INCPATH += ${LOCALBASE}/include ../qt" >> \
			designer.tmp && \
		${ECHO} "LIBS += -L../qt -L${LOCALBASE}/lib -lqscintilla" >> \
			designer.tmp && \
		${ECHO} "DESTDIR = ." >> designer.tmp && \
		${MV} designer.tmp designer.pro )

do-build:
	( cd ${WRKSRC}/qt && ${SETENV} ${MAKE_ENV} ${MAKE} )

post-build:
.if ${PORT_OPTIONS:MDESIGNER_PLUGIN}
	( cd ${WRKSRC}/designer && ${SETENV} ${MAKE_ENV} \
		${QMAKE} -spec ${SPEC} designer.pro && ${MAKE} )
.endif

do-install:
	( cd ${WRKSRC} && \
		${INSTALL_DATA} qt/qextscintilla*.h ${PREFIX}/include && \
		${INSTALL_DATA} qt/libqscintilla.so.7.0.1 \
			${PREFIX}/lib/libqscintilla.so.7 && \
		${LN} -sf ${PREFIX}/lib/libqscintilla.so.7 \
			${PREFIX}/lib/libqscintilla.so )
.if ${PORT_OPTIONS:MDESIGNER_PLUGIN}
	( cd ${WRKSRC} && \
		${INSTALL_DATA} designer/libqscintillaplugin.so ${PLUGINDIR} )
.endif
.if !empty(PORT_OPTIONS:MLANG_DE) || !empty(PORT_OPTIONS:MLANG_FR) || !empty(PORT_OPTIONS:MLANG_PTBR) || !empty(PORT_OPTIONS:MLANG_RU)
	${MKDIR} -m 0755 ${DATADIR}/translations
.endif
.if ${PORT_OPTIONS:MLANG_DE}
	( cd ${WRKSRC} && \
		${INSTALL_DATA} qt/qscintilla_de.qm ${DATADIR}/translations )
.endif
.if ${PORT_OPTIONS:MLANG_FR}
	( cd ${WRKSRC} && \
		${INSTALL_DATA} qt/qscintilla_fr.qm ${DATADIR}/translations )
.endif
.if ${PORT_OPTIONS:MLANG_PTBR}
	( cd ${WRKSRC} && \
		${INSTALL_DATA} qt/qscintilla_pt_br.qm ${DATADIR}/translations )
.endif
.if ${PORT_OPTIONS:MLANG_RU}
	( cd ${WRKSRC} && \
		${INSTALL_DATA} qt/qscintilla_ru.qm ${DATADIR}/translations )
.endif
.if ${PORT_OPTIONS:MDOCS}
	( cd ${WRKSRC} && \
		${MKDIR} -m 0755 ${DOCSDIR}/html ${DOCSDIR}/Scintilla && \
		${INSTALL_DATA} ChangeLog NEWS README ${DOCSDIR} && \
		${INSTALL_DATA} doc/qscintilla.dxy ${DOCSDIR} && \
		${INSTALL_DATA} doc/html/* ${DOCSDIR}/html &&  \
		${INSTALL_DATA} doc/Scintilla/* ${DOCSDIR}/Scintilla )
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
	( cd ${WRKSRC} && \
		${MKDIR} -m 0755 ${EXAMPLESDIR} && \
		${INSTALL_DATA} example/* ${EXAMPLESDIR} )
.endif

.include <bsd.port.post.mk>