/
Portfile
205 lines (172 loc) · 7.51 KB
/
Portfile
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup kde4 1.1
PortGroup boost 1.0
#Fetch from git repository to follow updates after the end of KDE4 public releases
fetch.type git
git.url https://github.com/KDE/akonadi.git
git.branch c733429f
name akonadi
set akoversion 1.13.1
version ${akoversion}.20141210
revision 6
categories devel kde kde4
maintainers nomaintainer
license LGPL-2+
description A personal information management storage service.
long_description Akonadi is an extensible cross-desktop storage service \
for PIM data and metadata providing concurrent read, write, and query access.
platforms darwin
homepage https://community.kde.org/KDE_PIM/Akonadi
depends_lib-append port:soprano \
port:shared-mime-info
compiler.cxx_standard 2011
post-patch {
reinplace "s/c++0x/c++11/" ${worksrcpath}/CMakeLists.txt
}
configure.args-append -DPOSTGRES_PATH=Off
# mute akonadiserver which is usually overly chatty:
configure.cflags-append -DQT_NO_DEBUG_OUTPUT
configure.cxxflags-append -DQT_NO_DEBUG_OUTPUT
set startup_root ""
post-destroot {
#Create a simple startup item
xinstall -d -m 755 ${destroot}${prefix}/Library/LaunchDaemons
set plist [open "${destroot}${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist" w 0644]
puts ${plist} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
puts ${plist} "<plist version=\"1.0\">"
puts ${plist} "<dict>"
puts ${plist} "<key>Label</key>"
puts ${plist} "<string>org.macports.akonadi</string>"
puts ${plist} "<key>ProgramArguments</key>"
puts ${plist} "<array>"
puts ${plist} "<string>${prefix}/bin/akonadiserver-script.sh</string>"
puts ${plist} "</array>"
puts ${plist} "<key>Disabled</key>"
puts ${plist} "<true/>"
puts ${plist} "<key>RunAtLoad</key>"
puts ${plist} "<true/>"
puts ${plist} "</dict>"
puts ${plist} "</plist>"
close ${plist}
#Create the script to launch server (needed to set the path, so that
#akonadictl can find akonadi_control
xinstall -d -m 755 ${destroot}${prefix}/bin
set scriptFl [open "${destroot}${prefix}/bin/akonadiserver-script.sh" w 0755]
puts ${scriptFl} "#!/bin/sh"
puts ${scriptFl} "export PATH=${prefix}/bin:${prefix}/sbin:\$PATH"
puts ${scriptFl} "${prefix}/bin/akonadictl start"
close ${scriptFl}
# The startupitem.install keyword does not exist in MacPorts < 2.1.
if {![info exists startupitem.install]} {
set startupitem.install yes
}
if { ${startupitem.install} != "no" } {
xinstall -d -m 755 ${destroot}${startup_root}/Library/LaunchDaemons
ln -s ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist ${destroot}${startup_root}/Library/LaunchDaemons
}
set docdir ${prefix}/share/doc/${name}
xinstall -d ${destroot}${docdir}
xinstall -m 0644 -W ${worksrcpath} AUTHORS NEWS README README.sqlite \
${destroot}${docdir}
}
post-activate {
if { ![variant_isset no_root] } {
file attributes ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist -owner root -group wheel
}
}
notes "Applications using akonadi need the akonadi server to be running to function.
To start the server manually, run
akonadictl start &
Otherwise, an agent to start the server at logon is provided.
To start it run the following command:
launchctl load -w ${startup_root}/Library/LaunchDaemons/org.macports.akonadi.plist"
variant no_root description {Run the akonadi server start as MacPorts install user.} {
pre-fetch {
if { ${install.user}=="root" || ${install.group}=="wheel" } {
ui_error "The akonadi server should not be run as root with no_root variant."
error "Please do not use this variant with your MacPorts configuration."
}
}
set startup_root [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
# Files are installed into user's startup directory.
destroot.violate_mtree yes
}
variant mysql51 \
conflicts sqlite mysql55 mysql56 mariadb55 percona55 \
description {build with mysql51 port} {
depends_lib-append port:qt4-mac-mysql51-plugin
depends_run-append port:mysql51-server
configure.args-append -DDATABASE_BACKEND=MYSQL \
-DMYSQLD_EXECUTABLE=${prefix}/lib/mysql51/bin/mysqld
}
variant mysql55 \
conflicts sqlite mysql51 mysql56 mariadb55 percona55 \
description {build with mysql55 port} {
depends_lib-append port:qt4-mac-mysql55-plugin
depends_run-append port:mysql55-server
configure.args-append -DDATABASE_BACKEND=MYSQL \
-DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
}
variant mysql56 \
conflicts sqlite mysql51 mysql55 mariadb55 percona55 \
description {build with mysql56 port} {
depends_lib-append port:qt4-mac-mysql56-plugin
depends_run-append port:mysql56-server
configure.args-append -DDATABASE_BACKEND=MYSQL \
-DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
}
variant mariadb55 \
conflicts sqlite mysql51 mysql55 mysql56 percona55 \
description {build with mariadb port} {
depends_lib-append port:qt4-mac-mariadb-plugin
depends_run-append port:mariadb-server
configure.args-append -DDATABASE_BACKEND=MYSQL \
-DMYSQLD_EXECUTABLE=${prefix}/lib/mariadb/bin/mysqld
}
variant percona55 \
conflicts sqlite mysql51 mysql55 mysql56 mariadb55 \
description {build with percona55 port} {
depends_lib-append port:qt4-mac-percona-plugin
depends_run-append port:percona-server
configure.args-append -DDATABASE_BACKEND=MYSQL \
-DMYSQLD_EXECUTABLE=${prefix}/lib/percona/bin/mysqld
}
variant sqlite \
conflicts mysql51 mysql55 mysql56 mariadb55 percona55 \
description {Use sqlite backend instead of MySQL} {
depends_lib-append port:qt4-mac-sqlite3-plugin
configure.args-append -DDATABASE_BACKEND=SQLITE \
-DMYSQLD_EXECUTABLE=Off
}
if {![variant_isset mysql51] && ![variant_isset mysql55] \
&& ![variant_isset mysql56] && ![variant_isset mariadb55] && ![variant_isset percona55] \
&& ![variant_isset sqlite]} {
default_variants +mariadb55
}
post-patch {
fs-traverse item ${workpath}/${distname}/server {
if {[file isfile ${item}]} {
reinplace "/include/s@\\(utils\\.h\\)@src/\\1@g" ${item}
}
}
reinplace "s|/Applications|${applications_dir}|" ${worksrcpath}/CMakeLists.txt
}
variant verbose description {Enable debug output (chatty!)} {
configure.cflags-delete -DQT_NO_DEBUG_OUTPUT
configure.cxxflags-delete -DQT_NO_DEBUG_OUTPUT
}
platform darwin {
#Deactivate tests as they require full C++11 support (ticket #45300)
configure.args-append -DAKONADI_BUILD_TESTS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF
if {${os.major} == 9} {
if {[info exists universal_target] && ${universal_target} == "10.4"} {
# Needed if compiling for 10.4 universal on 10.5
post-configure {
reinplace "s|#define HAVE_EXECINFO_H 1||" ${workpath}/build/config-akonadi.h
}
}
}
}
livecheck.type none