From 06861686026ac6dd5f61612612d1b42b9d19f04b Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 29 Oct 2024 08:40:23 -0400 Subject: [PATCH] Update connectome-workbench recipe --- recipes/connectome-workbench/build.sh | 29 +-- recipes/connectome-workbench/meta.yaml | 170 +++++++++++++----- .../patches/0001-Fix-unsafe-narrowing.patch | 34 ++++ .../0001-Import-cstdint-into-libCZI.h.patch | 24 +++ .../connectome-workbench/yum_requirements.txt | 5 + 5 files changed, 206 insertions(+), 56 deletions(-) create mode 100644 recipes/connectome-workbench/patches/0001-Fix-unsafe-narrowing.patch create mode 100644 recipes/connectome-workbench/patches/0001-Import-cstdint-into-libCZI.h.patch create mode 100644 recipes/connectome-workbench/yum_requirements.txt diff --git a/recipes/connectome-workbench/build.sh b/recipes/connectome-workbench/build.sh index e5745d5946815c..714b0ce45d2e33 100755 --- a/recipes/connectome-workbench/build.sh +++ b/recipes/connectome-workbench/build.sh @@ -1,15 +1,20 @@ -#!/bin/bash - -export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig \ - OPENMP_HEADER_DIR=${PREFIX}/include \ - OPENMP_LIB_DIR=${PREFIX}/lib \ - FREETYPE_DIR=${PREFIX} +#!/usr/bin/env bash mkdir build cd build -cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} -DOPENSSL_ROOT_DIR=${PREFIX} \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-L${PREFIX}/lib" \ - -DWORKBENCH_USE_QT5=TRUE -DZLIB_ROOT=${PREFIX} -DWORKBENCH_MESA_DIR=${PREFIX} \ - -DCMAKE_PREFIX_PATH=${PREFIX} -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=True ../src -make -j ${CPU_COUNT} -make install + +if [[ "$target_platform" == linux-* ]]; then + export CXX_FLAGS="$CXX_FLAGS -lGL -lGLU" +fi + +cmake $CMAKE_ARGS -GNinja \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_PREFIX:STRING=$PREFIX \ + -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \ + ../src + +cmake --build . + +ctest --extra-verbose --output-on-failure . + +cmake --install . diff --git a/recipes/connectome-workbench/meta.yaml b/recipes/connectome-workbench/meta.yaml index ffef07657c2c79..e0c5582195fa50 100644 --- a/recipes/connectome-workbench/meta.yaml +++ b/recipes/connectome-workbench/meta.yaml @@ -1,73 +1,155 @@ {% set name = "connectome-workbench" %} -{% set version = "1.3.2" %} -{% set sha256 = "5574da8fcba810f5de1a3f70691cd763f927413d73f3b107142041272bf4edc9" %} +{% set version = "2.0.1" %} package: - name: {{ name }} + name: {{ name }}-split version: {{ version }} source: - url: https://github.com/Washington-University/workbench/archive/v{{ version }}.tar.gz - sha256: {{ sha256 }} + url: https://github.com/Washington-University/workbench/archive/v{{ version }}.tar.gz + sha256: c80bb248d1d25b36dd92112b9d3fb4585474e117c0c49dc8a222d859624f0376 + patches: + - patches/0001-Import-cstdint-into-libCZI.h.patch + - patches/0001-Fix-unsafe-narrowing.patch build: - number: 1 - skip: True # [osx] + number: 0 + skip: true # [osx or win] requirements: build: - - make - - {{ compiler('c') }} - {{ compiler('cxx') }} - - cmake >=2.8 - - {{ cdt('mesa-libgl-devel') }} - - {{ cdt('libselinux') }} - - {{ cdt('libxdamage') }} - - {{ cdt('libxxf86vm') }} + - {{ stdlib('c') }} + - cmake >=3.0 + - ninja + - qwt + # OpenMP + - llvm-openmp # [osx] + - libgomp # [linux] + # libGL + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - {{ cdt('libxdamage') }} # [linux] + - {{ cdt('libxxf86vm') }} # [linux] + - {{ cdt('libxext') }} # [linux] host: - - qt >=5.7 - - libpng - - zlib + - qt - openssl - - openmp - - freetype - - mesa - - libglu - - xorg-libx11 - - xorg-libxext - - xorg-libxfixes - - xorg-libxcb - - xorg-libxau - - xorg-libxdmcp - - run: - - qt >=5.6 - - libpng + - libzlib - zlib - - openssl - - openmp - freetype - - mesa - - libglu - - xorg-libx11 - - xorg-libxext - - xorg-libxfixes - - xorg-libxcb - - xorg-libxau - - xorg-libxdmcp + - libglu # [linux] + - glew # [windows] test: commands: - - wb_command -help - wb_view -help + - wb_command -version - wb_shortcuts -help +outputs: + - name: {{ name }}-gui + # build/host requirements should exactly match the root requirements + requirements: + build: + - {{ compiler('cxx') }} + - {{ stdlib('c') }} + - cmake >=3.0 + - ninja + - qwt + # OpenMP + - llvm-openmp # [osx] + - libgomp # [linux] + # libGL + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - {{ cdt('libxdamage') }} # [linux] + - {{ cdt('libxxf86vm') }} # [linux] + - {{ cdt('libxext') }} # [linux] + host: + - qt + - openssl + - libzlib + - zlib + - freetype + - libglu # [linux] + - glew # [windows] + run: + - qt-main + - libgl # [linux] + - libglu # [linux] + files: + include: + - bin/wb_view + test: + commands: + - wb_view -help + - name: {{ name }}-cli + # build/host requirements should exactly match the root requirements + requirements: + build: + - {{ compiler('cxx') }} + - {{ stdlib('c') }} + - cmake >=3.0 + - ninja + - qwt + # OpenMP + - llvm-openmp # [osx] + - libgomp # [linux] + # libGL + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - {{ cdt('libxdamage') }} # [linux] + - {{ cdt('libxxf86vm') }} # [linux] + - {{ cdt('libxext') }} # [linux] + host: + - qt + - openssl + - libzlib + - zlib + - freetype + - libglu # [linux] + - glew # [windows] + run: + - qt-main + - libgl # [linux] + - libglu # [linux] + files: + include: + - bin/wb_command + - bin/wb_shortcuts + - share/bash-completion/completions/* + test: + commands: + - wb_command -version + - wb_shortcuts -help + - name: {{ name }} + requirements: + run: + - {{ pin_subpackage('connectome-workbench-cli', exact=True) }} + - {{ pin_subpackage('connectome-workbench-gui', exact=True) }} + test: + commands: + - wb_view -help + - wb_command -version + - wb_shortcuts -help + about: home: https://www.humanconnectome.org/software/connectome-workbench - summary: "Connectome Workbench is an open source, freely available visualization and discovery tool used to map neuroimaging data, especially data generated by the Human Connectome Project" + summary: 'Neuroimaging utility for the Human Connectome Project' + description: | + Connectome Workbench is an open source, freely available visualization and discovery + tool used to map neuroimaging data, especially data generated by the Human + Connectome Project. license: GPL-2.0 license_family: GPL - license_file: LICENSE + license_file: + - LICENSE + - src/CZIlib/LICENSE + - src/QxtCore/LICENSE_qxt + - src/kloewe/cpuinfo/LICENSE + - src/kloewe/dot/LICENSE + doc_url: https://humanconnectome.org/software/workbench-command dev_url: https://github.com/Washington-University/workbench extra: diff --git a/recipes/connectome-workbench/patches/0001-Fix-unsafe-narrowing.patch b/recipes/connectome-workbench/patches/0001-Fix-unsafe-narrowing.patch new file mode 100644 index 00000000000000..54eb9ff3e308e2 --- /dev/null +++ b/recipes/connectome-workbench/patches/0001-Fix-unsafe-narrowing.patch @@ -0,0 +1,34 @@ +From cc3d4d74235978b136f637620032595cb388933b Mon Sep 17 00:00:00 2001 +From: Chris Markiewicz +Date: Mon, 14 Oct 2024 13:49:05 -0400 +Subject: [PATCH] Fix unsafe narrowing + +--- + src/Algorithms/AlgorithmCiftiSeparate.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Algorithms/AlgorithmCiftiSeparate.cxx b/src/Algorithms/AlgorithmCiftiSeparate.cxx +index 9a64a262e..f49c04e73 100644 +--- a/src/Algorithms/AlgorithmCiftiSeparate.cxx ++++ b/src/Algorithms/AlgorithmCiftiSeparate.cxx +@@ -654,7 +654,7 @@ void AlgorithmCiftiSeparate::getCroppedVolSpace(const CiftiFile* ciftiIn, const + int64_t numVoxels = (int64_t)myMap.size(); + if (numVoxels > 0) + {//make a voxel bounding box to minimize memory usage +- int extrema[6] = { myMap[0].m_ijk[0], ++ int64_t extrema[6] = { myMap[0].m_ijk[0], + myMap[0].m_ijk[0], + myMap[0].m_ijk[1], + myMap[0].m_ijk[1], +@@ -699,7 +699,7 @@ void AlgorithmCiftiSeparate::getCroppedVolSpaceAll(const CiftiFile* ciftiIn, con + int64_t numVoxels = (int64_t)myMap.size(); + if (numVoxels > 0) + {//make a voxel bounding box to minimize memory usage +- int extrema[6] = { myMap[0].m_ijk[0], ++ int64_t extrema[6] = { myMap[0].m_ijk[0], + myMap[0].m_ijk[0], + myMap[0].m_ijk[1], + myMap[0].m_ijk[1], +-- +2.45.2 + diff --git a/recipes/connectome-workbench/patches/0001-Import-cstdint-into-libCZI.h.patch b/recipes/connectome-workbench/patches/0001-Import-cstdint-into-libCZI.h.patch new file mode 100644 index 00000000000000..0d600c09d2affd --- /dev/null +++ b/recipes/connectome-workbench/patches/0001-Import-cstdint-into-libCZI.h.patch @@ -0,0 +1,24 @@ +From 28d007d44f4683ce430e8b29d184977ff488007c Mon Sep 17 00:00:00 2001 +From: Chris Markiewicz +Date: Sun, 13 Oct 2024 11:29:03 -0400 +Subject: [PATCH] Import cstdint into libCZI.h + +--- + src/CZIlib/CZI/libCZI.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/CZIlib/CZI/libCZI.h b/src/CZIlib/CZI/libCZI.h +index 7799f1aec..6a5c3e047 100644 +--- a/src/CZIlib/CZI/libCZI.h ++++ b/src/CZIlib/CZI/libCZI.h +@@ -22,6 +22,7 @@ + + #pragma once + ++#include + #include "ImportExport.h" + + #include "priv_guiddef.h" +-- +2.45.2 + diff --git a/recipes/connectome-workbench/yum_requirements.txt b/recipes/connectome-workbench/yum_requirements.txt new file mode 100644 index 00000000000000..343548cc4e5328 --- /dev/null +++ b/recipes/connectome-workbench/yum_requirements.txt @@ -0,0 +1,5 @@ +mesa-libGL +mesa-dri-drivers +libXdamage +libXxf86vm +libXext