22 stdenv.mkDerivation rec {
26 src = fetchFromGitHub {
29 rev = "refs/tags/${version}";
30 hash = "sha256-87zBAoBLWQPccGS37XyQ8H0GhL01k8GQFgcLL6IwbcM=";
31 fetchSubmodules = true;
34 nativeBuildInputs = [ eigen makeWrapper ] ++ lib.optional withGui qt5.wrapQtAppsHook;
43 ] ++ lib.optionals withGui [
52 nativeInstallCheckInputs = [ bc ];
55 patchShebangs ./build ./configure ./run_tests ./bin/*
57 # patching interpreters before fixup is needed for tests:
59 patchShebangs testing/binaries/data/vectorstats/*py
61 substituteInPlace ./run_tests \
62 --replace 'git submodule update --init $datadir >> $LOGFILE 2>&1' ""
64 substituteInPlace ./build \
65 --replace '"less -RX "' '"${less}/bin/less -RX "'
69 export EIGEN_CFLAGS="-isystem ${eigen}/include/eigen3"
70 unset LD # similar to https://github.com/MRtrix3/mrtrix3/issues/1519
71 ./configure ${lib.optionalString (!withGui) "-nogui"};
76 (cd testing && ../build)
79 installCheckPhase = ''
83 # can also `./run_tests scripts`, but this fails due to lack of FSL package
84 # (and there's no convenient way to disable individual tests)
86 doInstallCheck = true;
97 for prog in $out/bin/*; do
98 if [[ -x "$prog" ]]; then
99 wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ ants ]}
105 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
106 homepage = "https://github.com/MRtrix3/mrtrix3";
107 description = "Suite of tools for diffusion imaging";
108 maintainers = with maintainers; [ bcdarwin ];
109 platforms = platforms.linux;
110 license = licenses.mpl20;