Ticket #27962: Portfile

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