summaryrefslogtreecommitdiff
path: root/devel/qt5-core/Makefile
blob: c875c26c71e62b6844572c7e4b2068130946bb58 (plain)
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
PORTNAME=	core
PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
PORTREVISION=	3
CATEGORIES=	devel
PKGNAMEPREFIX=	qt5-

MAINTAINER=	kde@FreeBSD.org
COMMENT=	Qt core non-graphical module

LIB_DEPENDS=	libdouble-conversion.so:devel/double-conversion \
		libicui18n.so:devel/icu \
		libpcre2-posix.so:devel/pcre2 \
		libzstd.so:archivers/zstd

USES=		compiler:c++11-lang gnome perl5 qmake:no_env qt-dist:5,base
USE_GNOME=	glib20
USE_PERL5=	extract
USE_QT=		qmake:build buildtools:build
HAS_CONFIGURE=	yes
# Disable (almost) everything to install minimal qconfig.h.
# -no-feature-* adds QT_NO_* (for features which have no switch or
# that need to be detected).
CONFIGURE_ARGS=	-no-accessibility -no-gif -no-libpng -no-libjpeg \
		-no-openssl -no-gui -no-widgets -no-cups \
		-no-iconv -no-dbus -no-opengl \
		-no-egl -no-evdev \
		-no-fontconfig -no-freetype -no-gtk -no-harfbuzz \
		-no-libudev -no-xcb -no-xcb-xlib \
		-no-xkbcommon -no-libinput

USE_LDCONFIG=	${PREFIX}/${QT_LIBDIR_REL}

BUILD_WRKSRC=	${WRKSRC}/src/corelib
INSTALL_WRKSRC=	${BUILD_WRKSRC}

QT_BINARIES=	yes
QT_DEFINES=	GLIB
QT_CONFIG=	glib icu

MORE_WRKSRCS=	src/tools/bootstrap src/corelib src/tools/qlalr

.include <bsd.port.pre.mk>

# FreeBSD base gained an os-release in r354922, but that does not exist
# always (see Synth bug 191, or PR 255354). Be a little more forgiving:
# assume sufficiently recent base "will have it", and check otherwise
# because 12.2 does, others like 12.1 do not have it.
.if !exists(/etc/rc.d/os-release) && (${OSVERSION} < 1300060)
RUN_DEPENDS+=	etc_os-release>0:sysutils/etc_os-release
post-patch:
	${REINPLACE_CMD}  -e '/readEtcFile/s|/etc/os-release|${LOCALBASE}/etc/os-release|g' \
		${WRKSRC}/src/corelib/global/qglobal.cpp
.endif

post-configure:
.for d in ${MORE_WRKSRCS}
	${MKDIR} ${WRKSRC}/${d}
	cd ${WRKSRC}/${d} && ${SETENV} ${QMAKE_ENV} ${_QMAKE} ${QMAKE_ARGS} ${WRKSRC}/${d}
.endfor

pre-build:
.for d in ${MORE_WRKSRCS}
	${MKDIR} ${WRKSRC}/${d}
	cd ${WRKSRC}/${d} && \
		${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} \
		${_MAKE_JOBS} ${MAKE_ARGS} ${ALL_TARGET}
.endfor

post-install:
# Allow qconfig.h to be customized by single ports.
	${AWK} 'BEGIN{print "#include <QtCore/qconfig-modules.h>"}{print}' \
		${STAGEDIR}${PREFIX}/${QT_INCDIR_REL}/QtCore/qconfig.h > ${WRKDIR}/qconfig.h
# Manually install qlalr
	cd ${WRKSRC}/src/tools/qlalr && \
		${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} \
		${MAKE_ARGS} ${INSTALL_TARGET}
# Cleanup qconfig.h and remove stray '#define QT_NO_FOO'
	${REINPLACE_CMD} "/#define QT_NO_/d" ${WRKDIR}/qconfig.h
	${MV} ${WRKDIR}/qconfig.h ${STAGEDIR}${PREFIX}/${QT_INCDIR_REL}/QtCore/qconfig.h

.include <bsd.port.post.mk>