anchor.diff:    installCheckInputs = [ bc ];
   
     postPatch = ''
  -    patchShebangs ./build ./configure ./run_tests ./bin/population_template
  +    patchShebangs ./build ./configure ./run_tests ./bin/*
  +
  +    # patching interpreters before fixup is needed for tests:
  +    patchShebangs ./bin/*
  +    patchShebangs testing/binaries/data/vectorstats/*py
  +
       substituteInPlace ./run_tests  \
  -      --replace 'git submodule update --init >> $LOGFILE 2>&1' ""
  +      --replace 'git submodule update --init $datadir >> $LOGFILE 2>&1' ""
     '';
   
     configurePhase = ''
  
positive.code: { stdenv, lib, fetchFromGitHub, python, makeWrapper
  , eigen, fftw, libtiff, zlib, ants, bc
  , qt5, libGL, libGLU, libX11, libXext
  , withGui ? true }:
  
  stdenv.mkDerivation rec {
    pname = "mrtrix";
    version = "3.0_RC3_latest";
  
    src = fetchFromGitHub {
      owner  = "MRtrix3";
      repo   = "mrtrix3";
      rev    = version;
      sha256 = "184nv524p8j94qicjy9l288bqcgl2yxqqs55a7042i0gfsnwp51c";
      fetchSubmodules = true;
    };
  
  
negative.code:     (cd testing && ../build)
    '';
  
    installCheckPhase = ''
      ./run_tests units
      ./run_tests binaries
  
      # can also `./run_tests scripts`, but this fails due to lack of FSL package
      # (and there's no convenient way to disable individual tests)
    '';
    doInstallCheck = true;
  
    installPhase = ''
  