# Disable LTO — causes undefined references across shared lib boundaries %global _lto_cflags %{nil} %define debug_package %{nil} Name: connectome-workbench Version: 2.2.1 Release: 2%{?dist} Summary: HCP Visualization and Discovery Tool License: GPL-2.0-only URL: https://github.com/Washington-University/workbench Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: ninja-build BuildRequires: gcc-c++ # Qt6. Core5Compat supplies what Qt6 dropped from Qt5 (upstream's Qt6 # find_package lists it explicitly). qtsvg is not in either find_package # COMPONENTS list, but bundled Qwt compiles QSvgRenderer/QSvgGenerator paths # unless QWT_NO_SVG is defined -- the Qt5 build relied on qt5-qtsvg-devel being # present for exactly the same reason. # qtxmlpatterns is deliberately dropped: Qt6 removed the module outright, and # nothing in the tree uses QXmlQuery / QAbstractXmlReceiver (verified). BuildRequires: qt6-qtbase-devel BuildRequires: qt6-qt5compat-devel BuildRequires: qt6-qtsvg-devel BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel BuildRequires: glm-devel BuildRequires: glib2-devel BuildRequires: zlib-devel BuildRequires: libxml2-devel BuildRequires: git-core BuildRequires: desktop-file-utils # Xvfb is required to run GUI tests in a headless build environment BuildRequires: xorg-x11-server-Xvfb Requires: qt6-qtbase Requires: qt6-qt5compat Requires: qt6-qtsvg %description Connectome Workbench is an open source visualization and discovery tool used to map neuroimaging data, especially data generated by the Human Connectome Project. %prep %autosetup -n workbench-%{version} # FIX 1: Add missing for GCC 15+. Still required at 2.2.1 -- CaretRgb.h # includes and but never , while using uint8_t. grep -q '#include ' src/Common/CaretRgb.h || exit 1 sed -i '/#include /a #include ' src/Common/CaretRgb.h grep -q '#include ' src/Common/CaretRgb.h || exit 1 # (Former FIX 2 dropped at 2.2.1: WorkbenchInstallationAssistant.cxx no longer # includes , so the substitution was a silent no-op.) # FIX 3: CaretFileDialogExtendable is dead code -- its .cxx is entirely commented # out (no implementation, so no vtable is emitted), it is used by no other source # (only listed in GuiQt/CMakeLists), yet it is still moc'd and compiled, which # links GuiQt against its never-emitted vtable/destructor -> undefined references. # Drop it from the GuiQt build lists. (Keeps the real, used CaretFileDialog.) # Still dead at 2.2.1: verified the .cxx contains no non-comment lines and the # only references are the three in GuiQt/CMakeLists.txt. sed -i '/CaretFileDialogExtendable/d' src/GuiQt/CMakeLists.txt ! grep -q 'CaretFileDialogExtendable' src/GuiQt/CMakeLists.txt || exit 1 # FIX 4 (Qt6): the top-level CMakeLists sets CARET_QT5_LINK "Qt5::Core" in the # Qt5 branch -- described upstream as a "small hack to get the qt5 compile flag # requirements into libraries" -- but leaves it at "" in the Qt6 branch. Several # libraries, notably bundled Qwt, do TARGET_LINK_LIBRARIES(... ${CARET_QT5_LINK}), # so under Qt6 they would get no Qt include dirs or compile flags at all. Mirror # the Qt5 line with the Qt6 target. python3 - <<'PYEOF' p = "src/CMakeLists.txt" s = open(p, encoding="utf-8").read() anchor = ' SET(QT_RESULT "${Qt6_VERSION}")\n' assert anchor in s, "Qt6 QT_RESULT anchor not found (upstream changed?)" add = (' # Fedora: mirror the Qt5 branch so libraries linking ${CARET_QT5_LINK}\n' ' # (e.g. bundled Qwt) inherit Qt include dirs and compile flags.\n' ' SET(CARET_QT5_LINK "Qt6::Core")\n') assert 'SET(CARET_QT5_LINK "Qt6::Core")' not in s, "already patched" open(p, "w", encoding="utf-8").write(s.replace(anchor, anchor + add, 1)) print("set CARET_QT5_LINK=Qt6::Core in the Qt6 branch") PYEOF # MOC handled by CMAKE_AUTOMOC=ON %build cd src # GCC 15 / Fedora 43 compatibility export CFLAGS="%{optflags} -Wno-error=format-security" export CXXFLAGS="%{optflags} -std=c++17 -include cstdint -fpermissive -Wno-error=format-security" %cmake -GNinja \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DWORKBENCH_USE_QT6=TRUE \ -DWORKBENCH_USE_QT5=FALSE \ -DWORKBENCH_USE_OPENMP=TRUE \ -DWORKBENCH_CHECK_FOR_UPDATES=FALSE \ -DWORKBENCH_USE_SYSTEM_FTGL=FALSE \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_CXX_STANDARD=17 \ -DWORKBENCH_USE_CMAKE_AUTOMOC=ON \ -DCMAKE_INCLUDE_CURRENT_DIR=ON %cmake_build %install cd src %cmake_install # Install desktop entry (upstream does not provide one via cmake) mkdir -p %{buildroot}%{_datadir}/applications cat > %{buildroot}%{_datadir}/applications/wb_view.desktop < - 2.2.1-2 - Switch to Qt6 (upstream 2.2.1 added WORKBENCH_USE_QT6). Qt5 is deprecated in Fedora, and 2.2.1-1 established a working Qt5 baseline to compare against. - -DWORKBENCH_USE_QT6=TRUE -DWORKBENCH_USE_QT5=FALSE; the two are mutually exclusive upstream (SEND_ERROR if both). - BuildRequires qt6-qtbase-devel + qt6-qt5compat-devel (Qt6Core5Compat is in upstream's Qt6 COMPONENTS list) + qt6-qtsvg-devel. qtsvg appears in NEITHER find_package COMPONENTS list, but bundled Qwt compiles the QSvgRenderer/QSvgGenerator paths unless QWT_NO_SVG is defined -- the Qt5 build depended on qt5-qtsvg-devel being installed for the same reason. - Drop qtxmlpatterns: Qt6 removed the module and nothing in the tree uses QXmlQuery / QAbstractXmlReceiver (verified by grep). - FIX 4: upstream sets CARET_QT5_LINK to "Qt5::Core" in the Qt5 branch -- its own comment calls it a "small hack to get the qt5 compile flag requirements into libraries" -- but leaves it empty in the Qt6 branch, so libraries doing TARGET_LINK_LIBRARIES(... ${CARET_QT5_LINK}) (bundled Qwt among them) would get no Qt include dirs or compile flags. Mirror the Qt5 line with Qt6::Core. The per-directory Qt5::/Qt6:: references elsewhere are already properly guarded by if(Qt5_FOUND)/if(Qt6_FOUND), so no further porting was needed. * Thu Jul 30 2026 Morgan Hough - 2.2.1-1 - Update to the v2.2.1 release tag (was a 2.1.0-labelled Feb-2026 commit snapshot; upstream 2.1.0 dates from Jun 2025 and 2.2.1 from Jul 2026). Re-verified every downstream fix against the new tree instead of carrying them blind: - FIX 1 ( in CaretRgb.h) STILL required: the header includes and but never while using uint8_t. Now asserts its anchor and its result so a future upstream fix turns into a build error, not a silent no-op. - FIX 2 (QtEnvironmentVariables -> QtCore) DROPPED: upstream no longer includes that header, so the sed had become a silent no-op. - FIX 3 (drop CaretFileDialogExtendable from GuiQt) STILL required: its .cxx still contains no non-comment lines, so no vtable is emitted, yet it is still listed in GuiQt/CMakeLists.txt and moc'd. Now asserts the removal took effect. - CMAKE_POLICY_VERSION_MINIMUM=3.5 STILL required: bundled kloewe/dot still declares cmake_minimum_required(VERSION 3.0), which cmake 4 rejects. (kloewe/cpuinfo was updated upstream to 3.5...4.0, dot was not.) Note: 2.2.1 gains a WORKBENCH_USE_QT6 option. Staying on Qt5 for this bump so a failure is attributable to the version change alone; Qt6 is a separate step. * Wed Jun 17 2026 Morgan Hough - 2.1.0-9.20260203gitf8a1b5a - Fix FTBFS under cmake 4: bundled kloewe/dot/CMakeLists.txt declares cmake_minimum_required < 3.5, which cmake 4 rejects ("Compatibility with CMake < 3.5 has been removed"). Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5. (OpenSSL/qwt "not found" in the log are optional and non-fatal.) - Fix GuiQt link errors (undefined CaretFileDialogExtendable/Private vtable + destructor refs): CaretFileDialogExtendable is dead code -- its .cxx is fully commented out (no impl -> no emitted vtable) and no source uses it, but it was still moc'd/compiled via GuiQt/CMakeLists. Drop it from the build lists in %prep. - Fix %%doc: top-level readme is README, not README.md. - Use workbench's own moc switch -DWORKBENCH_USE_CMAKE_AUTOMOC=ON (single AUTOMOC path) instead of the bare -DCMAKE_AUTOMOC=ON layered on its manual QT5_WRAP_CPP. * Thu Mar 19 2026 Morgan Hough - 2.1.0-4.20260203gitf8a1b5a - Use %%cmake_install instead of manual find+install - Add glib2-devel, ninja-build BuildRequires - GCC 15 CXXFLAGS (-std=c++17 -include cstdint) - Add wb_shortcuts, bash-completion, desktop-file-validate - Fix icon filenames, add 32x32 icon - Git snapshot release versioning * Sun Jan 04 2026 Morgan Hough - 2.1.0-1 - Initial RPM release for Connectome Workbench v2.1.0