source: trunk/dports/devel/qtscriptgenerator/Portfile

Last change on this file was 153140, checked in by michaelld@…, 10 months ago

qtscriptgenerator: fix to work with modern OSX and Clang; addresses ticket #47204.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 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 153140 2016-09-25 19:15:57Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           qt4 1.0
6
7name                qtscriptgenerator
8version             0.2.0
9revision            1
10categories          devel kde4
11license             LGPL-2.1
12maintainers         michaelld openmaintainer
13description         QtScript bindings generator.
14long_description    Qt Script Generator is a tool that generates \
15    Qt bindings for Qt Script. With the generated bindings you get \
16    access to substantial portions of the Qt API from within Qt Script.
17platforms           darwin
18homepage            http://labs.trolltech.com/page/Projects/QtScript/Generator
19distname            ${name}-src-${version}
20master_sites        http://qtscriptgenerator.googlecode.com/files/
21checksums           md5     9f82b0aa212f7938de37df46cd27165c \
22                    sha1    4c1078f26b196156e857c17c9d11a66cfea66f00 \
23                    rmd160  01c8ce3b4c8e9ebb3bc3c2d7b319846f34baee04
24
25depends_build-append port:automoc
26depends_lib-append  port:phonon
27
28patchfiles          patch-generator.diff \
29                    patch-qtbindings.diff \
30                    patch-generator_typesystem_phonon-qtscript.xml.diff \
31                    patch-generator_typesystem_phonon.xml.diff \
32                    debian_drop_extra_linkage_fix.diff \
33                    debian_qs_eval_globalize.diff \
34                    upstream_memory_alignment_fix.diff \
35                    upstream_support_later_phonon.diff \
36                    remove-QtScriptFutureIterator.diff \
37                    patch-include-everything.diff \
38                    patch-build-system-for-MacPorts.diff
39
40# check for +debug variant of this port, and make sure phonon was
41# installed with +debug as well; if not, error out.  phonon checks to
42# make sure Qt was installed with +debug, so it is OK if this stage
43# overrides that provided in the qt4 portgroup.
44pre-extract {
45    if {[variant_exists debug] && \
46        [variant_isset debug] && \
47       ![info exists building_qt4]} {
48        if {![file exists ${prefix}/lib/libphonon_debug.dylib]} {
49            return -code error "\n\nERROR:\n\
50In order to install this port as +debug,
51Phonon \(and Qt4\) must also be installed with +debug.\n"
52        }
53    }
54}
55
56post-patch {
57    # copy the QMake build script into place
58    copy ${filespath}/qtsg.pro ${worksrcpath}
59
60    reinplace "s|@QT_FRAMEWORKS_DIR@|${qt_frameworks_dir}|g" \
61        ${worksrcpath}/generator/main.h
62    reinplace -W ${worksrcpath} "s|@QT_INCLUDES_DIR@|${qt_includes_dir}|g" \
63        generator/main.h \
64        generator/generator.pri \
65        qtbindings/qtbindingsbase.pri
66    reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|g" \
67        generator/main.h \
68        generator/generator.pri \
69        qtbindings/qtbindingsbase.pri
70    reinplace "s|@CC@|${configure.cc}|g" \
71        ${worksrcpath}/qtsg.pro
72    reinplace "s|@CXX@|${configure.cxx}|g" \
73        ${worksrcpath}/qtsg.pro
74
75    # allow for universal and non-native building if just the
76    # qtbinding scripts, not the generator (which is solely used for
77    # generating the scripts)
78    reinplace "s/@ARCHES@/${qt_arch_types}/" \
79        ${worksrcpath}/qtbindings/qtbindingsbase.pri
80
81    # fix up qtbindings QMake build file to handle debug and release
82    set build_type "release"
83    if {[variant_isset debug]} {
84        set build_type "debug_and_release build_all"
85    }
86    reinplace "s/@BUILD_TYPE@/${build_type}/" \
87        ${worksrcpath}/qtbindings/qtbindingsbase.pri
88}
89
90# set up to use the installed QMake files
91configure.cmd       ${qt_qmake_cmd}
92configure.pre_args
93configure.args      "-o Makefile qtsg.pro"
94configure.post_args
95configure.universal_args
96configure.env-delete \
97                    QTDIR=${qt_dir}
98build.env-delete    QTDIR=${qt_dir}
99# used by generator/generator:
100build.env-append    QTFRAMEWORKS=${qt_frameworks_dir}
101
102# allow ccache, if specified by the user
103pre-build {
104    if {[tbool configure.ccache]} {
105        build.post_args "CCACHE=ccache"
106    }
107}
108
109variant docs description {installs the documentation} {}
110
111post-destroot {
112    xinstall -m 755 ${build.dir}/generator/generator ${destroot}${prefix}/bin/qs_generator
113    xinstall -m 755 ${build.dir}/qtbindings/qs_eval/qs_eval ${destroot}${prefix}/bin/qs_eval
114    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
115    xinstall -m 644 ${filespath}/qs_eval.1 ${destroot}${prefix}/share/man/man1/qs_eval.1
116    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/share/man/man1/qs_eval.1
117    if {[variant_isset docs]} {
118        xinstall -m 755 -d ${destroot}${prefix}/share/doc/qtscriptgenerator
119        foreach d [glob -nocomplain ${build.dir}/doc/*] {
120            file copy ${d} ${destroot}${prefix}/share/doc/qtscriptgenerator
121        }
122    }
123    xinstall -m 755 -d ${destroot}${prefix}/share/doc/qtscriptgenerator
124    file copy ${build.dir}/examples ${destroot}${prefix}/share/doc/qtscriptgenerator
125}
126
127variant debug description "Build release and debug versions" {}
128
129# need to check this to make sure it works
130livecheck.type      regex
131livecheck.url       http://code.google.com/p/qtscriptgenerator/source/browse
132livecheck.regex     {>release\.r([0-9.]+)<}
Note: See TracBrowser for help on using the repository browser.