Ticket #27962: Portfile.5

File Portfile.5, 9.4 KB (added by cjones051073 (Chris Jones), 13 years ago)
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: Portfile 72782 2010-10-26 19:34:05Z michaelld@macports.org $
3
4PortSystem          1.0
5
6name                root
7version             5.28.00d
8revision            0
9categories          science
10maintainers         gmail.com:mattiafrancescomoro
11license             LGPLv2.1
12description         Root cern data analysis framework
13long_description    The ROOT system provides a set of frameworks with all \
14                    the functionality needed to handle and analyze large amounts \
15                    of data in a very efficient way
16homepage            http://root.cern.ch/
17platforms           darwin
18distname            ${name}_v${version}.source
19master_sites        ftp://root.cern.ch/root/
20
21checksums           md5     53505fcb256df38526d446916e6efc15 \
22                    sha1    b932d9b2ebfe66a28333b5b9ef90ab0e877173d8 \
23                    rmd160  f3a25f9c6ae5cd4d4ad511d6707adf0845bbfac5
24
25worksrcdir          root
26
27depends_lib         port:freetype \
28                    port:pcre \
29                    port:Xft2 \
30                    port:xorg-libX11 \
31                    port:xpm \
32                    port:zlib \
33                    port:gsl \
34                    port:graphviz \
35                    port:jpeg \
36                    port:libpng \
37                    port:tiff
38
39pre-configure {
40    build.args      CC=${configure.cc} \
41                    CXX=${configure.cxx} \
42                    F77=${configure.f77}
43
44    reinplace "s|-lfreetype| \`freetype-config --libs\`|g" ${worksrcpath}/config/root-config.in
45    reinplace "s|\"/usr/include\"|\"${prefix}/include/\" \"/usr/include\"|g" ${worksrcpath}/configure
46    reinplace "s|/usr/lib |${prefix}/lib /usr/lib |g" ${worksrcpath}/configure
47    reinplace "s|/usr/include |${prefix}/include /usr/include |g" ${worksrcpath}/configure
48    reinplace "s|\"/usr/lib\"|\"${prefix}/lib/\" \"/usr/lib\"g|" ${worksrcpath}/configure
49
50    # the build type (32 or 64 bit) -must- be for first argument
51    if {${build_arch} == "i386" || ${build_arch} == "ppc"} {
52       configure.pre_args macosx --prefix=${prefix}
53    } else {
54       configure.pre_args macosx64 --prefix=${prefix}
55    }
56}
57
58configure.args      --with-cc=${configure.cc} \
59                    --with-f77=${configure.f77} \
60                    --with-cxx=${configure.cxx} \
61                    --docdir=${prefix}/share/doc/${name}-${version} \
62                    --libdir=${prefix}/lib/root \
63                    --testdir=${prefix}/share/root/test \
64                    --tutdir=${prefix}/share/root/tutorials \
65                    --etcdir=${prefix}/etc/root \
66                    --disable-builtin-afterimage \
67                    --disable-builtin-freetype \
68                    --disable-builtin-glew \
69                    --disable-builtin-ftgl \
70                    --disable-builtin-pcre \
71                    --disable-builtin-zlib \
72                    --disable-fftw3 \
73                    --disable-krb5 \
74                    --disable-ldap \
75                    --disable-mysql \
76                    --disable-odbc \
77                    --disable-opengl \
78                    --disable-pythia8 \
79                    --disable-qt \
80                    --disable-qtgsi \
81                    --disable-roofit \
82                    --disable-ssl \
83                    --disable-xml \
84                    --disable-python \
85                    --with-x11-libdir=${prefix}/lib \
86                    --with-xpm-libdir=${prefix}/lib
87
88universal_variant   no
89
90default_variants    +ssl +builtin_ftgl +roofit +xml +opengl +python
91
92variant fftw3 description {Builds port with fftw3 support} {
93    configure.args-delete   --disable-fftw3
94    configure.args-append   --enable-fftw3 \
95                            --with-fftw3-incdir="${prefix}/include/" \
96                            --with-fftw3-libdir="${prefix}/lib"
97    depends_lib-append      port:fftw-3
98}
99
100variant kerberos5 description {Builds port with kerberos5 support} {
101    configure.args-delete   --disable-krb5
102    configure.args-append   --enable-krb5 \
103                            --with-krb5-incdir="${prefix}/include/" \
104                            --with-krb5-libdir="${prefix}/lib"
105    depends_lib-append      port:kerberos5
106}
107
108variant odbc description {Builds port with odbc support} {
109    configure.args-delete   --disable-odbc
110    configure.args-append   --enable-odbc\
111                            --with-odbc-incdir="${prefix}/include/" \
112                            --with-odbc-libdir="${prefix}/lib"
113    depends_lib-append      port:unixODBC
114}
115
116variant ldap description {Builds port with lpap support} {
117    configure.args-delete   --disable-ldap
118    configure.args-append   --enable-ldap\
119                            --with-ldap-incdir="${prefix}/include/" \
120                            --with-ldap-libdir="${prefix}/lib"
121    depends_lib-append      port:openldap
122}
123
124variant roofit description { Build the libRooFit advanced fitting package} {
125    configure.args-delete   --disable-roofit
126    configure.args-append   --enable-roofit
127}
128
129variant opengl description {Builds port with opengl support} {
130    configure.args-delete   --disable-opengl
131    configure.args-append   --enable-opengl \
132                            --with-opengl-incdir="${prefix}/include" \
133                            --with-opengl-libdir="${prefix}/lib" \
134                            --with-glew-incdir="${prefix}/include/" \
135                            --with-glew-libdir="${prefix}/lib"
136    depends_lib-append      port:glew
137}
138
139variant python description {Builds port with python support} {
140    configure.args-delete   --disable-python
141    configure.args-append   --enable-python
142    depends_lib-append      port:python26
143}
144
145variant ssl description {Builds port with ssl support} {
146    configure.args-delete   --disable-ssl
147    configure.args-append   --enable-ssl \
148                            --with-ssl-shared=yes \
149                            --with-ssl-incdir="${prefix}/include" \
150                            --with-ssl-libdir="${prefix}/lib"
151    depends_lib-append      port:openssl
152}
153
154variant builtin_ftgl description {Builds port with builtin-ftgl support} {
155    configure.args-delete   --disable-builtin-ftgl
156    configure.args-append   --enable-builtin-ftgl
157}
158
159variant ftgl description {Builds port with ftgl support} {
160    configure.args-append   --with-ftgl-incdir="${prefix}/include" \
161                            --with-ftgl-libdir="${prefix}/lib"
162    depends_lib-append      port:ftgl
163}
164
165variant xml description {Builds port with xml support} {
166    configure.args-delete   --disable-xml
167    configure.args-append   --enable-xml \
168                            --with-xml-incdir="${prefix}/include/libxml2" \
169                            --with-xml-libdir="${prefix}/lib"
170    depends_lib-append      port:libxml2
171}
172
173variant qt_x11 conflicts qt_mac description {Builds port with Qt support via X11 UI} {
174    # fix where "qglobal.h" is found in all files that use or reference it
175    post-patch {
176        foreach tpf { configure graf2d/qt/src/TGQt.cxx } {
177            reinplace "s@Qt/qglobal\\.h@QtCore/qglobal\\.h@g" \
178                ${worksrcpath}/${tpf}
179        }
180        reinplace "/qttestdir/s@Qt@QtCore@g" ${worksrcpath}/configure
181    }
182
183    configure.env-append    QTDIR=${prefix}/libexec/qt4-x11
184    configure.args-delete   --disable-qt
185    configure.args-append   --enable-qt
186    depends_lib-append      port:qt4-x11
187}
188
189if {[variant_isset qt_mac]} {
190    PortGroup qt4 1.0
191}
192
193variant qt_mac conflicts qt_x11 description {Builds port with Qt support via Mac UI} {
194    post-patch {
195        # fix where "qglobal.h" is found in all files that use or reference it
196        foreach tpf { configure graf2d/qt/src/TGQt.cxx } {
197            reinplace "s@Qt/qglobal\\.h@QtCore/qglobal\\.h@g" \
198                ${worksrcpath}/${tpf}
199        }
200        reinplace "/qttestdir/s@Qt@QtCore@g" ${worksrcpath}/configure
201
202        # fix library search extensions to include ".la"
203        # for Qt framework libraries (only)
204        reinplace "s@\\(\\.so \\.sl \\.dylib \\.dll\\.a\\)@\\1 \\.la@g" \
205            ${worksrcpath}/configure
206    }
207
208    configure.args-delete   --disable-qt
209    configure.args-append   --enable-qt
210
211    post-configure {
212        # patch up the Makefile.config to handle the QTLIB frameworks correctly
213        reinplace "/QTLIB\[ \]/s@:= @:= -F${qt_libs_dir} @" \
214            ${worksrcpath}/config/Makefile.config
215        reinplace "/QTLIB\[ \]/s@\\(Qt\[^ \]*\\).la@-framework \\1@g" \
216            ${worksrcpath}/config/Makefile.config
217    }
218}
219
220variant mysql description {Builds port with mysql support} {
221    configure.args-delete   --disable-mysql
222    configure.args-append   --enable-mysql \
223                            --with-mysql-incdir="${prefix}/include/" \
224                            --with-mysql-libdir="${prefix}/lib"
225    depends_lib-append      port:mysql5
226}
227
228variant pythia description {Pythia support for root} {
229    configure.args-delete   --disable-pythia8
230    configure.args-append   --enable-pythia8 \
231                            --with-pythia8-incdir=${prefix}/include \
232                            --with-pythia8-libdir=${prefix}/lib
233    depends_lib-append      port:pythia
234}
235
236variant gfortran description {Adds support for fortran compilation} {
237    configure.args-append --with-f77=gfortran-mp-4.2
238    depends_lib-append      port:gcc42
239}
240
241livecheck.type              regex
242livecheck.url               [lindex ${master_sites} 0]
243livecheck.regex             ${name}_v(\[0-9a-z.\]+)\\.source