source: trunk/dports/graphics/qwt/Portfile

Last change on this file was 145254, checked in by michaelld@…, 18 months ago

qwt*: tweaks for distname, conflicts, and livecheck.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 145254 2016-01-29 21:13:15Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                qwt
7categories          graphics science
8# actually a little more permissive than the standard LGPL, but the
9# distinction doesn't matter to us.
10license             LGPL-2.1
11maintainers         michaelld openmaintainer
12homepage            http://qwt.sourceforge.net
13
14master_sites        sourceforge:qwt
15use_bzip2           yes
16use_parallel_build  no
17
18platforms           darwin
19
20if {${subport} eq ${name}} {
21
22    version         5.1.2
23    distname        qwt-${version}
24    revision        3
25    conflicts       qwt52 qwt60 qwt61
26    checksums       sha1    2fc04b78c438635a78e41a22fea6f9e016f7ca17 \
27                    rmd160  a5a94aa3870a631f9605e6370c4d04fb1c79347e
28    patchfiles      patch-qwtconfig.pri.51.diff
29    livecheck.url   http://sourceforge.net/api/file/index/project-id/13693/mtime/desc/rss
30    livecheck.regex \\/qwt\\/(5\\.1\\.\\d+)\\/
31
32}
33
34subport qwt52 {
35
36    version         5.2.3
37    revision        1
38    distname        qwt-${version}
39    conflicts       qwt qwt60 qwt61
40    checksums       sha1    ff81595a1641a8b431f98d6091bb134bc94e0003 \
41                    rmd160  9b2128ad2b53a65678f9ea57d34cdc73a3674d21
42    patchfiles      patch-qwtconfig.pri.52.diff
43    livecheck.url   http://sourceforge.net/api/file/index/project-id/13693/mtime/desc/rss
44    livecheck.regex \\/qwt\\/(5\\.2\\.\\d+)\\/
45
46}
47
48subport qwt60 {
49
50    version         6.0.2
51    revision        1
52    distname        qwt-${version}
53    conflicts       qwt qwt52 qwt61
54    checksums       sha1    cbdd00b29521987c9e7bc6aa51092f0474b9428d \
55                    rmd160  c9d31f40b6001f09c59dbf4c0628ddd860474821
56    patchfiles      patch-qwtconfig.pri.60.diff \
57                    patch-qwtbuild.pri.60.diff \
58                    patch-qwtfunctions.pri.60.diff \
59                    patch-designer_designer.pro.60.diff
60    livecheck.url   http://sourceforge.net/api/file/index/project-id/13693/mtime/desc/rss
61    livecheck.regex \\/qwt\\/(6\\.0\\.\\d+)\\/
62
63}
64
65subport qwt61 {
66
67    version         6.1.2
68    revision        1
69    distname        qwt-${version}
70    conflicts       qwt qwt52 qwt60
71    checksums       sha1    6af82b6ee4132f779d1c8c2db872f01463b0d61c \
72                    sha256  2b08f18d1d3970e7c3c6096d850f17aea6b54459389731d3ce715d193e243d0c
73
74    patchfiles      patch-designer_designer.pro.61.diff \
75                    patch-qwtconfig.pri.61.diff \
76                    patch-qwtbuild.pri.61.diff
77    livecheck.url   http://sourceforge.net/api/file/index/project-id/13693/mtime/desc/rss
78    livecheck.regex \\/qwt\\/(6\\.1\\.\\d+)\\/
79
80}
81
82# get qwt's version numbers
83
84global qwt_major, qwt_minor, qwt_patch
85set qwt_vers [split ${version} "."]
86set qwt_major [lindex ${qwt_vers} 0]
87set qwt_minor [lindex ${qwt_vers} 1]
88set qwt_patch [lindex ${qwt_vers} 2]
89set qwt_maj_min ${qwt_major}.${qwt_minor}
90
91description         QWT: Qt Widgets for Technical Applications, \
92    Version ${qwt_maj_min}
93
94long_description ${description}\nThe Qwt library contains GUI \
95    Components and utility classes which are primarily useful for \
96    programs with a technical background. Beside a 2D plot widget it \
97    provides scales, sliders, dials, compasses, thermometers, wheels \
98    and knobs to control or display values, arrays, or ranges of type \
99    double. QWT version ${qwt_maj_min} contains source incompatible \
100    changes versus other versions of QWT.
101
102post-patch {
103
104    # setup for debug, if selected
105
106    if {[variant_isset debug]} {
107        if {${qwt_major} == 5} {
108            reinplace "/CONFIG/s@release@debug_and_release build_all@" \
109                ${worksrcpath}/qwtconfig.pri
110        } else {
111            reinplace "/CONFIG/s@release@debug_and_release build_all@" \
112                ${worksrcpath}/qwtbuild.pri
113        }
114    }
115
116    # set arch type(s)
117
118    if {${qwt_major} == 5} {
119        reinplace "s/@ARCHES@/${qt_arch_types}/" \
120            ${worksrcpath}/qwtconfig.pri
121    } else {
122        reinplace "s/@ARCHES@/${qt_arch_types}/" \
123            ${worksrcpath}/qwtbuild.pri
124    }
125
126    # setup for examples, if selected
127
128    if {![variant_isset examples]} {
129        reinplace "s@QwtExamples@@" \
130            ${worksrcpath}/qwtconfig.pri
131    }
132}
133
134if {${qwt_major} < 6} {
135
136    # QWT version 5 can work with Qt3 or Qt4
137
138    variant qt3 conflicts qt4 description {Use qt3-mac} {}
139
140    variant qt4 conflicts qt3 description {Use qt4-mac} {}
141
142    # move setting of 'qt_qmake_cmd' outside variants, since 'if'
143    # statements are processed in-order while variants are processed after
144    # everything else.
145
146    set qt_qmake_cmd ""
147
148    if {[variant_isset qt3]} {
149
150        depends_lib-append  port:qt3-mac
151        set qt_qmake_cmd    ${prefix}/libexec/qt3-mac/bin/qmake
152
153    } else {
154
155        # when variant 'qt3' is not set, use qt4 whether by default or via
156        # the user's variant choice
157
158        if {![variant_isset qt4]} {
159            default_variants    +qt4
160        }
161        PortGroup           qt4 1.0
162
163    }
164} else {
165
166    variant qt5 conflicts qt4 description "Build with Qt5" {}
167    variant qt4 conflicts qt5 description "Build with Qt4" {}
168
169    # QWT 6+ uses Qt4+ only
170    if {![variant_isset qt5]} {
171        PortGroup qt4 1.0
172    } else {
173        PortGroup           qt5 1.0
174        set qt_arch_types   "x86_64"
175        post-patch {
176            reinplace "s|QT_STATIC_CONST|static const|" \
177                ${worksrcpath}/src/qwt_scale_map.cpp \
178                ${worksrcpath}/src/qwt_scale_map.h
179        }
180    }
181}
182
183configure.cmd       ${qt_qmake_cmd}
184configure.pre_args  INSTALLBASE="${prefix}"
185
186# qmake does not handle these flags
187configure.universal_args-delete --disable-dependency-tracking
188configure.args-delete           --disable-dependency-tracking
189
190# allow ccache, if specified by the user
191pre-build {
192    if {[tbool configure.ccache]} {
193        build.post_args "CCACHE=ccache"
194    }
195}
196
197post-destroot {
198
199    # if qwt is installed as a framework,
200    # link in as libraries and headers too
201
202    if {[file exists ${destroot}${qt_frameworks_dir}/qwt.framework/qwt]} {
203
204        global qwt_major, qwt_minor, qwt_patch
205        foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
206                             -name "*.framework" | \
207                             sed -e "s@${destroot}@@g"] {
208
209            set tf_full [strsed ${fixfile} {s@\\.framework@@}]
210            set tf [strsed ${tf_full} {g@.*\/@@}]
211
212            # link headers into ${qt_includes_dir}, removing
213            # directories if they are already there first
214
215            file mkdir ${destroot}${qt_includes_dir}
216            file mkdir ${destroot}${qt_libs_dir}
217            set inc_file ${destroot}${qt_includes_dir}/${tf}
218            if {[file exists ${inc_file}]} {
219                file delete -force ${inc_file}
220            }
221            ln -s ${tf_full}.framework/Headers ${inc_file}
222
223            # link libraries into ${qt_libs_dir}
224
225            set libs_dir ${destroot}${qt_libs_dir}
226
227            ln -s ${tf_full}.framework/${tf} \
228                ${libs_dir}/lib${tf}.dylib
229            ln -s ${tf_full}.framework/${tf} \
230                ${libs_dir}/lib${tf}.${qwt_major}.dylib
231            ln -s ${tf_full}.framework/${tf} \
232                ${libs_dir}/lib${tf}.${qwt_major}.${qwt_minor}.dylib
233            ln -s ${tf_full}.framework/${tf} \
234                ${libs_dir}/lib${tf}.${qwt_major}.${qwt_minor}.${qwt_patch}.dylib
235
236            if {[variant_isset debug]} {
237
238                # link debug libraries into ${qt_libs_dir}
239
240                ln -s ${tf_full}.framework/${tf}_debug \
241                    ${libs_dir}/lib${tf}_debug.dylib
242                ln -s ${tf_full}.framework/${tf}_debug \
243                    ${libs_dir}/lib${tf}_debug.${qwt_major}.dylib
244                ln -s ${tf_full}.framework/${tf}_debug \
245                    ${libs_dir}/lib${tf}_debug.${qwt_major}.${qwt_minor}.dylib
246                ln -s ${tf_full}.framework/${tf}_debug \
247                    ${libs_dir}/lib${tf}_debug.${qwt_major}.${qwt_minor}.${qwt_patch}.dylib
248
249            }
250        }
251    }
252}
253
254variant debug description "Build release and debug versions" {}
255
256variant examples description "Build examples" {}
Note: See TracBrowser for help on using the repository browser.