summaryrefslogtreecommitdiff
path: root/devel/root/Makefile
blob: 3063bbb13e2e39094f789c4b72891d9179950ef6 (plain) (blame)
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
PORTNAME=	root
DISTVERSION=	6.32.02
PORTREVISION=	1
CATEGORIES=	devel science math parallel python
MASTER_SITES=	https://root.cern/download/
DISTFILES=	${PORTNAME}_v${DISTVERSION}.source${EXTRACT_SUFX}

MAINTAINER=	erik@tenku.dk
COMMENT=	Data analysis framework made at CERN
WWW=		https://root.cern/

LICENSE=	LGPL21
LICENSE_FILE=	${WRKSRC}/LGPL2_1.txt

BUILD_AND_RUN_DEPENDS=	bash:shells/bash \
		nlohmann-json>=3:devel/nlohmann-json
BUILD_DEPENDS=	${BUILD_AND_RUN_DEPENDS}
LIB_DEPENDS=	libfreetype.so:print/freetype2 \
		liblz4.so:archivers/liblz4 \
		libpcre2-8.so:devel/pcre2 \
		libxxhash.so:devel/xxhash \
		libzstd.so:archivers/zstd
RUN_DEPENDS=	${BUILD_AND_RUN_DEPENDS}

USES=		cmake compiler:c++17-lang desktop-file-utils \
		iconv shebangfix

SHEBANG_FILES=	main/python/rootbrowse.py \
		main/python/rootcp.py \
		main/python/rootdrawtree.py \
		main/python/rooteventselector.py \
		main/python/rootls.py \
		main/python/rootmkdir.py \
		main/python/rootmv.py \
		main/python/rootprint.py \
		main/python/rootrm.py \
		main/python/rootslimtree.py \
		config/rootssh \
		etc/dictpch/makepch.py \
		etc/proof/utils/circle.sh \
		etc/proof/utils/crypt \
		etc/proof/utils/pps \
		etc/proof/utils/proofctl.sh \
		etc/proof/utils/proofinstall.sh \
		etc/pdg_table_update.py
# add a port-specific shebang to be replaced
python_OLD_CMD+=	"/usr/bin/env @python@"

# Flags and environment variables for building
CMAKE_ARGS=	-DCMAKE_CXX_STANDARD=17
CMAKE_ON=	builtin_clang builtin_cling builtin_llvm builtin_openui5 gnuinstall \
		rpath runtime_cxxmodules shared soversion
CMAKE_OFF=	arrow builtin_afterimage builtin_cfitsio builtin_cppzmq builtin_davix \
		builtin_fftw3 builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew \
		builtin_gsl builtin_gtest builtin_lz4 builtin_lzma builtin_nlohmannjson \
		builtin_openssl builtin_pcre builtin_tbb builtin_unuran builtin_vc builtin_vdt \
		builtin_veccore builtin_xrootd builtin_xxhash builtin_zeromq builtin_zlib \
		builtin_zstd cefweb clad cocoa cuda cudnn daos davix dcache fcgi fftw3 gviz \
		libcxx llvm13_broken_tests macos_native memory_termination minuit2_mpi \
		minuit2_omp mpi odbc proof pythia8 qt5web qt6web r roofit_multiprocess \
		shadowpw test_distrdf_dask test_distrdf_pyspark tmva-gpu tmva-rmva tmva-sofie \
		unfold unuran uring vc veccore vecgeom win_broken_tests winrtdebug
CONFIGURE_WRKSRC?=	${WRKDIR}/.build
MAKE_ENV+=		ROOTSYS=${CONFIGURE_WRKSRC}

# Port build options; DOCS also on by default
# See https://root.cern/install/build_from_source/#all-build-options
OPTIONS_DEFINE=	DOCS ASIMAGE DATAFRAME FITS FORTRAN GDML HTTP IMT MATHMORE MYSQL \
		OPENGL PGSQL PYROOT ROOFIT ROOT7 SPECTRUM SQLITE SSL TMLP TMVAML VDT WEBGUI \
		X11 XML XROOTD
OPTIONS_DEFAULT=	ASIMAGE DATAFRAME FITS GDML HTTP IMT MATHMORE OPENGL PYROOT \
		ROOFIT ROOT7 SPECTRUM SSL TMLP TMVAML VDT WEBGUI X11 XML XROOTD
