[73119] trunk/dports/devel/qscintilla
michaelld at macports.org
michaelld at macports.org
Thu Nov 4 07:14:07 PDT 2010
Revision: 73119
http://trac.macports.org/changeset/73119
Author: michaelld at macports.org
Date: 2010-11-04 07:14:04 -0700 (Thu, 04 Nov 2010)
Log Message:
-----------
qscintilla changes:
* better way of handling setting arch type(s).
* better way of handling setting release and debug builds.
* allow use of ccache/distcc.
* no longer need to set library/plugin install_names.
Modified Paths:
--------------
trunk/dports/devel/qscintilla/Portfile
trunk/dports/devel/qscintilla/files/patch-add_debug.diff
Modified: trunk/dports/devel/qscintilla/Portfile
===================================================================
--- trunk/dports/devel/qscintilla/Portfile 2010-11-04 13:13:31 UTC (rev 73118)
+++ trunk/dports/devel/qscintilla/Portfile 2010-11-04 14:14:04 UTC (rev 73119)
@@ -41,96 +41,60 @@
universal_variant yes
+# fix up QMake .pro files for +debug, if selected; also fixed up the
+# library and header paths to include .. and ../Qt4 before others.
+patchfiles-append patch-add_debug.diff
+
post-patch {
- # allow for universal building, if desired,
- # by fixing up the QMake .pro files.
- if {[variant_exists universal] && [variant_isset universal]} {
- # set universal arch types, depending on what the user has specified
- array set macports_to_qt_build_arch {
- ppc ppc
- i386 x86
- ppc64 ppc64
- x86_64 x86_64
- }
- set arch_types ""
- foreach arch ${universal_archs} {
- lappend arch_types $macports_to_qt_build_arch($arch)
- }
- set ARCHES [join ${arch_types} " "]
- reinplace "s at CONFIG += @CONFIG += ${ARCHES} @" \
- ${worksrcpath}/Qt4/qscintilla.pro
- reinplace "s at CONFIG += @CONFIG += ${ARCHES} @" \
- ${worksrcpath}/designer-Qt4/designer.pro
- }
+ # allow for universal and non-native building, if desired, by
+ # fixing up the QMake .pro files.
+ reinplace "s/@ARCHES@/${qt_arch_types}/" \
+ ${worksrcpath}/Qt4/qscintilla.pro
+ reinplace "s/@ARCHES@/${qt_arch_types}/" \
+ ${worksrcpath}/designer-Qt4/designer.pro
# fix up 'Platform.h's, to avoid a conflict with the port 'tidy's
# 'platform.h'.
- reinplace "/INCLUDEPATH/s@ \\. @ . .. @" \
- ${worksrcpath}/Qt4/qscintilla.pro
foreach fixfile [exec grep -lr \"Platform\.h\" ${worksrcpath}] {
reinplace "s@\"Platform\.h\"@\"include/Platform\.h\"@g" ${fixfile}
}
-}
-configure.cmd "cd ${worksrcpath}/Qt4; ${qt_qmake_cmd} qscintilla.pro; \
- cd ${worksrcpath}/designer-Qt4; ${qt_qmake_cmd} designer.pro; \
- echo"
-
-post-configure {
- # make sure the designer plugin finds the correct Qsci library, by
- # putting its search path first of all -L paths
+ # fix up .pro files to handle debug and release
+ set build_type "release"
if {[variant_isset debug]} {
- reinplace "/LIBS/s@\-L${prefix}/lib@\-L../Qt4 at 1" \
- ${worksrcpath}/designer-Qt4/Makefile.Release
- reinplace "/LIBS/s@\-L${prefix}/lib@\-L../Qt4 at 1" \
- ${worksrcpath}/designer-Qt4/Makefile.Debug
- reinplace "/INCPATH/s@\-I@\-I../Qt4 \-I at 1" \
- ${worksrcpath}/designer-Qt4/Makefile.Release
- reinplace "/INCPATH/s@\-I@\-I../Qt4 \-I at 1" \
- ${worksrcpath}/designer-Qt4/Makefile.Debug
- } else {
- reinplace "/LIBS/s@\-L${prefix}/lib@\-L../Qt4 at 1" \
- ${worksrcpath}/designer-Qt4/Makefile
- reinplace "/INCPATH/s@\-I@\-I../Qt4 \-I at 1" \
- ${worksrcpath}/designer-Qt4/Makefile
+ set build_type "debug_and_release build_all"
}
+ reinplace "s/@BUILD_TYPE@/${build_type}/" \
+ ${worksrcpath}/designer-Qt4/designer.pro
+ reinplace "s/@BUILD_TYPE@/${build_type}/" \
+ ${worksrcpath}/Qt4/qscintilla.pro
+
+ # drop in a simple QMake file, for easy building
+ copy ${filespath}/Qsci.pro ${worksrcpath}
+
+ # rename QMake .pro files in subdirs to work with top-level file
+ move ${worksrcpath}/Qt4/qscintilla.pro \
+ ${worksrcpath}/Qt4/Qt4.pro
+ move ${worksrcpath}/designer-Qt4/designer.pro \
+ ${worksrcpath}/designer-Qt4/designer-Qt4.pro
}
-build.cmd "cd ${worksrcpath}/Qt4; make; cd ${worksrcpath}/designer-Qt4; make; echo"
+# QMake does not handle this flag.
+configure.universal_args-delete --disable-dependency-tracking
+configure.args-delete --disable-dependency-tracking
-destroot.cmd "cd ${worksrcpath}/Qt4; make install; cd ${worksrcpath}/designer-Qt4; make install; echo"
+configure.pre_args
+configure.cmd ${qt_qmake_cmd}
-post-build {
- # Fix import and plugin library names
- system "install_name_tool -id \
- ${qt_dir}/lib/libqscintilla2.5.dylib \
- ${worksrcpath}/Qt4/libqscintilla2.5.dylib"
- system "install_name_tool -id \
- ${qt_plugins_dir}/designer/libqscintillaplugin.dylib \
- ${worksrcpath}/designer-Qt4/libqscintillaplugin.dylib"
- system "install_name_tool -change \
- libqscintilla2.5.dylib \
- ${qt_dir}/lib/libqscintilla2.5.dylib \
- ${worksrcpath}/designer-Qt4/libqscintillaplugin.dylib"
- if {[variant_isset debug]} {
- system "install_name_tool -id \
- ${qt_dir}/lib/libqscintilla2_debug.5.dylib \
- ${worksrcpath}/Qt4/libqscintilla2_debug.5.dylib"
- system "install_name_tool -id \
- ${qt_plugins_dir}/designer/libqscintillaplugin_debug.dylib \
- ${worksrcpath}/designer-Qt4/libqscintillaplugin_debug.dylib"
- system "install_name_tool -change \
- libqscintilla2.5.dylib \
- ${qt_dir}/lib/libqscintilla2_debug.5.dylib \
- ${worksrcpath}/designer-Qt4/libqscintillaplugin_debug.dylib"
+# allow ccache, if specified by the user
+pre-build {
+ if {[tbool configure.ccache]} {
+ build.post_args "CCACHE=ccache"
}
}
variant debug \
-description {Produce both release and debug library and plugin} {
- # fix up QMake .pro files for +debug, if selected
- patchfiles-append patch-add_debug.diff
-}
+description {Produce both release and debug library and plugin} {}
livecheck.type regex
livecheck.url ${master_sites}
Modified: trunk/dports/devel/qscintilla/files/patch-add_debug.diff
===================================================================
--- trunk/dports/devel/qscintilla/files/patch-add_debug.diff 2010-11-04 13:13:31 UTC (rev 73118)
+++ trunk/dports/devel/qscintilla/files/patch-add_debug.diff 2010-11-04 14:14:04 UTC (rev 73119)
@@ -1,12 +1,39 @@
---- Qt4/qscintilla.pro.orig 2010-10-27 18:33:43.000000000 -0400
-+++ Qt4/qscintilla.pro 2010-10-27 18:34:11.000000000 -0400
+--- designer-Qt4/designer.pro.orig 2010-10-29 21:15:42.000000000 -0400
++++ designer-Qt4/designer.pro 2010-10-29 21:23:32.000000000 -0400
+@@ -4,7 +4,7 @@
+ TEMPLATE = lib
+ TARGET = qscintillaplugin
+
+-CONFIG += designer release plugin
++CONFIG += @ARCHES@ designer @BUILD_TYPE@ plugin
+
+ HEADERS = qscintillaplugin.h
+ SOURCES = qscintillaplugin.cpp
+@@ -12,4 +12,14 @@
+ target.path = $$[QT_INSTALL_PLUGINS]/designer
+ INSTALLS += target
+
+-LIBS += -lqscintilla2
++INCLUDEPATH += ../Qt4
++QSCI_LIB = qscintilla2
++
++!debug_and_release|build_pass {
++ CONFIG(debug, debug|release):mac {
++ TARGET = $$member(TARGET, 0)_debug
++ QSCI_LIB = $$member(QSCI_LIB, 0)_debug
++ }
++}
++
++LIBS += -L../Qt4 -l$$QSCI_LIB
+--- Qt4/qscintilla.pro.orig 2010-10-29 21:31:39.000000000 -0400
++++ Qt4/qscintilla.pro 2010-10-29 21:32:50.000000000 -0400
@@ -33,10 +33,16 @@
TEMPLATE = lib
TARGET = qscintilla2
-CONFIG += qt warn_off release dll thread
-INCLUDEPATH = . ../include ../src
-+CONFIG += qt warn_off debug_and_release dll thread build_all
++CONFIG += @ARCHES@ qt warn_off @BUILD_TYPE@ dll thread
+INCLUDEPATH = . .. ../include ../src
DEFINES = QSCINTILLA_MAKE_DLL QT SCI_LEXER
@@ -19,24 +46,3 @@
# Handle both Qt v4 and v3.
target.path = $$[QT_INSTALL_LIBS]
isEmpty(target.path) {
---- designer-Qt4/designer.pro.orig 2010-10-27 18:33:50.000000000 -0400
-+++ designer-Qt4/designer.pro 2010-10-27 18:37:31.000000000 -0400
-@@ -4,7 +4,7 @@
- TEMPLATE = lib
- TARGET = qscintillaplugin
-
--CONFIG += designer release plugin
-+CONFIG += designer debug_and_release plugin build_all
-
- HEADERS = qscintillaplugin.h
- SOURCES = qscintillaplugin.cpp
-@@ -13,3 +13,9 @@
- INSTALLS += target
-
- LIBS += -lqscintilla2
-+
-+!debug_and_release|build_pass {
-+ CONFIG(debug, debug|release) {
-+ mac:TARGET = $$member(TARGET, 0)_debug
-+ }
-+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101104/d3ae00b6/attachment.html>
More information about the macports-changes
mailing list