Description: Build using python3 instead of python2
Bug-Debian: https://bugs.debian.org/937091
Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 20 Jan 2020 21:42:52 +0100

--- a/build
+++ b/build
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 usage_string = '''
 USAGE
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 usage_string = '''
 USAGE
@@ -150,7 +150,7 @@ system = platform.system().lower()
 
 # on Windows, need to use MSYS2 version of python - not MinGW version:
 if sys.executable[0].isalpha() and sys.executable[1] == ':':
-  python_cmd = subprocess.check_output ([ 'cygpath.exe', '-w', '/usr/bin/python' ]).splitlines()[0].strip()
+  python_cmd = subprocess.check_output ([ 'cygpath.exe', '-w', '/usr/bin/python3' ]).splitlines()[0].strip()
   sys.exit (subprocess.call ([ python_cmd ] + sys.argv))
 
 
@@ -1301,7 +1301,7 @@ sys.stdout.write ('\nwriting configurati
 
 cache = open (cache_filename, 'w')
 
-cache.write ("""#!/usr/bin/python
+cache.write ("""#!/usr/bin/python3
 #
 # autogenerated by MRtrix configure script
 #
--- a/bin/population_template
+++ b/bin/population_template
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Generates an unbiased group-average template via image registration of images to a midway space.
 
--- a/bin/5ttgen
+++ b/bin/5ttgen
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script that generates a five-tissue-type (5TT) segmented image: the format appropriate for ACT
 #
--- a/bin/average_response
+++ b/bin/average_response
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 import sys
 
 def errorMessage(msg):
--- a/bin/blend
+++ b/bin/blend
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 import os
 import sys
 
--- a/bin/convert_bruker
+++ b/bin/convert_bruker
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 import sys, os.path
 
--- a/bin/dwi2response
+++ b/bin/dwi2response
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script for estimating response functions for spherical deconvolution
 # A number of different approaches are available within this script for performing response function estimation.
--- a/bin/dwibiascorrect
+++ b/bin/dwibiascorrect
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script that performs B1 field inhomogeneity correction for a DWI volume series
 # Bias field is estimated using the mean b=0 image, and subsequently used to correct all volumes
--- a/bin/dwigradcheck
+++ b/bin/dwigradcheck
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script for checking the orientation of the diffusion gradient table
 
--- a/bin/dwiintensitynorm
+++ b/bin/dwiintensitynorm
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 
 # Make the corresponding MRtrix3 Python libraries available
--- a/bin/dwipreproc
+++ b/bin/dwipreproc
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script for performing DWI pre-processing using FSL 5.0 tools eddy / topup / applytopup
 
--- a/bin/labelsgmfix
+++ b/bin/labelsgmfix
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Script for 'repairing' a FreeSurfer parcellation image
 # FreeSurfer's sub-cortical structure segmentation has been observed to be highly variable
--- a/docs/format_config_options
+++ b/docs/format_config_options
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 import sys
 
--- a/generate_bash_completion.py
+++ b/generate_bash_completion.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 #
 # Generates bash completion file for MRtrix commands
 # MRtrix needs to be built prior to running this
--- a/run_pylint
+++ b/run_pylint
@@ -15,7 +15,7 @@ if [ $# == 0 ]; then
     fi
   done
   for bin_path in bin/*; do
-    if head ${bin_path} -n1 | grep -q "#!/usr/bin/env python"; then
+    if head ${bin_path} -n1 | grep -q "#!/usr/bin/python3"; then
       tests="$tests $bin_path"
     fi
   done
--- a/set_path
+++ b/set_path
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # automatically set the PATH environment variable to include the MRtrix3
 # executables and scripts. This script must be run after a successful build,