OPTIONS_SUB=	yes

ASIMAGE_CMAKE_BOOL=	asimage
ASIMAGE_DESC=		Enable support for image processing via libAfterImage
ASIMAGE_IMPLIES=	X11
ASIMAGE_LIB_DEPENDS=	libAfterImage.so:graphics/libafterimage \
		libgif.so:graphics/giflib \
		libpng16.so:graphics/png \
		libtiff.so:graphics/tiff
ASIMAGE_USES=	gettext-runtime gnome jpeg
ASIMAGE_USE=	gnome=cairo,gdkpixbuf2,glib20,librsvg2

# TODO: clad can only be included in ROOT's configure stage
# with network access, however, a port of clad is available -- patch
#CLAD_CMAKE_BOOL=	clad
#CLAD_DESC=		Build clad, the cling automatic differentiation plugin (requires network)
#CLAD_LIB_DEPENDS=	libclad.so:math/clad

DATAFRAME_CMAKE_BOOL=	dataframe
DATAFRAME_DESC=			Enable ROOT RDataFrame

# TODO: davix only comes with pkgconfig file on fbsd, while
# ROOT's configure stage relies on find_package() -- patch
#DAVIX_CMAKE_BOOL=	davix
#DAVIX_DESC=		Enable support for Davix (HTTP/WebDAV access)
#DAVIX_IMPLIES=	libuuid xml2 openssl
#DAVIX_LIB_DEPENDS=	libdavix.so:www/davix

FITS_CMAKE_BOOL=	fitsio
FITS_DESC=		Enable support for reading FITS images
FITS_LIB_DEPENDS=	libcfitsio.so:astro/cfitsio \
		libcurl.so:ftp/curl

FORTRAN_CMAKE_BOOL=	fortran
FORTRAN_DESC=		Build Fortran components of ROOT
FORTRAN_USES=		fortran

GDML_CMAKE_BOOL=	gdml
GDML_DESC=		Enable support for GDML (Geometry Description Markup Language)

HTTP_CMAKE_BOOL=	http
HTTP_DESC=		Enable support for HTTP server
HTTP_IMPLIES=	WEBGUI

IMT_CMAKE_BOOL=	imt
IMT_DESC=		Enable support for implicit multi-threading via Intel® Thread Building Blocks (TBB)
IMT_LIB_DEPENDS=	libtbb.so:devel/onetbb

MATHMORE_CMAKE_BOOL=	mathmore
MATHMORE_DESC=		Build libMathMore extended math library
MATHMORE_LIB_DEPENDS=	libgsl.so:math/gsl

MYSQL_CMAKE_BOOL=	mysql
MYSQL_DESC=		Enable support for MySQL databases
MYSQL_LIB_DEPENDS=	libunwind.so:devel/libunwind
MYSQL_USES=		mysql ssl

OPENGL_CMAKE_BOOL=	opengl
OPENGL_DESC=		Enable support for OpenGL
OPENGL_IMPLIES=	X11
OPENGL_LIB_DEPENDS=	libftgl.so:graphics/ftgl \
		libgl2ps.so:print/gl2ps
OPENGL_USES=	gl
OPENGL_USE=		gl=glew,glu,opengl

PGSQL_CMAKE_BOOL=	pgsql
PGSQL_DESC=		Enable support for PostgreSQL
PGSQL_USES=		pgsql:13+

PYROOT_CMAKE_BOOL=	pyroot tmva-pymva
PYROOT_DESC=		Enable bindings between Python and C++ with PyROOT
PYROOT_BUILD_DEPENDS=	${PYNUMPY}
PYROOT_USES=		python:3.9+,build,run
PYROOT_USES_OFF=	python:3.9+,build

ROOFIT_CMAKE_BOOL=	roofit
ROOFIT_DESC=		Build the advanced fitting package RooFit, and RooStats for statistical tests

ROOT7_CMAKE_BOOL=	root7
ROOT7_DESC=		Build ROOT 7 components of ROOT

SPECTRUM_CMAKE_BOOL=	spectrum
SPECTRUM_DESC=		Enable support for TSpectrum

SQLITE_CMAKE_BOOL=	sqlite
SQLITE_DESC=		Enable support for SQLite
SQLITE_USES=		sqlite

