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
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
@@ -182,7 +182,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' ]).decode(errors='ignore').splitlines()[0].strip()
+  python_cmd = subprocess.check_output ([ 'cygpath.exe', '-w', '/usr/bin/python3' ]).decode(errors='ignore').splitlines()[0].strip()
   sys.exit (subprocess.call ([ python_cmd ] + sys.argv))
 
 
@@ -1452,7 +1452,7 @@ sys.stdout.write ('\nwriting configurati
 
 with open (config_filename, 'w') as config_file:
 
-  config_file.write ("""#!/usr/bin/python
+  config_file.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
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/5ttgen
+++ b/bin/5ttgen
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/blend
+++ b/bin/blend
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/convert_bruker
+++ b/bin/convert_bruker
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwi2response
+++ b/bin/dwi2response
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwibiascorrect
+++ b/bin/dwibiascorrect
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwigradcheck
+++ b/bin/dwigradcheck
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/labelsgmfix
+++ b/bin/labelsgmfix
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/docs/format_config_options
+++ b/docs/format_config_options
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/set_path
+++ b/set_path
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwicat
+++ b/bin/dwicat
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwifslpreproc
+++ b/bin/dwifslpreproc
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwinormalise
+++ b/bin/dwinormalise
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/dwishellmath
+++ b/bin/dwishellmath
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/for_each
+++ b/bin/for_each
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/mrtrix_cleanup
+++ b/bin/mrtrix_cleanup
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/bin/responsemean
+++ b/bin/responsemean
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/generate_bash_completion.py
+++ b/generate_bash_completion.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/update_copyright
+++ b/update_copyright
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
--- a/run_pylint
+++ b/run_pylint
@@ -33,7 +33,7 @@ if [ $# == 0 ]; then
     fi
   done
   for bin_path in bin/*; do
-    if [ -f ${bin_path} ] && $(head -n1 ${bin_path} | grep -q "#!/usr/bin/env python"); then
+    if [ -f ${bin_path} ] && $(head -n1 ${bin_path} | grep -q "#!/usr/bin/python3"); then
       tests="$tests $bin_path"
     fi
   done
--- a/docs/format_environment_variables
+++ b/docs/format_environment_variables
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 # Copyright (c) 2008-2025 the MRtrix3 contributors.
 #
