# SCIRun is built from its src/ tree, bypassing the Superbuild: the Superbuild # git-clones 18 externals at configure time, which cannot work offline and # would bundle libraries Fedora already ships. Every external is taken from the # system instead, except Tny and LodePNG, which Fedora does not package (see # the bundled() Provides below). # # src/ finds most externals through the Superbuild's private Config.cmake # files (CONFIG_STANDARD_EXTERNAL in src/CMakeLists.txt) rather than # find_package. %%prep writes a small shim config for each one that points at # the system library; cleaver2 ships a compatible config of its own. # TetGen is AGPL-3.0-or-later and SCIRun is MIT. With TetGen on, its code is # compiled into the core Modules_Legacy_Fields library and the module is # registered statically in the module factory, so it cannot be split into a # subpackage: the whole package would become AGPL-licensed. Off by default; # "--with tetgen" builds it in and changes the License tag accordingly. %bcond tetgen 0 # Run upstream's own regression harness (src/Testing/CMakeLists.txt) in %%check: # every regression network that needs no test data, with the GUI, under Xvfb. %bcond regression 1 # Embed the system Python 3 (Patch2); upstream's Superbuild builds its own. %bcond python 1 %global commit 985e204087ac3334a1e1846956604341652dab2d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20261006 # SCIRun's Superbuild/VERSIONS.cmake pins these two by tag; the commits are the # ones scirun-pin-2026.07.27 resolves to. %global tny_commit 08cb2652e4204af409e47bfc23ae3835c144c575 %global lodepng_commit 815f81a3322ab76e170867a3b6b8dd92e7a6cfb8 Name: scirun Version: 5.0~beta.2026^%{commitdate}git%{shortcommit} Release: 2%{?dist} Summary: Biomedical problem solving environment for simulation and visualization # SCIRun: MIT. Bundled Tny: MIT. Bundled LodePNG: Zlib. # Assets/*.font, *.sp, *.geom and Shaders/: part of SCIRun (MIT). %if %{with tetgen} License: MIT AND Zlib AND AGPL-3.0-or-later %else License: MIT AND Zlib %endif URL: https://github.com/SCIInstitute/SCIRun Source0: %{url}/archive/%{commit}/SCIRun-%{shortcommit}.tar.gz Source1: https://github.com/CIBC-Internal/Tny/archive/%{tny_commit}/Tny-%{tny_commit}.tar.gz Source2: https://github.com/CIBC-Internal/cibc-lodepng/archive/%{lodepng_commit}/cibc-lodepng-%{lodepng_commit}.tar.gz Source3: scirun.desktop Source4: scirun.metainfo.xml # Build against system spdlog/fmt 12 and shared Boost (fmt argument adapter, # link spdlog, conditional BOOST_FILESYSTEM_STATIC_LINK). Suitable for upstream. Patch0: scirun-system-spdlog-fmt-boost.patch # &data[0] on an empty vector aborts under _GLIBCXX_ASSERTIONS. Suitable for upstream. Patch1: scirun-histogram-empty-data.patch # -DSCIRUN_USE_SYSTEM_PYTHON=ON: FindPython3 instead of the Superbuild's CPython, # no private stdlib copy, interpreter imports site. Suitable for upstream. Patch2: scirun-system-python.patch BuildRequires: cmake BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: chrpath # src/CMakeLists.txt aborts without git, though the version comes from LATEST_TAG.txt BuildRequires: git-core BuildRequires: desktop-file-utils BuildRequires: /usr/bin/appstream-util BuildRequires: boost-devel BuildRequires: eigen3-devel BuildRequires: freetype-devel BuildRequires: glew-devel BuildRequires: glm-devel BuildRequires: libxml2-devel BuildRequires: sqlite-devel BuildRequires: zlib-ng-compat-devel BuildRequires: spdlog-devel BuildRequires: fmt-devel BuildRequires: pugixml-devel BuildRequires: teem-devel BuildRequires: cmake(Cleaver2) BuildRequires: qwt-qt6-devel BuildRequires: cmake(Qt6Core) BuildRequires: cmake(Qt6Gui) BuildRequires: cmake(Qt6Widgets) BuildRequires: cmake(Qt6Network) BuildRequires: cmake(Qt6OpenGL) BuildRequires: cmake(Qt6OpenGLWidgets) BuildRequires: cmake(Qt6Concurrent) BuildRequires: cmake(Qt6PrintSupport) BuildRequires: cmake(Qt6Svg) BuildRequires: cmake(Qt6DBus) BuildRequires: qt6-qttools-devel %if %{with python} BuildRequires: python3-devel %if %{with regression} # Python/Optional/uncertaintyTest1.srn5 imports UncertainSCI (and numpy). BuildRequires: python3-uncertainsci BuildRequires: python3-numpy %endif %endif BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel %if %{with tetgen} BuildRequires: tetgen-devel %endif %if %{with regression} BuildRequires: xorg-x11-server-Xvfb BuildRequires: mesa-dri-drivers %endif # The text renderer and ShowString dialog load these from /Fonts; the # 12 files are identical in name to GNU FreeFont, which Fedora packages. Requires: gnu-free-mono-fonts Requires: gnu-free-sans-fonts Requires: gnu-free-serif-fonts Requires: hicolor-icon-theme Provides: bundled(tny) = 0^20260209git08cb265 Provides: bundled(lodepng) = 20140823 # The private libraries are unversioned and live in %%{_libdir}/scirun. %global __provides_exclude_from ^%{_libdir}/scirun/.*$ %global __requires_exclude ^lib(Algorithms|Core|Dataflow|Engine|Graphics|Interface|Modules)_[A-Za-z0-9_]*\\.so.*$ Recommends: python3-numpy %description SCIRun is a problem solving environment for modeling, simulation and visualization of scientific problems, developed at the Scientific Computing and Imaging (SCI) Institute, University of Utah. Users connect modules into dataflow networks to read data, build and refine meshes, solve finite element problems such as bioelectric forward and inverse problems, and render results. %if %{with python} The Python console and InterfaceWithPython module use the system Python 3. %else This build has no embedded Python console. %endif %if %{without tetgen} The InterfaceWithTetGen module is not included (TetGen is AGPL-3.0-or-later). %endif %prep %autosetup -n SCIRun-%{commit} -p1 cd src # --- bundled single-file libraries Fedora does not ship --- mkdir -p Externals/bundled/tny/tny Externals/bundled/lodepng tar -xzf %{SOURCE1} --strip-components=3 -C Externals/bundled/tny/tny \ Tny-%{tny_commit}/src/tny/tny.c Tny-%{tny_commit}/src/tny/tny.h tar -xzf %{SOURCE1} --strip-components=1 -C . Tny-%{tny_commit}/LICENSE mv LICENSE ../LICENSE-Tny # Upstream's Tny CMakeLists generates this C++ wrapper the same way. printf '#pragma once\nextern "C" {\n#include "tny.h"\n}\n' > Externals/bundled/tny/tny/tny.hpp # Only lodepng.{cpp,h} are compiled; the fork's lpi_* files (GPL) are not extracted. tar -xzf %{SOURCE2} --strip-components=2 -C Externals/bundled/lodepng \ cibc-lodepng-%{lodepng_commit}/lodepng/lodepng.cpp \ cibc-lodepng-%{lodepng_commit}/lodepng/lodepng.h # --- unbundle pugixml: Fedora's config already defines the target `pugixml` --- rm -f Externals/pugixml/pugixml.cpp Externals/pugixml/pugiconfig.hpp printf '#pragma once\n#include \n' > Externals/pugixml/pugixml.hpp echo '# Fedora: system pugixml (found in src/CMakeLists.txt)' > Externals/pugixml/CMakeLists.txt sed -i 's|^FIND_PACKAGE(OpenGL REQUIRED)|find_package(pugixml CONFIG REQUIRED)\n&|' CMakeLists.txt sed -i '/SET_PROPERTY(TARGET pugixml /d' CMakeLists.txt grep -q 'find_package(pugixml CONFIG REQUIRED)' CMakeLists.txt # --- unbundle GNU FreeFont (symlinked in %%install) --- rm -f Interface/Modules/Render/ES/fonts/*.ttf # --- shim configs for CONFIG_STANDARD_EXTERNAL --- shim() { # ; body on stdin mkdir -p ../fedora-shims/$1 { echo "# Fedora: system $1 for SCIRun's CONFIG_STANDARD_EXTERNAL"; cat echo "set($1_FOUND TRUE)" echo "set($3 \"\${CMAKE_CURRENT_LIST_DIR}/Use.cmake\")"; } > ../fedora-shims/$1/$2 printf 'if(SCI_%s_INCLUDE)\n include_directories(SYSTEM ${SCI_%s_INCLUDE})\nendif()\n' $4 $4 \ > ../fedora-shims/$1/Use.cmake } shim Zlib ZlibConfig.cmake ZLIB_USE_FILE ZLIB <<'EOF' find_package(ZLIB REQUIRED) set(SCI_ZLIB_INCLUDE "${ZLIB_INCLUDE_DIRS}") set(SCI_ZLIB_LIBRARY ZLIB::ZLIB) EOF shim SQLite SQLiteConfig.cmake SQLITE_USE_FILE SQLITE <<'EOF' find_package(SQLite3 REQUIRED) set(SCI_SQLITE_INCLUDE "${SQLite3_INCLUDE_DIRS}") set(SCI_SQLITE_LIBRARY SQLite::SQLite3) EOF shim Freetype FreetypeConfig.cmake FREETYPE_USE_FILE FREETYPE <<'EOF' find_package(Freetype REQUIRED) set(SCI_FREETYPE_INCLUDE "${FREETYPE_INCLUDE_DIRS}") set(SCI_FREETYPE_LIBRARY Freetype::Freetype) EOF shim Teem TeemConfig.cmake Teem_USE_FILE TEEM <<'EOF' find_library(_teem_lib teem REQUIRED) find_path(_teem_inc teem/nrrd.h REQUIRED) set(SCI_TEEM_INCLUDE "${_teem_inc}") set(SCI_TEEM_LIBRARY "${_teem_lib}") EOF shim Tetgen TetgenConfig.cmake TETGEN_USE_FILE TETGEN <<'EOF' find_library(_tet_lib tet REQUIRED) find_path(_tet_inc tetgen.h REQUIRED) set(SCI_TETGEN_INCLUDE "${_tet_inc}") set(TETGEN_INCLUDE "${_tet_inc}") set(TETGEN_LIBRARY "${_tet_lib}") EOF shim Tny TnyConfig.cmake TNY_USE_FILE TNY <<'EOF' set(_d "${SCIRun_SOURCE_DIR}/Externals/bundled/tny") if(NOT TARGET tny) add_library(tny STATIC "${_d}/tny/tny.c") set_target_properties(tny PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() set(SCI_TNY_INCLUDE "${_d}") set(SCI_TNY_LIBRARY tny) EOF shim LodePng LodePngConfig.cmake LODEPNG_USE_FILE LODEPNG <<'EOF' set(_d "${SCIRun_SOURCE_DIR}/Externals/bundled") if(NOT TARGET lodepng) add_library(lodepng STATIC "${_d}/lodepng/lodepng.cpp") set_target_properties(lodepng PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() set(SCI_LODEPNG_INCLUDE "${_d}") set(SCI_LODEPNG_LIBRARY lodepng) EOF %build shims=$PWD/fedora-shims # GLM >= 1.0 refuses the gtx headers SCIRun uses without this opt-in. export CXXFLAGS="%{optflags} -DGLM_ENABLE_EXPERIMENTAL" %cmake -S src -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=OFF \ -DGIT_SUBMODULE=OFF \ -DGENERATE_COMPILATION_DATABASE=OFF \ -DGENERATE_MODULE_FACTORY_CODE=ON \ -DREGENERATE_MODULE_FACTORY_CODE=OFF \ -DWITH_GUI=ON \ -DQT_VERSION_MAJOR=6 \ -DWITH_PYTHON=%{?with_python:ON}%{!?with_python:OFF} \ -DSCIRUN_USE_SYSTEM_PYTHON=ON \ -DWITH_TETGEN=%{?with_tetgen:ON}%{!?with_tetgen:OFF} \ -DWITH_OSPRAY=OFF \ -DWITH_VTK=OFF \ -DZlib_DIR=$shims/Zlib \ -DSQLite_DIR=$shims/SQLite \ -DTeem_DIR=$shims/Teem \ -DFreetype_DIR=$shims/Freetype \ -DTNY_DIR=$shims/Tny \ -DLODEPNG_DIR=$shims/LodePng \ -DTetgen_DIR=$shims/Tetgen \ -DCLEAVER2_DIR=%{_libdir}/cmake/Cleaver2 \ -DLibXML2_DIR=%{_libdir}/cmake/libxml2 \ -DGLM_DIR=%{_includedir} \ -DSPDLOG_DIR=%{_prefix} \ -DEigen_DIR=%{_includedir}/eigen3 \ -DQWT_INCLUDE=%{_includedir}/qt6/qwt \ -DQWT_LIBRARY_DIR=%{_libdir} \ -DQWT_LIBRARY=qwt-qt6 \ -DQWT_INSTALL_DIR=%{_prefix} %cmake_build %install # Upstream has no install rules for Linux (only Windows/macOS bundles), so the # layout is done by hand. SCIRun finds Shaders/, Assets/ and Fonts/ next to # argv[0], hence the real binary in libexec and a wrapper in bindir. b=%{_vpath_builddir} install -d %{buildroot}%{_libdir}/scirun %{buildroot}%{_libexecdir}/scirun \ %{buildroot}%{_datadir}/scirun %{buildroot}%{_bindir} install -pm0755 $b/lib/*.so %{buildroot}%{_libdir}/scirun/ install -pm0755 $b/SCIRun %{buildroot}%{_libexecdir}/scirun/SCIRun # chrpath rewrites the build-tree RUNPATH in place (the new one is shorter). # patchelf 0.18 (f44) rewrote the ELF layout and left libraries unloadable # ("object file has no loadable segments"). Files with no RUNPATH link no # other SCIRun library and need none. for f in %{buildroot}%{_libdir}/scirun/*.so %{buildroot}%{_libexecdir}/scirun/SCIRun; do if chrpath -l "$f" >/dev/null 2>&1; then chrpath -r %{_libdir}/scirun "$f" fi done cp -a $b/Shaders $b/Assets %{buildroot}%{_datadir}/scirun/ install -d %{buildroot}%{_datadir}/scirun/Fonts for f in FreeMono FreeMonoBold FreeMonoBoldOblique FreeMonoOblique \ FreeSans FreeSansBold FreeSansBoldOblique FreeSansOblique \ FreeSerif FreeSerifBold FreeSerifBoldItalic FreeSerifItalic; do ln -s %{_datadir}/fonts/gnu-free/$f.ttf %{buildroot}%{_datadir}/scirun/Fonts/$f.ttf done for d in Shaders Assets Fonts; do ln -s %{_datadir}/scirun/$d %{buildroot}%{_libexecdir}/scirun/$d done cp -a src/ExampleNets %{buildroot}%{_datadir}/scirun/ExampleNets rm -rf %{buildroot}%{_datadir}/scirun/ExampleNets/need2fix cat > %{buildroot}%{_bindir}/scirun <<'EOF' #!/bin/sh exec %{_libexecdir}/scirun/SCIRun "$@" EOF chmod 0755 %{buildroot}%{_bindir}/scirun desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE3} install -Dpm0644 src/Resources/Icons/scirun5_256.png \ %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/scirun.png install -Dpm0644 %{SOURCE4} %{buildroot}%{_metainfodir}/scirun.metainfo.xml appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/scirun.metainfo.xml desktop-file-validate %{buildroot}%{_datadir}/applications/scirun.desktop %check # The installed tree must run, not just the build tree. # (RUNPATH already points at %{_libdir}/scirun, which is not populated yet.) export LD_LIBRARY_PATH=%{buildroot}%{_libdir}/scirun QT_QPA_PLATFORM=offscreen %{buildroot}%{_libexecdir}/scirun/SCIRun --version | grep -q '^v5\.0' ! ldd %{buildroot}%{_libexecdir}/scirun/SCIRun %{buildroot}%{_libdir}/scirun/*.so | grep 'not found' unset LD_LIBRARY_PATH %if %{with regression} # Upstream's harness: "-E net --no_splash --regression 60" with the GUI. Nets # that need the separate test-data download (%%SCIRUNDATADIR%%) are skipped. # Skipped on purpose, with reasons: # - complexMatrixDebut, asyncPortTest, testArrow: use modules registered only # in a BUILD_TESTING build (HardCodedModuleFactory::addTestingModules). # - nets using InterfaceWithPython, when built without Python. # - pythonCameraInterface: feeds ViewScene's screenshot output to Python; the # software-rendered Xvfb window never produces screenshot data, so the # InterfaceWithPython input stays empty ("Input data required"). # - Python/Optional (upstream skips it too) except uncertaintyTest1, which # passes with the system interpreter; the other two need Matlab helpers. export QT_QPA_PLATFORM=xcb LIBGL_ALWAYS_SOFTWARE=1 DISPLAY=:93 Xvfb :93 -screen 0 1600x1200x24 >/dev/null 2>&1 & xvfb=$! trap "kill $xvfb 2>/dev/null || :" EXIT sleep 3 R=src/ExampleNets/regression pass=0; fail=0; failed= for n in $R/Modules/*.srn5 $R/Network/*.srn5 $R/ImportExport/*.srn5 $R/Renderer/*.srn5 %{?with_python:$R/Python/*.srn5 $R/Python/Optional/uncertaintyTest1.srn5}; do grep -q SCIRUNDATADIR "$n" && continue %{!?with_python:grep -q InterfaceWithPython "$n" && continue} case "${n##*/}" in complexMatrixDebut.srn5|asyncPortTest.srn5|testArrow.srn5|pythonCameraInterface.srn5) continue ;; esac if timeout 150 %{_vpath_builddir}/SCIRun -E "$n" --no_splash --regression 60 >net.log 2>&1; then pass=$((pass+1)) else echo "== ${n#$R/} rc=$?"; tail -n 15 net.log fail=$((fail+1)); failed="$failed ${n#$R/}" fi done echo "SCIRun regression networks: $pass passed, $fail failed" [ $fail -eq 0 ] || { echo "FAILED:$failed"; exit 1; } # Guard against a harness that silently runs nothing. [ $pass -ge 200 ] %endif %files %license LICENSE.md LICENSE-Tny %doc README.md CHANGELOG.md %{_bindir}/scirun %{_libexecdir}/scirun/ %{_libdir}/scirun/ %{_datadir}/scirun/ %{_datadir}/applications/scirun.desktop %{_datadir}/icons/hicolor/256x256/apps/scirun.png %{_metainfodir}/scirun.metainfo.xml %changelog * Thu Oct 08 2026 Morgan Hough - 5.0~beta.2026^20261006git985e204-2 - Embed the system Python 3 (Patch2); run the Python regression networks too, including UncertainSCI's uncertaintyTest1. - Set the private RUNPATH with chrpath, not patchelf: patchelf 0.18 on f44 left libraries unloadable. * Thu Oct 08 2026 Morgan Hough - 5.0~beta.2026^20261006git985e204-1 - Initial package. Built from src/ against system libraries (Superbuild bypassed); Tny and two LodePNG files bundled; pugixml and GNU FreeFont unbundled; Cleaver2 from cleaver2-devel. No Python console yet; TetGen off by default (AGPL).