SSL_CMAKE_BOOL=	ssl
SSL_DESC=		Enable support for SSL encryption via OpenSSL
SSL_USES=		ssl

TMLP_CMAKE_BOOL=	mlp
TMLP_DESC=		Enable support for TMultilayerPerceptron classes' federation
TMLP_IMPLIES=	TMVAML

TMVAML_CMAKE_BOOL=	tmva tmva-cpu
TMVAML_DESC=		Build TMVA multi variate analysis library, including TMVA with CPU support for deep learning
TMVAML_IMPLIES=	IMT
TMVAML_LIB_DEPENDS=	libopenblas.so:math/openblas

VDT_CMAKE_BOOL=	vdt
VDT_DESC=		Enable support for VDT (fast and vectorisable mathematical functions)
VDT_LIB_DEPENDS=	libvdt.so:math/vdt

WEBGUI_CMAKE_BOOL=	webgui
WEBGUI_DESC=		Build Web-based UI components of ROOT
WEBGUI_IMPLIES=	HTTP

X11_CMAKE_BOOL=	x11
X11_DESC=		Enable support for X11/Xft
X11_USES=		xorg
X11_USE=		xorg=ice,sm,x11,xau,xaw,xcb,xcomposite,xcursor,xdamage,xdmcp,xext \
		xorg=xfixes,xfont,xfont2,xft,xi,xinerama,xkbfile,xmu,xpm,xrandr,xrender \
		xorg=xres,xscrnsaver,xt,xv,xxf86vm

XML_CMAKE_BOOL=		xml
XML_DESC=		Enable support for XML
XML_USES=		gnome
XML_USE=		gnome=libxml2

XROOTD_CMAKE_BOOL=	xrootd
XROOTD_DESC=		Enable support for XRootD file server and client
XROOTD_LIB_DEPENDS=	libXrdCl.so:databases/xrootd

.include <bsd.port.options.mk>

ROOT_CLANG_VER=	16

PLIST_SUB+=	PYVER="${PYTHON_VER:S/./_/}" \
		ROOT_CLANG_VER="${ROOT_CLANG_VER}" \
		SHLIB_SHVER="${DISTVERSION:R}" \
		SHLIB_VER="${DISTVERSION}"

# Some .modulemap, .pcm and .idx files are not installed on aarch64, a few headers are only installed on aarch64
.if ${OPSYS} == FreeBSD && ${ARCH} == "aarch64"
PLIST_SUB+=	NOT_INSTALLED_ON_AARCH64="@comment " ONLY_INSTALLED_ON_AARCH64=""
.else
PLIST_SUB+=	NOT_INSTALLED_ON_AARCH64="" ONLY_INSTALLED_ON_AARCH64="@comment "
.endif

# atexit-like commands need 'throw()' specifier on 15aarch64
.if ${OPSYS} == FreeBSD && ${ARCH} == "aarch64" && ${OSVERSION} > 1499999
EXTRA_PATCHES=	${PATCHDIR}/extra-patch-interpreter_cling_lib_Interpreter_Interpreter.cpp.15aarch64
.endif

# std_config.pcm exclusive to FreeBSD 14.0
.if ${OPSYS} == FreeBSD && ${OSREL} == 14.0
PLIST_SUB+=	ONLY_INSTALLED_ON_FBSD140=""
.else
PLIST_SUB+=	ONLY_INSTALLED_ON_FBSD140="@comment "
.endif

# Port patch removes implicit use of system's module.modulemap and applies
# explicit use of the same module.modulemap, with modifications, provided
# by the port
eq_OSREL=	${OSREL}
.if ${OPSYS} == FreeBSD && ${OSREL} == 14.1
# module.modulemap identical on 14.1 and 15.0
eq_OSREL=	15.0
.endif
post-patch:
	${CP} \
  ${PATCHDIR}/interpreter-cling-include-cling-std__fbsd${eq_OSREL}.modulemap \
  ${WRKSRC}/interpreter/cling/include/cling/std_fbsd.modulemap

# Files in lib/root/__pycache__ have links into WRKDIR and should not be staged. This happens even when PYROOT option is OFF.
post-install:
	${RM} -r ${STAGEDIR}${PREFIX}/lib/root/__pycache__

.include <bsd.port.mk>