aboutsummaryrefslogtreecommitdiffstats
path: root/databases/akonadi/Makefile
blob: 660e6b8ac09fbfb5a5ec12c794d21385e2727cd3 (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
# Created by: miwi
# $FreeBSD$

PORTNAME=   akonadi
PORTVERSION=    1.7.2
PORTREVISION=   4
CATEGORIES= databases kde ipv6
MASTER_SITES=   ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTNAME}/src/
DIST_SUBDIR=    KDE

MAINTAINER= kde@FreeBSD.org
COMMENT=    Storage server for KDE-Pim

LICENSE=    LGPL21
LICENSE_FILE=   ${WRKSRC}/lgpl-license

LIB_DEPENDS=    boost_thread:${PORTSDIR}/devel/boost-libs
# Let process generate meaningful backtrace on core dump.
LIB_DEPENDS+=   execinfo.1:${PORTSDIR}/devel/libexecinfo
BUILD_DEPENDS=  xsltproc:${PORTSDIR}/textproc/libxslt

USE_KDE4=   kdehier kdeprefix sharedmime automoc4 soprano
KDE4_BUILDENV=  yes
USE_QT4=    dbus gui network qtestlib sql \
        moc_build qmake_build rcc_build uic_build
USE_BZIP2=  yes
CMAKE_ARGS+=    -DAKONADI_BUILD_TESTS:BOOL=FALSE \
        -DINSTALL_QSQLITE_IN_QT_PREFIX:BOOL=TRUE \
        -DCMAKE_REQUIRED_INCLUDES:STRING="${LOCALBASE}/include"
MAKE_JOBS_UNSAFE=   yes

PLIST_SUB+= QT_PREFIX=${QT_PREFIX}

OPTIONS_MULTI=  BACKEND
OPTIONS_MULTI_BACKEND=  MYSQL PGSQL SQLITE

MYSQL_DESC= Install MySQL Qt plugin and server
PGSQL_DESC= Install PostgreSQL Qt plugin
SQLITE_DESC=    Enable SQLite backend (unused)

OPTIONS_DEFAULT=    MYSQL

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  server
USE_QT4+=   sql-mysql_run
.endif

.if ${PORT_OPTIONS:MPGSQL}
# Do not add a dependency on PostgreSQL server as someone preferring
# it over MySQL might like to use some advanced configuration, like a
# remote server.
#USE_PGSQL= server
USE_QT4+=   sql-pgsql_run
.endif

.if ${PORT_OPTIONS:MSQLITE}
USE_SQLITE= 3
PLIST_SUB+= SQLITE=""
.else
PLIST_SUB+= SQLITE="@comment "
.endif

post-patch:
.if ${PORT_OPTIONS:MSQLITE} == ""
    ${REINPLACE_CMD} -e '/find_package(Sqlite)/ d' \
        ${PATCH_WRKSRC}/CMakeLists.txt
.endif
    ${REINPLACE_CMD} -e '/akonadi.pc/ s|pkgconfig|../libdata/pkgconfig|' \
        ${PATCH_WRKSRC}/CMakeLists.txt
    ${REINPLACE_CMD} -e '/find_program/ s|mysqld|mysqld_safe ${LOCALBASE}/bin|g' \
        ${PATCH_WRKSRC}/server/CMakeLists.txt
    ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
        ${PATCH_WRKSRC}/server/src/storage/dbconfigmysql.cpp
    # To avoid overflow, MySQL settings need to be lower than
    # INT_MAX / kern.hz. This setting assumes kern.hz=2000, and
    # it's nothing but a temporary hack.
    ${REINPLACE_CMD} -e '/wait_timeout/ s|31536000|1073741|' \
        ${PATCH_WRKSRC}/server/src/storage/*.conf
    # Prevent updating MIME during build.
    ${REINPLACE_CMD} -e '/^update_xdg_mimetypes/ d; /SharedMimeInfo/ d' \
        ${PATCH_WRKSRC}/CMakeLists.txt

post-install:
    @-update-mime-database ${KDE4_PREFIX}/share/mime

.include <bsd.port.mk>