[72481] trunk/dports/_resources/port1.0/group

michaelld at macports.org michaelld at macports.org
Sun Oct 17 11:56:03 PDT 2010


Revision: 72481
          http://trac.macports.org/changeset/72481
Author:   michaelld at macports.org
Date:     2010-10-17 11:56:01 -0700 (Sun, 17 Oct 2010)
Log Message:
-----------
Portgroups in development, but not use yet.

New portgroup for Qt4, mostly defining common directories and related
parameters.  Simplifies dependent ports' Portfiles.  Almost ready for
massive qt4-mac update.

Augmented KDE4 1.1 portgroup, in preparation for the update to Qt
4.7.0 and KDE 4.5.2.  Should allow for port-by-port updating from 1.0
to 1.1.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/kde4-1.1.tcl

Added Paths:
-----------
    trunk/dports/_resources/port1.0/group/qt4-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/kde4-1.1.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/kde4-1.1.tcl	2010-10-17 18:37:18 UTC (rev 72480)
+++ trunk/dports/_resources/port1.0/group/kde4-1.1.tcl	2010-10-17 18:56:01 UTC (rev 72481)
@@ -1,6 +1,6 @@
 # $Id$
 
-# Copyright (c) 2009 Orville Bennett <illogical1 at gmail.com>
+# Copyright (c) 2010 The MacPorts Project
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -32,55 +32,74 @@
 # Usage:
 # PortGroup     kde4 1.1
 
-
-# Use CMake Portgroup
+# Use CMake and Qt4 port groups
 PortGroup               cmake 1.0
+PortGroup               qt4 1.0
 
-use_parallel_build      yes
+# setup all KDE4 ports to build in a separate directory from the source;
+# this setting must be the full directory path
+post-extract            { file mkdir ${workpath}/build }
 
-worksrcdir              build
+pre-configure {
+    # standard post-arg, where to find the primary CMakeLists.txt file.
+    configure.post_args ../${distname}
+    configure.dir       ${workpath}/build
+}
 
