Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README/ReleaseNotes/v642/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The following people have contributed to this new version:
* The general direction of the ROOT project is to become more and more reliant on system packages. It is *recommended* to make the packages required by ROOT available on the system, e.g. via a package manager, and not with the builtin mechanism. This allows for timely updates and reduces the size of the installed binaries.
* The previously vendored builtins `ftgl`, `gl2ps`, `gtest`, `nlohmann_json`, `unuran`, `civetweb`, `xxhash`, `pcre2`, should be installed in the system if possible (e.g. via `apt-get` or `homebrew` package managers). ROOT will not automatically fall-back to their builtin versions if these are not found: the user is informed of that with a helpful message. If installing these dependencies in the system is not possible, the CMake option `-Dbuiltin_XYZ=ON` has to be consciously chosen by the user.
* For the builtin versions of `ftgl`, `gl2ps`, `gtest`, `nlohmann_json`, `unuran`, `civetweb`, `xxhash`, `pcre2`, the source tarballs are now fetched from [SPI](https://spi.web.cern.ch)'s [website](https://lcgpackages.web.cern.ch/), as for the vast majority of ROOT's builtins.
* Similarly for `mathjax`, it is a new builtin build option to be installed in the system if possible, otherwise source tarball is fetched from SPI if builtin_mathjax=ON, rather than vendoring it within ROOT.

## Python Interface

Expand Down
4 changes: 2 additions & 2 deletions builtins/mathjax/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ExternalProject_Add(
MATHJAX
URL ${CMAKE_SOURCE_DIR}/documentation/doxygen/mathjax.tar.gz
URL_HASH SHA256=c5e22e60430a65963a87ab4dcc8856b9be5bd434d3b3871f27ee65b584c3c3ea
URL ${lcgpackages}/mathjax-3.2.0.tar.gz
URL_HASH SHA256=6847f1cfdd980afbe31b466474da301a56ab859a67d8035442b052dd4ac2fa03
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
92 changes: 92 additions & 0 deletions cmake/modules/FindMathJax.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Find MathJax v4, if not there v3, and if not there, fall back to finding v2
# MathJax_ROOT or MathJax_DIR can be set as hints for the search
# The script first searchs for es5/tex-mml-chtml.js and es5/tex-svg.js files
# which are required by ROOT doxygen and jsroot/webgui respectively, for MathJax v3.
# If not found, it then searches for MathJax.js for MathJax v2
# The following variables are then set
#
# ``MathJax_FOUND``
# True if MathJax v4 or v3 or v2 were found.
# ``MathJax_DIR``
# The base directory of the MathJax v4 or v3 or v2 installations
# or MathJax_DIR-NOTFOUND if nothing found
# ``MathJax_VERSION``
# 4, 3 or 2, or MathJax_VERSION-NOTFOUND if nothing found

find_path(MathJax4_PATH
NAMES
"node-main.js"
"tex-mml-chtml.js" # Used by Doxygen
"tex-svg.js" # Used by jsroot
HINTS
$ENV{MathJax_ROOT}
${MathJax_ROOT}
$ENV{MathJax_DIR}
${MathJax_DIR}
PATHS
/usr/share/mathjax/
/usr/share/mathjax4/
/usr/share/javascript/mathjax
/opt/local/share/javascript/mathjax
/usr/lib/node_modules/mathjax
DOC "Path to MathJax4 installation")

if(MathJax4_PATH)
set(MathJax_DIR "${MathJax4_PATH}")
set(MathJax_VERSION 4)
else()
find_path(MathJax3_PATH
NAMES
"es5/tex-mml-chtml.js" # Used by Doxygen
"es5/tex-svg.js" # Used by jsroot
HINTS
$ENV{MathJax_ROOT}
${MathJax_ROOT}
$ENV{MathJax_DIR}
${MathJax_DIR}
PATHS
/usr/share/mathjax/
/usr/share/mathjax3/
/usr/share/javascript/mathjax
/opt/local/share/javascript/mathjax
/usr/lib/node_modules/mathjax
DOC "Path to MathJax3 installation")

if(MathJax3_PATH)
set(MathJax_DIR "${MathJax3_PATH}")
set(MathJax_VERSION 3)
else()
message(STATUS "Could not find MathJax3 installation. Looking for MathJax2.")

find_path(MathJax2_PATH
NAMES MathJax.js
HINTS
$ENV{MathJax_ROOT}
${MathJax_ROOT}
$ENV{MathJax_DIR}
${MathJax_DIR}
PATHS
/usr/share/mathjax/
/usr/share/mathjax2/
/usr/share/javascript/mathjax
/opt/local/share/javascript/mathjax
/usr/lib/node_modules/mathjax
DOC "Path to MathJax2 installation")

if(MathJax2_PATH)
set(MathJax_DIR "${MathJax2_PATH}")
set(MathJax_VERSION 2)
else()
message(STATUS "Could not find MathJax2 or MathJax3 installation.")
set(MathJax_DIR "MathJax_DIR-NOTFOUND")
set(MathJax_VERSION "MathJax_VERSION-NOTFOUND")
endif()
endif()
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MathJax
REQUIRED_VARS MathJax_DIR MathJax_VERSION
VERSION_VAR MathJax_VERSION)
mark_as_advanced(MathJax4_PATH MathJax3_PATH MathJax2_PATH)

2 changes: 2 additions & 0 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ ROOT_BUILD_OPTION(builtin_llvm ON "Build bundled copy of LLVM (advanced option)"
MARK_AS_ADVANCED(builtin_llvm)
ROOT_BUILD_OPTION(builtin_lz4 OFF "Build lz4 from an automatically downloaded source tarball (requires network)")
ROOT_BUILD_OPTION(builtin_lzma OFF "Build lzma from an automatically downloaded source tarball (requires network)")
ROOT_BUILD_OPTION(builtin_mathjax OFF "Use Mathjax from an automatically downloaded source tarball (requires network)")
ROOT_BUILD_OPTION(builtin_nlohmannjson OFF "Build nlohmann/json from an automatically downloaded source tarball (requires network)")
ROOT_BUILD_OPTION(builtin_openssl OFF "Build OpenSSL from an automatically downloaded source tarball (requires network)")
ROOT_BUILD_OPTION(builtin_openui5 ON "Use openui5 bundle distributed with ROOT")
Expand Down Expand Up @@ -268,6 +269,7 @@ if(builtin_all)
if(APPLE)
set(builtin_openssl_defvalue ON)
endif()
set(builtin_mathjax_defvalue ON)
set(builtin_openui5_defvalue ON)
set(builtin_pcre_defvalue ON)
set(builtin_png_defvalue ON)
Expand Down
13 changes: 11 additions & 2 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ if(mathmore OR (tmva-cpu AND use_gsl_cblas))
endif()
endif()
endif()

if(webgui)
ROOT_FIND_REQUIRED_DEP(MathJax builtin_mathjax)
endif()

if(NOT "${MISSING_PACKAGES}" STREQUAL "")
list(REMOVE_DUPLICATES MISSING_PACKAGES)
Expand Down Expand Up @@ -1134,7 +1136,14 @@ if(webgui)
add_subdirectory(builtins/openui5)
endif()
add_subdirectory(builtins/rendercore)
add_subdirectory(builtins/mathjax)
if (builtin_mathjax)
ROOT_CHECK_CONNECTION("builtin_mathjax=ON")
if(NO_CONNECTION)
message(WARNING "No internet connection, jsroot/webgui will not be able to use the optional mathjax engine for rendering")
else()
add_subdirectory(builtins/mathjax)
endif()
endif()
endif()

#------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions documentation/doxygen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ filter:

mathjax:
$(call MkDir,$(DOXYGEN_IMAGE_PATH))
curl -o mathjax.tar.gz https://lcgpackages.web.cern.ch/tarFiles/sources/mathjax-3.2.0.tar.gz
tar xfz mathjax.tar.gz -C $(DOXYGEN_IMAGE_PATH)

js:
Expand Down
Binary file removed documentation/doxygen/mathjax.tar.gz
Binary file not shown.