-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
613 lines (538 loc) · 25.4 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# -*- 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
PortSystem 1.0
PortGroup active_variants 1.1
PortGroup cmake 1.1
PortGroup compilers 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup github 1.0
PortGroup select 1.0
PortGroup legacysupport 1.1
# Please also check if Gate needs a revbump after root6 update
github.setup root-project root 6-32-02 v
version [string map {- .} ${github.version}]
revision 0
livecheck.version ${github.version}
# Use git commit
#github.setup root-project root 6e90aef0c646668a513fd2e291500c0c31fa1af2
#github.setup cjones051073 root 6e90aef0c646668a513fd2e291500c0c31fa1af2
#version 6.14.00
#livecheck.version 6-14-00
#revision 0
checksums rmd160 8cd8549f9f06fd901fc810562481fbdd4a08035a \
sha256 8e4afdc4a39b1a6ec283e89b458343ee43de23e0b3268a6ae8fb1dec0b8d2f73 \
size 192904849
# extract major version
set version_major [lindex [split ${version} .] 0]
livecheck.type regex
livecheck.url ${github.homepage}/tags
# even numbered minor releases are production releases, odd are developmental so skip.
# Also, skip anything with trailing rcX etc.
livecheck.regex {v(6[-.]\d[02468][-.]\d{2}).tar.gz}
name root${version_major}
categories science
maintainers {jonesc @cjones051073} {mojca @mojca}
license LGPL-2.1+
description ROOT is a data analysis framework from CERN
long_description The ROOT system provides a set of frameworks with all \
the functionality needed to handle and analyze large amounts \
of data in a very efficient way.
homepage https://root.cern.ch/
platforms {darwin >= 17}
dist_subdir root/${version}
# Use compilers PG to pick a fortran compiler
compilers.choose f90 fc f77
compilers.setup require_fortran -g95 -gcc44 -gcc45 -gcc46 -gcc47 -gcc48 -gcc49 -gcc5 -gcc6 -gcc7 -gcc8
compiler.blacklist-append *gcc* {clang < 920} {macports-clang-3.[0-9]} {macports-clang-[4-6].0}
# c++17 filesystem required, only available in Xcode clang from macOS 10.15
compiler.blacklist-append {clang < 1200}
# If using MacPorts clang, make sure it's added as a runtime dep as well as cling will need it.
if {[regexp {macports-clang-(.*)} ${configure.compiler} -> clang_v]} {
depends_run-append port:clang-${clang_v}
}
# https://trac.macports.org/ticket/69945
use_parallel_build no
depends_build-append port:pkgconfig
depends_lib-append port:expat \
port:gmp \
port:giflib \
path:include/turbojpeg.h:libjpeg-turbo \
port:libpng \
port:lzma \
port:pcre \
port:tiff \
port:xz \
port:gl2ps \
port:lz4 \
port:vdt \
port:tbb \
port:xxhashlib \
port:z3 \
port:zstd \
port:nlohmann-json \
port:zlib \
port:bzip2 \
port:brotli \
port:librsvg \
path:lib/libopenblas.dylib:OpenBLAS \
path:lib/libssl.dylib:openssl
depends_run-append port:root_select
cmake.out_of_source yes
#cmake.generator Ninja
# TODO: the file ${filespath}/${name} would have to be generated on the fly instead
select.group root
select.file ${filespath}/${name}
# port specific location
set install_prefix ${prefix}/libexec/root${version_major}
patch.pre_args-replace -p0 -p1
configure.args-append \
-Dgnuinstall=ON \
-Drpath=ON \
-DCMAKE_INSTALL_PREFIX="${install_prefix}" \
-DCMAKE_INSTALL_SYSCONFDIR="${install_prefix}/etc/root" \
-DCMAKE_INSTALL_NAME_DIR="${install_prefix}/lib/root" \
-Dfortran=ON \
-Dbuiltin_davix=OFF \
-Dbuiltin_freetype=ON \
-Dbuiltin_glew=OFF \
-Dbuiltin_pcre=OFF \
-Dbuiltin_zlib=OFF \
-Dbuiltin_lzma=OFF \
-Dbuiltin_tbb=OFF \
-Dbuiltin_afterimage=ON \
-Ddavix=OFF \
-Dfftw3=OFF \
-Dkrb5=OFF \
-Dmysql=OFF \
-Dsqlite=OFF \
-Dodbc=OFF \
-Dopengl=OFF \
-Dpythia6=OFF \
-Dpythia8=OFF \
-Droofit=OFF \
-Dssl=ON \
-Dxml=OFF \
-Dpyroot=OFF \
-Dfitsio=OFF \
-Dpgsql=OFF \
-Ddcache=OFF \
-Dchirp=OFF \
-Dhdfs=OFF \
-Druby=OFF \
-Dtmva=OFF \
-Dqt=OFF \
-Dqtgsi=OFF \
-Dgviz=OFF \
-Dsoversion=ON \
-Dcxx14=OFF \
-Dlibcxx=ON \
-Dxrootd=OFF \
-Dbuiltin_ftgl=ON \
-Dbuiltin_gsl=ON \
-Dmathmore=ON \
-Dgenvector=ON \
-Dunuran=ON \
-Dgdml=ON \
-Dhttp=ON \
-Dvc=OFF \
-Dastiff=ON \
-Dgeocad=OFF \
-Dr=OFF \
-Droot7=OFF \
-Dwebgui=ON \
-Dbuiltin_veccore=OFF \
-DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
-DPNG_PNG_INCLUDE_DIR=${prefix}/include
configure.env-append \
TBB_ROOT=${prefix}/libexec/tbb
# https://root-forum.cern.ch/t/v6-22-00-build-error-on-macos/40239
configure.args-append -Druntime_cxxmodules=OFF
# Enable C++17
compiler.cxx_standard 2017
cmake.set_cxx_standard yes
# Configure the C++ runtime to use
if { ${configure.cxx_stdlib} ne "libc++" } {
configure.args-replace -Dlibcxx=ON -Dlibcxx=OFF
}
# Configure the graphics backend. cocoa on macOS 10.12 and newer. X11 otherwise
if {${os.platform} eq "darwin" && ${os.major} >= 16} {
if {![variant_isset x11]} {
default_variants-append +cocoa
}
} else {
if {![variant_isset cocoa]} {
default_variants-append +x11
}
}
# Enable xrootd support by default
if {${os.platform} eq "darwin" && ${os.major} >= 12} {
default_variants-append +xrootd
}
if {${os.platform} eq "darwin" && ${os.major} >= 20} {
# Starting with macOS 11 the SDK version changes on incremental OS updates,
# e.g. going from 11.0 to 11.1. This causes problems with root as it bakes
# the SDK version (sysroot) into a number of places in the installed files
# and thus users will run into problems if they try and use a binary built on
# one incremental OS version, on a different one with a different SDK available.
# This is probably not the only port that will have this problem, and we might
# need to come up with a better policy in MacPorts to handle this, but until then
# unset the sdk version to use, which causes a fallback to the unversioned SDK path.
configure.sdk_version
}
if {${os.platform} eq "darwin" && ${os.major} >= 22} {
if { [vercmp ${xcodeversion} >= 15.0] || [vercmp ${xcodecltversion} >= 15.0] } {
# On macOS13 and newer ensure the 'legacy' linker is used as GCC currently has problems
# with the new default linker in Xcode 15. See e.g.
# https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
# https://discussions.apple.com/thread/255137447
# https://developer.apple.com/forums/thread/737707
# https://github.com/Homebrew/homebrew-core/issues/145991
configure.ldflags-append -Wl,-ld_classic
}
}
pre-configure {
# Force use of system python in build scripts
# Find command finds text files containing the string to be replaced.
# shtest-encoding.py intentionally includes an unreadable character, so have to skip it ...
set pystringtoreplace "/usr/bin/env python"
foreach f [ exec find ${worksrcpath} -type f -and -not -name "shtest-encoding.py" -and -name "*.py" ] {
reinplace -q "s|${pystringtoreplace}|/usr/bin/python|g" $f
}
}
post-build {
ui_debug "Searching ${workpath}/build for third party build logs ..."
foreach log [ exec find ${workpath}/build -type f -and -name "*.log" ] {
ui_debug "Contents of ${log} :-"
set f [open ${log}]
set lines [split [read $f] "\n"]
foreach line $lines {
ui_debug "${line}"
}
close $f
}
}
post-destroot {
# Set execute flag on binaries (broken in 6.06.00)
foreach f [glob -directory ${destroot}${install_prefix}/bin *] {
system "chmod +x $f"
}
# create versioned symlinks for the content of libexec bin dir
foreach f [glob -directory ${destroot}${install_prefix}/bin *] {
set filename [file tail $f]
set extension [file extension $filename]
set base [file rootname $filename]
set versioned_filename ${base}${version_major}${extension}
ln -s ${install_prefix}/bin/${filename} ${destroot}${prefix}/bin/${versioned_filename}
}
# lib dir
ln -s ${install_prefix}/lib/root ${destroot}${prefix}/lib/root${version_major}
# include dir
ln -s ${install_prefix}/include/root ${destroot}${prefix}/include/root${version_major}
# etc dir
ln -s ${install_prefix}/etc/root ${destroot}${prefix}/etc/root${version_major}
# share dir
ln -s ${install_prefix}/share ${destroot}${prefix}/share/root${version_major}
# Compress manpages in custom location (borrowed from mariadb)
set manpath ${install_prefix}/share/man
set gzip [findBinary gzip ${portutil::autoconf::gzip_path}]
foreach manpage [glob -type f ${destroot}${manpath}/man1/*] {
# Zip the man file
system "$gzip -9vf ${manpage}"
# Create man pages for versioned files
set filename [file tail $manpage]
set extension [file extension $filename]
set base [file rootname $filename]
set versioned_filename ${base}${version_major}${extension}.gz
set d [file tail $manpage]
ln -s ${manpath}/man1/${d}.gz ${destroot}${prefix}/share/man/man1/${versioned_filename}
}
# Define font path in system config file
set rootsystemrcfile ${destroot}${prefix}/libexec/root${version_major}/etc/root/system.rootrc
# uncoment some settings
reinplace "s|#\*\.\*\.Root\.TTFontPath|\*\.\*\.Root\.TTFontPath|g" ${rootsystemrcfile}
reinplace "s|#Unix\.\*\.Gui.IconPath|Unix\.\*\.Gui\.IconPath|g" ${rootsystemrcfile}
# fix libGLEW.dylib install location
move ${destroot}${install_prefix}/lib/libGLEW.dylib ${destroot}${install_prefix}/lib/root/
}
set run_port_select "No"
pre-activate {
if { ![file exists ${prefix}/bin/root] &&
![file exists ${prefix}/bin/root5] &&
![file exists ${prefix}/bin/root6] } {
set run_port_select "Yes"
}
}
post-activate {
ui_msg "======================================================================================"
if { ${run_port_select} == "Yes" } {
ui_msg " Making root${version_major} your default root version. To change this run 'sudo port select root'"
catch { system "port select root root${version_major}" }
} else {
ui_msg " To make root${version_major} your default root version, run 'sudo port select root root${version_major}'"
}
ui_msg "======================================================================================"
}
universal_variant no
default_variants-append +xml +tmva +roofit +graphviz +opengl +davix
variant native description {Build with best native support for local CPU capabilities} {
configure.cflags-append -O3 -mtune=native
configure.cppflags-append -O3 -mtune=native
configure.fflags-append -O3 -mtune=native
}
variant qt4 description {Enable QT4 support} {
configure.args-replace -Dqt=OFF -Dqt=ON
PortGroup qt4 1.0
}
variant veccore description {Enable VecCore support} {
configure.args-replace -Dbuiltin_veccore=OFF -Dbuiltin_veccore=ON
}
variant valgrind description {Build internal LLVM library with valgrind support} {
depends_lib-append port:valgrind
}
variant vc description {Build with Vc library support} {
depends_lib-append port:Vc
configure.args-replace -Dvc=OFF -Dvc=ON
}
variant debug description {Enable a debug build} {
configure.args-append -DCMAKE_BUILD_TYPE=Debug
}
variant xrootd description {Build with XRootD support} {
configure.args-replace -Dxrootd=OFF -Dxrootd=ON
# configure.args-append -Dbuiltin_xrootd=ON
configure.args-append -DXROOTD_INCLUDE_DIR="${prefix}/include/xrootd"
depends_lib-append port:xrootd
}
variant graphviz description {Build with graphviz support} {
configure.args-replace -Dgviz=OFF -Dgviz=ON
configure.args-append -DGRAPHVIZ_INCLUDE_DIR="${prefix}/include"
# -DGRAPHVIZ_CDT_LIBRARY="${prefix}/lib/libcdt.dylib" \
# -DGRAPHVIZ_GRAPH_LIBRARY="${prefix}/lib/libcgraph.dylib" \
# -DGRAPHVIZ_GVC_LIBRARY="${prefix}/lib/libgvc.dylib" \
# -DGRAPHVIZ_PATHPLAN_LIBRARY="${prefix}/lib/libpathplan.dylib"
depends_lib-append path:bin/dot:graphviz
}
variant fftw3 description {Build with fftw3 support} {
configure.args-replace -Dfftw3=OFF -Dfftw3=ON
configure.args-append -DFFTW_INCLUDE_DIR="${prefix}/include" \
-DFFTW_LIBRARY="${prefix}/lib/libfftw3.dylib"
depends_lib-append port:fftw-3
}
variant fitsio description {Build with fitsio support} {
configure.args-replace -Dfitsio=OFF -Dfitsio=ON
depends_lib-append port:cfitsio
}
variant odbc description {Build with odbc support} {
configure.args-replace -Dodbc=OFF -Dodbc=ON
configure.args-append -DODBC_INCLUDE_DIR="${prefix}/include" \
-DODBC_LIBRARY="${prefix}/lib/libiodbc.dylib"
depends_lib-append port:libiodbc
}
variant roofit description {Build the RooFit advanced fitting package} {
configure.args-replace -Droofit=OFF -Droofit=ON
}
variant tmva description {Build the TMVA package} {
configure.args-replace -Dtmva=OFF -Dtmva=ON
}
variant opengl description {Build with opengl support} {
configure.args-replace -Dopengl=OFF -Dopengl=ON
configure.args-replace -Dbuiltin_glew=OFF -Dbuiltin_glew=ON
}
# ========================================================================================
# Setup various python variants
# ========================================================================================
# List of possible python versions
set python_versions { 3.8 3.9 3.10 3.11 3.12 }
# Enable python variant by default on OS X 10.9 and newer.
# Disabled on older systems due to an issue fetching the source for
# the various python dependencies due to these systems having out of
# date SSL versions that are rejected by the upstream server.
if {${os.platform} ne "darwin" || ${os.major} >= 13} {
set default_python_variant +python312
} else {
set default_python_variant ""
}
# Define the available variants
foreach py_ver ${python_versions} {
set py_ver_no_dot [join [split ${py_ver} "."] ""]
set variant_line {variant python${py_ver_no_dot} description "Build with python ${py_ver} support"}
foreach py_over ${python_versions} {
if { ${py_ver} == ${py_over} } { continue }
set py_over_no_dot [join [split ${py_over} "."] ""]
append variant_line " conflicts python${py_over_no_dot}"
}
append variant_line { { } }
eval $variant_line
if {[variant_isset python${py_ver_no_dot}]} {
if {${default_python_variant} != "+python${py_ver_no_dot}"} {
set default_python_variant ""
}
}
}
if {${default_python_variant} != ""} {
default_variants-append "${default_python_variant}"
}
variant jupyter description {Enable Jupyter support} { }
# If a python variant is enabled, activate it
set active_python_version ""
foreach py_ver ${python_versions} {
set py_ver_no_dot [join [split ${py_ver} "."] ""]
if {[variant_isset python${py_ver_no_dot}]} {
set active_python_version ${py_ver}
set active_python_version_no_dot ${py_ver_no_dot}
# Check root5 variants
pre-activate {
set portname root5
if {![catch {set result [active_variants ${portname} python${active_python_version_no_dot}]}]} {
if {$result} {
ui_error "Cannot install ${name} with +python${active_python_version_no_dot} variant"
return -code error "${portname} port is already installed with +python${active_python_version_no_dot} and both cannot be active at once. Pick a different python variant."
}
}
}
# Setup python
set mypydir ${frameworks_dir}/Python.framework/Versions/${py_ver}
configure.args-replace -Dpyroot=OFF -Dpyroot=ON
configure.args-append -DPYTHON_INCLUDE_DIR="${mypydir}/Headers" \
-DPYTHON_EXECUTABLE="${mypydir}/bin/python${py_ver}"
# Explicitly set python library
if { [ file exists "${mypydir}/lib/libpython${py_ver}.dylib" ] } {
configure.args-append -DPYTHON_LIBRARY="${mypydir}/lib/libpython${py_ver}.dylib"
} elseif { [ file exists "${prefix}/lib/libpython${py_ver}.dylib" ] } {
configure.args-append -DPYTHON_LIBRARY="${prefix}/lib/libpython${py_ver}.dylib"
}
depends_lib-append port:python${py_ver_no_dot} \
port:py${py_ver_no_dot}-numpy \
port:py${py_ver_no_dot}-gnureadline
if {[variant_isset jupyter ]} {
depends_lib-append port:py${py_ver_no_dot}-jupyter \
port:py${py_ver_no_dot}-metakernel
}
post-destroot {
# Install PyROOT in the correct place
set mypyincdir ${frameworks_dir}/Python.framework/Versions/${active_python_version}/include
set mypylibdir ${frameworks_dir}/Python.framework/Versions/${active_python_version}/lib/python${active_python_version}
set mypysitedir ${mypylibdir}/site-packages/
file mkdir ${destroot}${mypysitedir}
# Move X.py files to site-packages
foreach pyfile [glob ${destroot}${install_prefix}/lib/root/*.py*] { move $pyfile ${destroot}${mypysitedir}/ }
# Fix PyROOT....
set py_ver_dash [join [split ${py_ver} "."] "_"]
foreach f [ exec find ${destroot}${install_prefix}/lib/root/ -name "libcppyy*${py_ver_dash}*" ] {
set fname [file tail ${f}]
set fname_nover [string map "${py_ver_dash}. ." ${fname}]
ln -s ${fname} ${destroot}${install_prefix}/lib/root/${fname_nover}
}
# See also https://trac.macports.org/ticket/58942
foreach fname { cppyy cppyy_backend JsMVA JupyROOT ROOT } {
ln -s ${install_prefix}/lib/root/${fname} ${destroot}${mypysitedir}/
}
foreach fname [ glob -tails -directory ${destroot}${install_prefix}/lib/root/ lib* ] {
ln -s ${install_prefix}/lib/root/${fname} ${destroot}${mypysitedir}/
}
# Fix cppyy loader imports...
set cppyy_lib_dir ${install_prefix}/lib/root/cppyy_backend/lib
file mkdir ${destroot}${cppyy_lib_dir}
foreach fname [ glob -tails -directory ${destroot}${install_prefix}/lib/root/ libcppyy* ] {
ln -s ${install_prefix}/lib/root/${fname} ${destroot}${cppyy_lib_dir}/
}
file mkdir ${destroot}${mypyincdir}
ln -s ${install_prefix}/include/root/CPyCppyy ${destroot}${mypyincdir}/
# Fix python version in scripts
set pystringtoreplace "/usr/bin/python"
foreach f [ exec find ${destroot}${install_prefix} -type f -and -name "*.py" ] {
reinplace -q "s|${pystringtoreplace}|${prefix}/bin/python${active_python_version}|g" $f
}
# Add rpath to all libraries
# https://root-forum.cern.ch/t/import-error/49492
foreach f [ exec find ${destroot}${install_prefix}/ -name "*.so" -or -name "*.dylib"] {
system "install_name_tool -add_rpath ${install_prefix}/lib/root ${f} > /dev/null 2>&1 ; true"
}
}
if {[variant_isset jupyter ]} {
# patch the command ROOT assumes to run for jupyter
pre-configure {
foreach f [ exec find ${worksrcpath}/ -type f -and -name "nbmain.cxx" ] {
reinplace "s|\"jupyter\"|\"jupyter-${active_python_version}\"|g" $f
}
}
}
}
}
# ========================================================================================
variant davix description {Enable Davix support} {
configure.args-replace -Ddavix=OFF -Ddavix=ON
depends_lib-append port:davix
}
variant xml description {Build with xml support} {
configure.args-replace -Dxml=OFF -Dxml=ON
configure.args-append -DLIBXML2_INCLUDE_DIR="${prefix}/include/libxml2" \
-DLIBXML2_LIBRARIES="${prefix}/lib/libxml2.dylib" \
-DLIBXML2_LIBRARY="${prefix}/lib/libxml2.dylib" \
-DLIBXML2_XMLLINT_EXECUTABLE="${prefix}/bin/xmllint"
depends_lib-append port:libxml2
}
variant sqlite3 description {Build with sqlite3 support} {
configure.args-replace -Dsqlite=OFF -Dsqlite=ON
depends_lib-append port:sqlite3
}
variant mysql conflicts mariadb percona description {Build with mysql support} {
set ver 57
configure.args-replace -Dmysql=OFF -Dmysql=ON
configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mysql${ver}/bin/mysql_config"
depends_lib-append port:mysql${ver}
}
variant mariadb conflicts mysql percona description {Build with mariadb support} {
set ver 10.2
configure.args-replace -Dmysql=OFF -Dmysql=ON
configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/mariadb-${ver}/bin/mysql_config"
depends_lib-append port:mariadb-${ver}
}
variant percona conflicts mysql mariadb description {Build with percona support} {
configure.args-replace -Dmysql=OFF -Dmysql=ON
configure.args-append -DMYSQL_CONFIG_EXECUTABLE=${prefix}"/lib/percona/bin/mysql_config"
depends_lib-append port:percona
}
variant postgresql conflicts description {Build with PostgreSQL support} {
set ver 96
configure.args-replace -Dpgsql=OFF -Dpgsql=ON
configure.args-append -DPOSTGRESQL_INCLUDE_DIR="${prefix}/include/postgresql${ver}" \
-DPOSTGRESQL_LIBRARY="${prefix}/lib/postgresql${ver}/libpq.dylib"
depends_lib-append port:libpqxx port:postgresql${ver}
}
# variant oracle description {Build with Oracle support} {
# configure.args-replace --disable-oracle --enable-oracle
# configure.args-append -DORACLE_PATH_INCLUDES="${prefix}/lib/oracle/sdk/include" \
# -DORACLE_PATH_LIB="${prefix}/lib/oracle" \
# -DORACLE_OCI_VERSION=8
# depends_lib-append port:oracle-instantclient
# }
variant pythia description {Enables Pythia 8 support} {
configure.args-replace -Dpythia8=OFF -Dpythia8=ON
configure.args-append -DPYTHIA8_INCLUDE_DIR=${prefix}/include/pythia \
-DPYTHIA8_LIBRARY=${prefix}/lib/libpythia8.dylib
depends_lib-append port:pythia
}
variant cocoa conflicts x11 description {Enables native OSX graphical backend} {
# Enable cocoa support in configure
configure.args-append -Dcocoa=ON -Dx11=OFF
}
variant x11 conflicts cocoa description {Enables X11 graphical backend} {
# Dependencies on X11 ports
depends_lib-append port:xorg-libX11 port:mesa port:libGLU port:Xft2 port:xpm
# Disable cocoa
configure.args-append -Dcocoa=OFF -Dx11=ON \
-DOPENGL_INCLUDE_DIR=${prefix}/include \
-DOPENGL_gl_LIBRARY=${prefix}/lib/libGL.dylib \
-DX11_ICE_INCLUDE_PATH=${prefix}/include \
-DX11_SM_INCLUDE_PATH=${prefix}/include \
-DX11_X11_INCLUDE_PATH=${prefix}/include \
-DX11_Xext_INCLUDE_PATH=${prefix}/include \
-DX11_Xft_INCLUDE_PATH=${prefix}/include \
-DX11_Xpm_INCLUDE_PATH=${prefix}/include \
-DX11_ICE_LIB=${prefix}/lib/libICE.dylib \
-DX11_SM_LIB=${prefix}/lib/libSM.dylib \
-DX11_X11_LIB=${prefix}/lib/libX11.dylib \
-DX11_Xext_LIB=${prefix}/lib/libXext.dylib \
-DX11_Xft_LIB=${prefix}/lib/libXft.dylib \
-DX11_Xpm_LIB=${prefix}/lib/libXpm.dylib \
-DOPENGL_glu_LIBRARY=${prefix}/lib/libGLU.dylib
}