Ticket #48184: kf5-1.0.tcl

File kf5-1.0.tcl, 8.6 KB (added by mkae (Marko Käning), 9 years ago)

Current status of kf5 port group making use of specific variable settings to define what the project's type is.

Line 
1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: kf5-1.0.tcl 134210 2015-03-20 06:40:18Z mk@macports.org $
3
4# Copyright (c) 2015 The MacPorts Project
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are
9# met:
10#
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16# 3. Neither the name of Apple Computer, Inc. nor the names of its
17#    contributors may be used to endorse or promote products derived from
18#    this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31#
32#
33# Usage:
34# PortGroup     kf5 1.0
35
36PortGroup               cmake 1.0
37PortGroup               qt5 1.0
38
39########################################################################
40# Projects including the 'kf5' port group must set
41#
42#  - their project name as 'kf5.project'
43#
44# an specify whether they are
45#
46#  - a framework by defining 'kf5.framework'
47#
48#  - a porting aid by defining 'kf5.portingAid'
49#
50#  - or a regular KF5 project which requires setting
51#    + a virtual path in 'kf5.virtualPath' (e.g. "applications")
52#    + as well as a release in 'kf5.release' (e.g. "15.04.2")
53#
54# otherwise the port will fail to build.
55########################################################################
56
57if { ![ info exists kf5.project ] } {
58    ui_error "You haven't defined kf5.project, which is mandatory for any KF5 project."
59    return -code error "incomplete port definition"
60}
61name                    kf5-${kf5.project}
62
63platforms               darwin
64supported_archs         noarch
65categories              kde kf5 devel
66license                 GPL-2+
67
68# Make sure to not use any already installed headers and libraries;
69# these are set in CPATH and LIBRARY_PATH anyway.
70configure.ldflags-delete  -L${prefix}/lib
71configure.cppflags-delete -I${prefix}/include
72
73# setup all KF5 ports to build in a separate directory from the source:
74cmake.out_of_source     yes
75
76# NOTE: Many kf5 ports violate MacPorts' ports file systems,
77#       but it is a must due to Qt5's QStandardPaths logic,
78#       so we'll quieten the warning.
79destroot.violate_mtree  yes
80
81# TODO:
82#
83# Phonon added as library dependency here as most, if not all KDE
84# programs current need it.  The phonon port, which includes this
85# PortGroup overrides depends_lib, removing "port:phonon" to prevent a
86# cyclic dependency
87#depends_lib-append      port:phonon
88
89# This is used by all KF5 frameworks
90depends_lib-append      port:kde-extra-cmake-modules
91
92# Use directory set by qt5-mac
93configure.args-append   -DECM_MKSPECS_INSTALL_DIR=${qt_mkspecs_dir}
94
95# This is why we need destroo.violate_mtree set to "yes"
96configure.args-append   -DCONFIG_INSTALL_DIR="/Library/Preferences" \
97                        -DKDE_INSTALL_DATADIR_KF5="/Library/Application Support"
98
99# Q: What about the often used XDG dir?
100#    (Currently it gets installed into /etc/xdg just like on Linux.)
101
102# standard configure args
103configure.args-append   -DBUILD_doc=OFF \
104                        -DBUILD_docs=OFF \
105                        -DBUILD_SHARED_LIBS=ON \
106                        -DBUNDLE_INSTALL_DIR=${applications_dir}/KF5 \
107                        -DCMAKE_DISABLE_FIND_PACKAGE_X11=ON \
108                        -DCMAKE_BUILD_TYPE=debug \
109                        -DLIB_SUFFIX=64
110
111# explicitly define certain headers and libraries, to avoid
112# conflicts with those installed into system paths by the user.
113configure.args-append   -DDOCBOOKXSL_DIR=${prefix}/share/xsl/docbook-xsl \
114                        -DGETTEXT_INCLUDE_DIR=${prefix}/include \
115                        -DGETTEXT_LIBRARY=${prefix}/lib/libgettextlib.dylib \
116                        -DGIF_INCLUDE_DIR=${prefix}/include \
117                        -DGIF_LIBRARY=${prefix}/lib/libgif.dylib \
118                        -DJASPER_INCLUDE_DIR=${prefix}/include \
119                        -DJASPER_LIBRARY=${prefix}/lib/libjasper.dylib \
120                        -DJPEG_INCLUDE_DIR=${prefix}/include \
121                        -DJPEG_LIBRARY=${prefix}/lib/libjpeg.dylib \
122                        -DLBER_LIBRARIES=${prefix}/lib/liblber.dylib \
123                        -DLDAP_INCLUDE_DIR=${prefix}/include \
124                        -DLDAP_LIBRARIES=${prefix}/lib/libldap.dylib \
125                        -DLIBEXSLT_INCLUDE_DIR=${prefix}/include \
126                        -DLIBEXSLT_LIBRARIES=${prefix}/lib/libexslt.dylib \
127                        -DLIBICALSS_LIBRARY=${prefix}/lib/libicalss.dylib \
128                        -DLIBICAL_INCLUDE_DIRS=${prefix}/include \
129                        -DLIBICAL_LIBRARY=${prefix}/lib/libical.dylib \
130                        -DLIBINTL_INCLUDE_DIR=${prefix}/include \
131                        -DLIBINTL_LIBRARY=${prefix}/lib/libintl.dylib \
132                        -DLIBXML2_INCLUDE_DIR=${prefix}/include/libxml2 \
133                        -DLIBXML2_LIBRARIES=${prefix}/lib/libxml2.dylib \
134                        -DLIBXML2_XMLLINT_EXECUTABLE=${prefix}/bin/xmllint \
135                        -DLIBXSLT_INCLUDE_DIR=${prefix}/include \
136                        -DLIBXSLT_LIBRARIES=${prefix}/lib/libxslt.dylib \
137                        -DMYSQLD_EXECUTABLE=${prefix}/libexec/mysqld \
138                        -DMYSQL_INCLUDE_DIR=${prefix}/include/mysql5/mysql \
139                        -DMYSQL_LIB_DIR=${prefix}/lib/mysql5/mysql \
140                        -DMYSQLCONFIG_EXECUTABLE=${prefix}/bin/mysql_config5 \
141                        -DOPENAL_INCLUDE_DIR=/System/Library/Frameworks/OpenAL.framework/Headers \
142                        -DOPENAL_LIBRARY=/System/Library/Frameworks/OpenAL.framework \
143                        -DPNG_INCLUDE_DIR=${prefix}/include \
144                        -DPNG_PNG_INCLUDE_DIR=${prefix}/include \
145                        -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
146                        -DTIFF_INCLUDE_DIR=${prefix}/include \
147                        -DTIFF_LIBRARY=${prefix}/lib/libtiff.dylib
148
149# KF5 frameworks are released with one version ATM:
150version                 5.11.0
151set branch              [join [lrange [split ${version} .] 0 1] .]
152
153if { ![ info exists kf5.framework ] && ![ info exists kf5.portingAid ] } {
154    if { ![ info exists kf5.virtualPath ] } {
155        ui_error "You haven't defined kf5.virtualPath, which is mandatory for any KF5 project. (Or is this project perhaps a framework or porting aid?)"
156        return -code error "incomplete port definition"
157    } else {
158        if { ![ info exists kf5.release ] } {
159            ui_error "You haven't defined kf5.virtualPath, which is mandatory for any KF5 project."
160            return -code error "incomplete port definition"
161        } else {
162            set kf5.folder  "${kf5.virtualPath}/${kf5.release}/src"
163            distname        ${kf5.project}-${kf5.release}
164        }
165    }
166} else {
167    distname            ${kf5.project}-${version}
168}
169
170if { [ info exists kf5.portingAid ] } {
171    set kf5.virtualPath     "frameworks"
172    set kf5.folder          "frameworks/${branch}/portingAids"
173}
174
175if { [ info exists kf5.framework ] } {
176    set kf5.virtualPath     "frameworks"
177    set kf5.folder          "frameworks/${branch}"
178}
179
180#ui_warn " -> kf5.virtualPath: '${kf5.virtualPath}'"
181#ui_warn " -> kf5.folder: '${kf5.folder}'"
182#ui_warn " -> kf5.virtualPath: '${kf5.virtualPath}'"
183#ui_warn " -> distname: '${distname}'"
184
185maintainers             mk openmaintainer
186description             ${kf5.project}
187long_description        ${description}
188homepage                http://projects.kde.org/projects/${kf5.virtualPath}/${kf5.project}
189master_sites            http://download.kde.org/stable/${kf5.folder}
190
191use_xz                  yes
192
193# TODO
194livecheck.type          none
195