-post-extract            { file mkdir ${worksrcpath} }
-
-set qt                  qt4-mac-devel
-set qt_dir              ${prefix}/libexec/${qt}
-
-post-patch {
-    if { ![file exists ${prefix}/libexec/${qt}/lib/phonon.framework/phonon] } {
-        ui_error "######################################################"
-        ui_error "A copy of phonon could not be found. Please install  "
-        ui_error "${qt} to provide this. If you have already done this "
-        ui_error "your Qt installation is missing the phonon backend.  "
-        ui_error "Please reinstall Qt4 with phonon support.            "
-        ui_error "######################################################"
-    }
+pre-build {
+    build.dir           ${workpath}/build
 }
 
-# Automoc added as build dependency here as most, if not all kde programs 
-# currently need it. The automoc port, which includes this PortGroup 
-# overrides depends_build, removing "port:automoc" to prevent a
-# cyclic dependency
+# Automoc added as build dependency here as most, if not all kde
+# programs currently need it. The automoc port, which includes this
+# PortGroup overrides depends_build, removing "port:automoc" to
+# prevent a cyclic dependency
 depends_build-append    port:automoc
-depends_lib-append      port:${qt}
 
+# Phonon added as library dependency here as most, if not all KDE
+# programs current need it.  The phonon port, which includes this
+# PortGroup overrides depends_lib, removing "port:phonon" to prevent a
+# cyclic dependency
+depends_lib-append      port:phonon
+
+# set compiler to Apple's GCC 4.2
 switch ${os.platform}_${os.major} {
     darwin_8 {
 	    depends_lib-append 	port:apple-gcc42-devel
 	    configure.compiler	apple-gcc-4.2
     }
     darwin_9 {
-	    configure.compiler      gcc-4.2
+	    configure.compiler  gcc-4.2
     }
 }
 
+post-extract {
+    # Following the official word: Change #include ["<]Phonon...[">] to
+    # ...phonon... in all files that contain that header.
+    fs-traverse item ${workpath}/${distname} {
+	if {[file isfile ${item}]} {
+	   reinplace "/#include/s at Phonon@phonon@" ${item}
+	}
+    }
+}
+
+# create the CMake module lookup path
+set cmake_module_path ${qt_cmake_module_dir}
+if {${qt_dir} != ${prefix}} {
+    set cmake_module_path ${prefix}/share/cmake/modules\;${cmake_module_path}
+}
+
+# standard configure args; virtuall all KDE ports use CMake and Qt4
 configure.args-append   -DBUILD_doc=OFF \
                         -DBUILD_SHARED_LIBS=ON \
                         -DBUNDLE_INSTALL_DIR=${applications_dir}/KDE4 \
-                        -DPHONON_INCLUDE_DIR=${prefix}/include \
-                        -DPHONON_LIBRARY=${prefix}/lib/libphonon.dylib \
-                        -DQT_QMAKE_EXECUTABLE=${qt_dir}/bin/qmake \
-                        -DKDE_DISTRIBUTION_TEXT="MacPorts\/Mac OS X"
+                        -DKDE_DISTRIBUTION_TEXT="MacPorts\/Mac OS X" \
+                        ${qt_cmake_defines} \
+                        -DCMAKE_MODULE_PATH="${cmake_module_path}"
 
+unset cmake_module_path
+
+# standard variant for building documentation
 variant docs description "Build documentation" {
     depends_lib-append      port:doxygen
     configure.args-delete   -DBUILD_doc=OFF

Added: trunk/dports/_resources/port1.0/group/qt4-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/qt4-1.0.tcl	                        (rev 0)
+++ trunk/dports/_resources/port1.0/group/qt4-1.0.tcl	2010-10-17 18:56:01 UTC (rev 72481)
@@ -0,0 +1,132 @@
+# $Id: $
+
+# Copyright (c) 2010 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# This portgroup defined standard settings when using Qt4.
+#
+# Usage:
+# PortGroup     qt4 1.0
+
+# standard Qt4 name
+set qt_name             qt4
+
+# standard install directory
+set qt_dir              ${prefix}
+
+# standard Qt documents directory
+set qt_docs_dir         ${qt_dir}/share/doc/${qt_name}
+
+# standard Qt plugins directory
+set qt_plugins_dir      ${qt_dir}/share/${qt_name}/plugins
+
+# standard Qt mkspecs directory
+set qt_mkspecs_dir      ${qt_dir}/share/${qt_name}/mkspecs
+
+# standard Qt imports directory
+set qt_imports_dir      ${qt_dir}/share/${qt_name}/imports
+
+# standard Qt includes directory
+set qt_includes_dir     ${qt_dir}/includes
+
+# standard Qt libraries directory
+set qt_libs_dir         ${qt_dir}/lib
+
+# standard Qt data directory
+set qt_data_dir         ${qt_dir}/share/${qt_name}
+
+# standard Qt translations directory
+set qt_translations_dir ${qt_dir}/share/${qt_name}/translations
+
+# standard Qt sysconf directory
+set qt_sysconf_dir      ${qt_dir}/etc/${qt_name}
+
+# standard Qt examples directory
+set qt_examples_dir     ${qt_dir}/share/${qt_name}/examples
+
+# standard Qt demos directory
+set qt_demos_dir        ${qt_dir}/share/${qt_name}/demos
+
+# standard CMake module directory for Qt-related files
+set qt_cmake_module_dir ${qt_dir}/share/cmake/modules
+
+# standard qmake command location
+set qt_qmake_cmd        ${qt_dir}/bin/qmake
+
+# standard moc command location
+set qt_moc_cmd          ${qt_dir}/bin/moc
+
+# standard uic command location
+set qt_uic_cmd          ${qt_dir}/bin/uic
+
+# standard lrelease command location
+set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
+
+# standard cmake info for Qt4
+set qt_cmake_defines    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
+                         -DQT_LIBRARY_DIR=${qt_libs_dir} \
+                         -DQT_QMAKE_EXECUTABLE=${qt_qmake_cmd}"
+
+# allow for both qt4 and qt4 devel
+depends_lib-append      bin:qmake:qt4-mac
+
+# standard configure environment
+configure.env-append    QTDIR=${qt_dir} \
+                        QMAKE=${qt_qmake_cmd} \
+                        MOC=${qt_moc_cmd}
+
+# standard build environment
+build.env-append        QTDIR=${qt_dir} \
+                        QMAKE=${qt_qmake_cmd} \
+                        MOC=${qt_moc_cmd}
+
+# use PKGCONFIG for Qt discovery in configure scripts
+depends_build-append    bin:pkg-config:pkgconfig
+
+# use a parallel build by default
+use_parallel_build      yes
+
+# standard destroot environment
+destroot.env-append     QTDIR=${qt_dir} \
+                        QMAKE=${qt_qmake_cmd} \
+                        MOC=${qt_moc_cmd} \
+                        INSTALL_ROOT=${destroot} \
+                        DESTDIR=${destroot}
+
+# append Qt's PKGCONFIG path to whatever is there now.
+set qt_pkg_config_path ${qt_dir}/lib/pkgconfig
+if {${qt_dir} != ${prefix}} {
+    set qt_pkg_config_path ${pkg_config_path}:${prefix}/lib/pkgconfig
+}
+if {${configure.pkg_config_path} == ""} {
+    configure.pkg_config_path ${qt_pkg_config_path}
+} else {
+    configure.pkg_config_path ${qt_pkg_config_path}:${configure.pkg_config_path}
+}
+unset qt_pkg_config_path
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101017/5a9ac78c/attachment.html>


More information about the macports-changes mailing list