source: trunk/dports/devel/akonadi/Portfile

Last change on this file was 142082, checked in by nicos@…, 23 months ago

akonadi: fully enforcing the requirement of c++11 with the cxx11 PortGroup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1# -*- 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
2# $Id: Portfile 142082 2015-11-03 10:22:07Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           kde4    1.1
6PortGroup           cxx11   1.0
7
8#Fetch from git repository to follow updates after the end of KDE4 public releases
9fetch.type          git
10git.url             git://anongit.kde.org/akonadi
11git.branch          c733429f
12
13name                akonadi
14set akoversion      1.13.1
15version             ${akoversion}.20141210
16revision            1
17categories          devel kde kde4
18maintainers         nicos openmaintainer
19license             LGPL-2+
20description         A personal information management storage service.
21long_description    Akonadi is an extensible cross-desktop storage service \
22for PIM data and metadata providing concurrent read, write, and query access.
23platforms           darwin
24homepage            http://community.kde.org/KDE_PIM/Akonadi
25
26depends_lib-append  port:soprano \
27                    port:boost \
28                    port:shared-mime-info
29
30post-patch {
31    reinplace "s/c++0x/c++11/" ${worksrcpath}/CMakeLists.txt
32}
33
34configure.args-append  -DPOSTGRES_PATH=Off
35# mute akonadiserver which is usually overly chatty:
36configure.cflags-append     -DQT_NO_DEBUG_OUTPUT
37configure.cxxflags-append   -DQT_NO_DEBUG_OUTPUT
38
39set startup_root ""
40post-destroot {
41    #Create a simple startup item
42    xinstall -d -m 755 ${destroot}${prefix}/Library/LaunchDaemons
43    set plist [open "${destroot}${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist" w 0644]
44
45    puts ${plist} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
46    puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
47    puts ${plist} "<plist version=\"1.0\">"
48    puts ${plist} "<dict>"
49    puts ${plist} "<key>Label</key>"
50    puts ${plist} "<string>org.macports.akonadi</string>"
51    puts ${plist} "<key>ProgramArguments</key>"
52    puts ${plist} "<array>"
53    puts ${plist} "<string>${prefix}/bin/akonadiserver-script.sh</string>"
54    puts ${plist} "</array>"
55    puts ${plist} "<key>Disabled</key>"
56    puts ${plist} "<true/>"
57    puts ${plist} "<key>RunAtLoad</key>"
58    puts ${plist} "<true/>"
59    puts ${plist} "</dict>"
60    puts ${plist} "</plist>"
61    close ${plist}
62
63    #Create the script to launch server (needed to set the path, so that
64    #akonadictl can find akonadi_control
65    xinstall -d -m 755 ${destroot}${prefix}/bin
66    set scriptFl [open "${destroot}${prefix}/bin/akonadiserver-script.sh" w 0755]
67    puts ${scriptFl} "#!/bin/sh"
68    puts ${scriptFl} "export PATH=${prefix}/bin:${prefix}/sbin:\$PATH"
69    puts ${scriptFl} "${prefix}/bin/akonadictl start"
70    close ${scriptFl}
71
72    # The startupitem.install keyword does not exist in MacPorts < 2.1.
73    if {![info exists startupitem.install]} {
74        set startupitem.install yes
75    }
76    if { ${startupitem.install} != "no" } {
77        xinstall -d -m 755 ${destroot}${startup_root}/Library/LaunchDaemons
78        ln -s ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist ${destroot}${startup_root}/Library/LaunchDaemons
79    }
80
81    set docdir ${prefix}/share/doc/${name}
82    xinstall -d ${destroot}${docdir}
83    xinstall -m 0644 -W ${worksrcpath} AUTHORS NEWS README README.sqlite \
84        ${destroot}${docdir}
85}
86
87post-activate {
88    if { ![variant_isset no_root] } {
89        file attributes ${prefix}/Library/LaunchDaemons/org.macports.akonadi.plist -owner root -group wheel
90    }
91}
92
93notes "Applications using akonadi need the akonadi server to be running to function.
94To start the server manually, run
95 akonadictl start &
96Otherwise, an agent to start the server at logon is provided.
97To start it run the following command:
98 launchctl load -w ${startup_root}/Library/LaunchDaemons/org.macports.akonadi.plist"
99
100variant no_root description {Run the akonadi server start as MacPorts install user.} {
101    pre-fetch {
102        if { ${install.user}=="root" || ${install.group}=="wheel" } {
103            ui_error "The akonadi server should not be run as root with no_root variant."
104            error "Please do not use this variant with your MacPorts configuration."
105        }
106    }
107
108    set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
109    # Files are installed into user's startup directory.
110    destroot.violate_mtree  yes
111}
112
113variant mysql51 \
114   conflicts sqlite mysql55 mysql56 mariadb55 percona55 \
115   description {build with mysql51 port} {
116
117   depends_lib-append      port:qt4-mac-mysql51-plugin
118   depends_run-append      port:mysql51-server
119   configure.args-append   -DDATABASE_BACKEND=MYSQL \
120                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql51/bin/mysqld
121}
122
123variant mysql55 \
124   conflicts sqlite mysql51 mysql56 mariadb55 percona55 \
125   description {build with mysql55 port} {
126
127   depends_lib-append      port:qt4-mac-mysql55-plugin
128   depends_run-append      port:mysql55-server
129   configure.args-append   -DDATABASE_BACKEND=MYSQL \
130                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
131}
132
133variant mysql56 \
134   conflicts sqlite mysql51 mysql55 mariadb55 percona55 \
135   description {build with mysql56 port} {
136
137   depends_lib-append      port:qt4-mac-mysql56-plugin
138   depends_run-append      port:mysql56-server
139   configure.args-append   -DDATABASE_BACKEND=MYSQL \
140                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mysql55/bin/mysqld
141}
142
143variant mariadb55 \
144   conflicts sqlite mysql51 mysql55 mysql56 percona55 \
145   description {build with mariadb port} {
146
147   depends_lib-append      port:qt4-mac-mariadb-plugin
148   depends_run-append      port:mariadb-server
149   configure.args-append   -DDATABASE_BACKEND=MYSQL \
150                           -DMYSQLD_EXECUTABLE=${prefix}/lib/mariadb/bin/mysqld
151}
152
153variant percona55 \
154   conflicts sqlite mysql51 mysql55 mysql56 mariadb55 \
155   description {build with percona55 port} {
156
157   depends_lib-append      port:qt4-mac-percona-plugin
158   depends_run-append      port:percona-server
159   configure.args-append   -DDATABASE_BACKEND=MYSQL \
160                           -DMYSQLD_EXECUTABLE=${prefix}/lib/percona/bin/mysqld
161}
162
163variant sqlite \
164   conflicts mysql51 mysql55 mysql56 mariadb55 percona55 \
165   description {Use sqlite backend instead of MySQL} {
166
167   depends_lib-append      port:qt4-mac-sqlite3-plugin         
168   configure.args-append   -DDATABASE_BACKEND=SQLITE \
169                           -DMYSQLD_EXECUTABLE=Off
170}
171
172if {![variant_isset mysql5] && ![variant_isset mysql51] && ![variant_isset mysql55] \
173    && ![variant_isset mysql56] && ![variant_isset mariadb55] && ![variant_isset percona55] \
174    && ![variant_isset sqlite]} {
175    default_variants +mariadb55
176}
177
178post-patch {
179    fs-traverse item ${workpath}/${distname}/server {
180        if {[file isfile ${item}]} {
181            reinplace "/include/s@\\(utils\\.h\\)@src/\\1@g" ${item}
182        }
183    }
184    reinplace "s|/Applications|${applications_dir}|" ${worksrcpath}/CMakeLists.txt
185}
186
187variant verbose description {Enable debug output (chatty!)} {
188    configure.cflags-delete     -DQT_NO_DEBUG_OUTPUT
189    configure.cxxflags-delete   -DQT_NO_DEBUG_OUTPUT
190}
191
192platform darwin {
193    #Deactivate tests as they require full C++11 support (ticket #45300)
194    configure.args-append -DAKONADI_BUILD_TESTS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF
195    if {${os.major} == 9} {
196        if {[info exists universal_target] && ${universal_target} == "10.4"} {
197        # Needed if compiling for 10.4 universal on 10.5
198            post-configure {
199                reinplace "s|#define HAVE_EXECINFO_H 1||" ${workpath}/build/config-akonadi.h
200            }
201        }
202    }
203}
204
205livecheck.type      none
Note: See TracBrowser for help on using the repository browser.