source: trunk/dports/_resources/port1.0/group/kde4-1.1.tcl @ 74340

Last change on this file since 74340 was 74340, checked in by michaelld@…, 9 years ago

kde 1.1 PortGroup: Add common / standard CMake configure defines that are used by multiple ports to avoid conflicts with non-MacPorts-installed Frameworks, headers, and libraries. For ports that do not require a define, it will be added to the CMakeCache.txt file but not used -- so, these do no harm if not needed; if needed, they explicitly define the use of MacPorts-provided libraries and headers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
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: kde4-1.1.tcl 74340 2010-12-13 16:53:13Z michaelld@macports.org $
3
4# Copyright (c) 2010 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     kde4 1.1
35
36# Use CMake and Qt4 port groups
37PortGroup               cmake 1.0
38PortGroup               qt4 1.0
39
40# Make sure to not use any already installed headers and libraries;
41# these are set in CPATH and LIBRARY_PATH anyway. 
42configure.ldflags-delete  -L${prefix}/lib
43configure.cppflags-delete -I${prefix}/include
44
45# build in a separate directory; have to put these into phases because
46# ${distname} and ${workpath} are not necessarily defined at the
47# top-level while they are guaranteed to be by the pre-fetch phase.
48
49# setup all KDE4 ports to build in a separate directory from the source;
50# this setting must be the full directory path
51post-extract            { file mkdir ${workpath}/build }
52
53# Have to set for configure, build, and destroot phases only.
54pre-configure {
55    # standard post-arg, where to find the primary CMakeLists.txt file.
56    configure.post_args ../${distname}
57    configure.dir       ${workpath}/build
58}
59pre-build {
60    build.dir           ${workpath}/build
61}
62pre-destroot {
63    build.dir           ${workpath}/build
64}
65
66# Automoc added as build dependency here as most, if not all kde
67# programs currently need it. The automoc port, which includes this
68# PortGroup overrides depends_build, removing "port:automoc" to
69# prevent a cyclic dependency
70depends_build-append    port:automoc
71
72# Phonon added as library dependency here as most, if not all KDE
73# programs current need it.  The phonon port, which includes this
74# PortGroup overrides depends_lib, removing "port:phonon" to prevent a
75# cyclic dependency
76depends_lib-append      port:phonon
77
78# set compiler to Apple's GCC 4.2
79switch ${os.platform}_${os.major} {
80    darwin_8 {
81            depends_lib-append  port:apple-gcc42-devel
82            configure.compiler  apple-gcc-4.2
83    }
84    darwin_9 {
85            configure.compiler  gcc-4.2
86    }
87}
88
89post-extract {
90    # Following the official word: Change #include ["<]Phonon...[">] to
91    # ...phonon... in all files that contain that header.
92    fs-traverse item ${workpath}/${distname} {
93        if {[file isfile ${item}]} {
94            reinplace "/#include/s@Phonon@phonon@" ${item}
95        }
96    }
97}
98
99# augment the CMake module lookup path, if necessary depending on
100# where Qt4 is installed.
101if {${qt_dir} != ${prefix}} {
102    set cmake_module_path ${cmake_share_module_dir}\;${qt_cmake_module_dir}
103    configure.args-delete -DCMAKE_MODULE_PATH=${cmake_share_module_dir}
104    configure.args-append -DCMAKE_MODULE_PATH="${cmake_module_path}"
105    unset cmake_module_path
106}
107
108# standard configure args; virtuall all KDE ports use CMake and Qt4.
109configure.args-append   -DBUILD_doc=OFF \
110                        -DBUILD_SHARED_LIBS=ON \
111                        -DBUNDLE_INSTALL_DIR=${applications_dir}/KDE4 \
112                        -DKDE_DISTRIBUTION_TEXT="MacPorts\/Mac OS X" \
113                        ${qt_cmake_defines}
114
115# explicitly define certain headers and libraries, to avoid
116# conflicts with those installed into system paths by the user.
117configure.args-append   -DGETTEXT_INCLUDE_DIR=${prefix}/include \
118                        -DGIF_INCLUDE_DIR=${prefix}/include \
119                        -DJASPER_INCLUDE_DIR=${prefix}/include \
120                        -DJASPER_LIBRARY=${prefix}/lib/libjasper.dylib \
121                        -DJPEG_INCLUDE_DIR=${prefix}/include \
122                        -DLIBINTL_INCLUDE_DIR=${prefix}/include \
123                        -DPNG_PNG_INCLUDE_DIR=${prefix}/include \
124                        -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
125                        -DTIFF_INCLUDE_DIR=${prefix}/include \
126                        -DLIBXSLT_INCLUDE_DIR=${prefix}/include \
127                        -DLIBXSLT_LIBRARIES=${prefix}/lib/libxslt.dylib \
128                        -DLIBEXSLT_LIBRARIES=${prefix}/lib/libexslt.dylib \
129                        -DQCA2_INCLUDE_DIR=${prefix}/include/QtCrypto \
130                        -DQCA2_LIBRARIES=${prefix}/lib/libqca.2.dylib \
131                        -DDOCBOOKXSL_DIR=${prefix}/share/xml/ \
132                        -DMYSQLD_EXECUTABLE=${prefix}/libexec/mysqld \
133                        -DMYSQL_INCLUDE_DIR=${prefix}/include/mysql5/mysql \
134                        -DMYSQL_LIB_DIR=${prefix}/lib/mysql5/mysql \
135                        -DMYSQLCONFIG_EXECUTABLE=${prefix}/bin/mysql_config5
136
137# standard variant for building documentation
138variant docs description "Build documentation" {
139    depends_lib-append      port:doxygen
140    configure.args-delete   -DBUILD_doc=OFF
141}
142
143post-activate {
144    ui_msg "##########################################################"
145    ui_msg "# Don't forget that dbus needs to be started as the local "
146    ui_msg "# user (not with sudo) before any KDE programs will launch"
147    ui_msg "# To start it run the following command:                  "
148    ui_msg "# launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist"
149    ui_msg "##########################################################"
150    ui_msg " "
151    ui_msg "######################################################"
152    ui_msg "#  Programs will not start until you run the command "
153    ui_msg "#  'sudo chown -R \$USER ~/Library/Preferences/KDE'  "
154    ui_msg "#  replacing \$USER with your username.              "
155    ui_msg "######################################################"
156}
Note: See TracBrowser for help on using the repository browser.