aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/fox17/Makefile
blob: 99fd37ce61d799e93356ae43c4060f05af739df0 (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
PORTNAME=	fox
PORTVERSION=	1.7.84
PORTREVISION=	2
CATEGORIES=	x11-toolkits
MASTER_SITES=	http://fox-toolkit.org/ftp/ \
		ftp://ftp.fox-toolkit.org/pub/
PKGNAMESUFFIX=	${PORTVERSION:R:S/.//}

MAINTAINER=	jhale@FreeBSD.org
COMMENT=	Fast and extensive C++ GUI toolkit (development version)
WWW=		http://www.fox-toolkit.org/

LICENSE=	LGPL3+
LICENSE_FILE=	${WRKSRC}/LICENSE

LIB_DEPENDS=	libpng.so:graphics/png \
		libfreetype.so:print/freetype2 \
		libfontconfig.so:x11-fonts/fontconfig

USES=		compiler:c++11-lib gl libtool localbase pathfix pkgconfig xorg
USE_GL=		gl glu
USE_XORG=	ice sm x11 xcursor xext xfixes xft xi xrandr xrender
USE_LDCONFIG=	yes

GNU_CONFIGURE=	yes
GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
CONFIGURE_ARGS=	--with-freetype-include="`pkg-config freetype2 --cflags | sed -e 's|^-I||'`" \
		--with-freetype-library="`pkg-config freetype2 --libs | sed -e 's|^-L||'`" \
		--with-opengl=yes \
		--with-xim \
		--enable-png \
		--bindir=${PREFIX}/bin/${PORTNAME}-${MAJORVER}
INSTALL_TARGET=	install-strip

CPPFLAGS+=	-D__BSD_VISIBLE -D__EXT1_VISIBLE -D_XOPEN_SOURCE=700

MAJORVER=	${PORTVERSION:R}
PLIST_SUB+=	MAJORVER=${MAJORVER}
DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${MAJORVER}
PORTDOCS=	*

OPTIONS_DEFINE=		CUPS DEBUG DOCS EXAMPLES OPTIMIZED_CFLAGS PROFILE TEST
OPTIONS_GROUP=		IMGFMTS
OPTIONS_GROUP_IMGFMTS=	JPEG OPENJPEG TIFF WEBP
OPTIONS_DEFAULT=	JPEG OPENJPEG TIFF WEBP
IMGFMTS_DESC=		Image formats

CUPS_CONFIGURE_ENABLE=	cups
CUPS_LIB_DEPENDS=	libcups.so:print/cups

DEBUG_CONFIGURE_ENABLE=	debug
DEBUG_CXXFLAGS_OFF=	-DNDEBUG

JPEG_USES=		jpeg
JPEG_CONFIGURE_ENABLE=	jpeg

OPENJPEG_LIB_DEPENDS=		libopenjpeg.so:graphics/openjpeg15
OPENJPEG_CONFIGURE_ENABLE=	jp2
OPENJPEG_CPPFLAGS=		-I${LOCALBASE}/include/openjpeg-1.5

PROFILE_CONFIGURE_ON=	--with-profiling=gprof

TIFF_LIB_DEPENDS=	libtiff.so:graphics/tiff
TIFF_CONFIGURE_ENABLE=	tiff

WEBP_LIB_DEPENDS=	libwebp.so:graphics/webp
WEBP_CONFIGURE_ENABLE=	webp

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
CXXFLAGS+=	-O2 -ffast-math
.  if !${PORT_OPTIONS:MPROFILE}
CXXFLAGS+=	-fomit-frame-pointer
.  endif
.  if ${CHOSEN_COMPILER_TYPE} == gcc
CXXFLAGS+=	-fexpensive-optimizations -finline-functions
.  endif
.endif

post-patch:
# Rename man pages as in manpage.1 --> manpage-17.1 to avoid
# conflicts with fox14 and fox16
	@files=$$(${FIND} ${WRKSRC} -name *.1); \
	for f in $$files; do \
		${MV} $$f `${ECHO_CMD} $$f | ${SED} -e 's|\.1|-17.1|'`; \
	done;
	@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
		'/man_MANS/s|\.1|-17.1|g'
	@${REINPLACE_CMD} -e '/^Libs:/s|$$| -pthread|; s|"||g' ${WRKSRC}/fox17.pc.in
# CXXFLAGS safeness
	@${REINPLACE_CMD} -e \
		's|^\(CXXFLAGS=""\)|#\1|' \
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}

post-patch-EXAMPLES-off:
	@${REINPLACE_CMD} -e \
		's|^\(SUBDIRS.*\)adie|\1|; \
		 s|^\(SUBDIRS.*\)pathfinder|\1|; \
		 s|^\(SUBDIRS.*\)shutterbug|\1|; \
		 s|^\(SUBDIRS.*\)calculator|\1|' \
		${WRKSRC}/Makefile.in

post-patch-TEST-off:
	@${REINPLACE_CMD} -e \
		's|^\(SUBDIRS.*\)glviewer|\1|; \
		 s|^\(SUBDIRS.*\)tests|\1|' \
		${WRKSRC}/Makefile.in

.include <bsd.port.post.mk>