lol

mrtrix: 3.0.4 -> 3.0.4-unstable-2025-04-09 (#397641)

authored by

Peder Bergebakken Sundt and committed by
GitHub
2d2805b3 3a7dc008

+68 -16
+68 -16
pkgs/applications/science/biology/mrtrix/default.nix
··· 18 libXext, 19 less, 20 withGui ? true, 21 }: 22 23 stdenv.mkDerivation rec { 24 pname = "mrtrix"; 25 - version = "3.0.4"; 26 27 src = fetchFromGitHub { 28 owner = "MRtrix3"; 29 repo = "mrtrix3"; 30 - tag = version; 31 - hash = "sha256-87zBAoBLWQPccGS37XyQ8H0GhL01k8GQFgcLL6IwbcM="; 32 fetchSubmodules = true; 33 }; 34 35 nativeBuildInputs = [ 36 - eigen 37 makeWrapper 38 ] ++ lib.optional withGui qt5.wrapQtAppsHook; 39 40 buildInputs = 41 [ 42 ants 43 python 44 fftw 45 libtiff ··· 58 nativeInstallCheckInputs = [ bc ]; 59 60 postPatch = '' 61 - patchShebangs ./build ./configure ./run_tests ./bin/* 62 63 # patching interpreters before fixup is needed for tests: 64 - patchShebangs ./bin/* 65 patchShebangs testing/binaries/data/vectorstats/*py 66 67 substituteInPlace ./run_tests \ 68 - --replace 'git submodule update --init $datadir >> $LOGFILE 2>&1' "" 69 70 substituteInPlace ./build \ 71 - --replace '"less -RX "' '"${less}/bin/less -RX "' 72 ''; 73 74 configurePhase = '' 75 - export EIGEN_CFLAGS="-isystem ${eigen}/include/eigen3" 76 unset LD # similar to https://github.com/MRtrix3/mrtrix3/issues/1519 77 ./configure ${lib.optionalString (!withGui) "-nogui"}; 78 ''; 79 80 buildPhase = '' 81 ./build 82 (cd testing && ../build) 83 ''; 84 85 installCheckPhase = '' 86 ./run_tests units 87 ./run_tests binaries 88 89 # can also `./run_tests scripts`, but this fails due to lack of FSL package 90 # (and there's no convenient way to disable individual tests) 91 ''; 92 doInstallCheck = true; 93 ··· 99 runHook postInstall 100 ''; 101 102 - postInstall = '' 103 - for prog in $out/bin/*; do 104 - if [[ -x "$prog" ]]; then 105 - wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ ants ]} 106 - fi 107 - done 108 - ''; 109 110 meta = with lib; { 111 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
··· 18 libXext, 19 less, 20 withGui ? true, 21 + fetchFromGitLab, 22 + fetchpatch, 23 }: 24 25 + let 26 + # reverts 'eigen: 3.4.0 -> 3.4.0-unstable-2022-05-19' 27 + # https://github.com/NixOS/nixpkgs/commit/d298f046edabc84b56bd788e11eaf7ed72f8171c 28 + eigen' = ( 29 + eigen.overrideAttrs (old: rec { 30 + version = "3.4.0"; 31 + src = fetchFromGitLab { 32 + owner = "libeigen"; 33 + repo = "eigen"; 34 + tag = version; 35 + hash = "sha256-1/4xMetKMDOgZgzz3WMxfHUEpmdAm52RqZvz6i0mLEw="; 36 + }; 37 + patches = (old.patches or [ ]) ++ [ 38 + # Fixes e.g. onnxruntime on aarch64-darwin: 39 + # https://hydra.nixos.org/build/248915128/nixlog/1, 40 + # originally suggested in https://github.com/NixOS/nixpkgs/pull/258392. 41 + # 42 + # The patch is from 43 + # ["Fix vectorized reductions for Eigen::half"](https://gitlab.com/libeigen/eigen/-/merge_requests/699) 44 + # which is two years old, 45 + # but Eigen hasn't had a release in two years either: 46 + # https://gitlab.com/libeigen/eigen/-/issues/2699. 47 + (fetchpatch { 48 + url = "https://gitlab.com/libeigen/eigen/-/commit/d0e3791b1a0e2db9edd5f1d1befdb2ac5a40efe0.patch"; 49 + hash = "sha256-8qiNpuYehnoiGiqy0c3Mcb45pwrmc6W4rzCxoLDSvj0="; 50 + }) 51 + ]; 52 + }) 53 + ); 54 + in 55 + 56 stdenv.mkDerivation rec { 57 pname = "mrtrix"; 58 + version = "3.0.4-unstable-2025-04-09"; 59 60 src = fetchFromGitHub { 61 owner = "MRtrix3"; 62 repo = "mrtrix3"; 63 + rev = "7843bfc53a75f465901804ccf3fd6797d77531dd"; 64 + hash = "sha256-C4Io3VkX10eWia4djrYvN12fWmwm0j1G60I8lmFH49w="; 65 fetchSubmodules = true; 66 }; 67 68 nativeBuildInputs = [ 69 makeWrapper 70 + less 71 + python 72 ] ++ lib.optional withGui qt5.wrapQtAppsHook; 73 74 buildInputs = 75 [ 76 ants 77 + eigen' 78 python 79 fftw 80 libtiff ··· 93 nativeInstallCheckInputs = [ bc ]; 94 95 postPatch = '' 96 + patchShebangs --build ./build ./configure ./run_tests 97 + patchShebangs --host ./bin/* 98 99 # patching interpreters before fixup is needed for tests: 100 patchShebangs testing/binaries/data/vectorstats/*py 101 102 substituteInPlace ./run_tests \ 103 + --replace-fail 'git submodule update --init $datadir >> $LOGFILE 2>&1' "" 104 + 105 + # reduce build noise 106 + substituteInPlace ./configure \ 107 + --replace-fail "[ '-Wall' ]" "[]" 108 109 + # fix error output (cuts off after a few lines otherwise) 110 substituteInPlace ./build \ 111 + --replace-fail 'stderr=subprocess.PIPE' 'stderr=None' 112 ''; 113 114 configurePhase = '' 115 + runHook preConfigure 116 + export EIGEN_CFLAGS="-isystem ${eigen'}/include/eigen3" 117 unset LD # similar to https://github.com/MRtrix3/mrtrix3/issues/1519 118 ./configure ${lib.optionalString (!withGui) "-nogui"}; 119 + runHook postConfigure 120 ''; 121 122 buildPhase = '' 123 + runHook preBuild 124 ./build 125 (cd testing && ../build) 126 + runHook postBuild 127 ''; 128 129 installCheckPhase = '' 130 + runHook preInstallCheck 131 ./run_tests units 132 ./run_tests binaries 133 134 # can also `./run_tests scripts`, but this fails due to lack of FSL package 135 # (and there's no convenient way to disable individual tests) 136 + runHook postInstallCheck 137 ''; 138 doInstallCheck = true; 139 ··· 145 runHook postInstall 146 ''; 147 148 + preFixup = 149 + if withGui then 150 + '' 151 + qtWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ ants ]}) 152 + '' 153 + else 154 + '' 155 + for prog in $out/bin/*; do 156 + if [[ -x "$prog" ]]; then 157 + wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ ants ]} 158 + fi 159 + done 160 + ''; 161 162 meta = with lib; { 163 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);