[med-svn] [Git][med-team/mrtrix3][master] 3 commits: Fix dh_clean

Julien Lamy gitlab at salsa.debian.org
Wed Mar 3 11:06:28 GMT 2021



Julien Lamy pushed to branch master at Debian Med / mrtrix3


Commits:
7e3740fc by Julien Lamy at 2021-03-03T10:02:29+01:00
Fix dh_clean

- - - - -
44d60799 by Julien Lamy at 2021-03-03T10:30:19+01:00
Clean and update patches

- - - - -
61e154fe by Julien Lamy at 2021-03-03T10:34:36+01:00
Fix building from within a Git repo

- - - - -


7 changed files:

- debian/control
- debian/patches/debian_build_cfg
- + debian/patches/mrtrix_version.patch
- debian/patches/python3.patch
- debian/patches/series
- − debian/patches/up_blend_python
- debian/rules


Changes:

=====================================
debian/control
=====================================
@@ -12,6 +12,7 @@ Build-Depends: debhelper-compat (= 12),
                libqt5opengl5-dev,
                qtbase5-dev,
                libqt5svg5-dev,
+               python-is-python3,
                python3,
                pkg-config,
                libgtkmm-2.4-dev,


=====================================
debian/patches/debian_build_cfg
=====================================
@@ -3,9 +3,9 @@ Forwarded: not-needed
 Author: Michael Hanke <michael.hanke at gmail.com>
 --- a/build
 +++ b/build
-@@ -187,6 +187,15 @@ def pipe_errors_to_less_handler():
-     except:
-       raise
+@@ -189,6 +189,15 @@ def colorize(s):
+     out += l + '\n'
+   return out
  
 +# honor the environment
 +try:
@@ -16,6 +16,6 @@ Author: Michael Hanke <michael.hanke at gmail.com>
 +  ld_lib_flags.extend(env_flags)
 +except:
 +  pass
- 
- 
- 
+
+
+


=====================================
debian/patches/mrtrix_version.patch
=====================================
@@ -0,0 +1,22 @@
+Description: fix building from the Debian Git repository
+Author: Julien Lamy <lamy at unistra.fr>
+Index: mrtrix3/build
+===================================================================
+--- mrtrix3.orig/build
++++ mrtrix3/build
+@@ -1203,14 +1203,7 @@ getting MRtrix version from folder "'''
+   except LookupError:
+     fail ('ERROR: failed to read version information from file "' + os.path.join (lib_dir, 'version.h') + '"\n')
+ 
+-  try:
+-    log ('  ')
+-    version = version_from_git (mrtrix_dir[-1])
+-    if version[0] != tag:
+-      fail ('ERROR: version stored in "' + os.path.join (lib_dir, 'version.h') + '" does not match git tag name\n')
+-    mrtrix_version.version = version[1]
+-  except LookupError:
+-    mrtrix_version.version = tag
++  mrtrix_version.version = tag
+ 
+   log ('Using MRtrix version "' + mrtrix_version.version + '"\n')
+   return mrtrix_version.version


=====================================
debian/patches/python3.patch
=====================================
@@ -3,32 +3,27 @@ Bug-Debian: https://bugs.debian.org/937091
 Author: Andreas Tille <tille at debian.org>
 Last-Update: Mon, 20 Jan 2020 21:42:52 +0100
 
---- a/build
-+++ b/build
+Index: mrtrix3/build
+===================================================================
+--- mrtrix3.orig/build
++++ mrtrix3/build
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
  
- usage_string = '''
- USAGE
---- a/configure
-+++ b/configure
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/configure
+===================================================================
+--- mrtrix3.orig/configure
++++ mrtrix3/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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+@@ -1430,7 +1430,7 @@ sys.stdout.write ('\nwriting configurati
  
  cache = open (cache_filename, 'w')
  
@@ -37,126 +32,216 @@ Last-Update: Mon, 20 Jan 2020 21:42:52 +0100
  #
  # autogenerated by MRtrix configure script
  #
---- a/bin/population_template
-+++ b/bin/population_template
+Index: mrtrix3/bin/population_template
+===================================================================
+--- mrtrix3.orig/bin/population_template
++++ mrtrix3/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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/5ttgen
+===================================================================
+--- mrtrix3.orig/bin/5ttgen
++++ mrtrix3/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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/blend
+===================================================================
+--- mrtrix3.orig/bin/blend
++++ mrtrix3/bin/blend
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/python3
+ 
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
  #
---- a/bin/average_response
-+++ b/bin/average_response
+Index: mrtrix3/bin/convert_bruker
+===================================================================
+--- mrtrix3.orig/bin/convert_bruker
++++ mrtrix3/bin/convert_bruker
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
- import sys
  
- def errorMessage(msg):
---- a/bin/blend
-+++ b/bin/blend
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwi2response
+===================================================================
+--- mrtrix3.orig/bin/dwi2response
++++ mrtrix3/bin/dwi2response
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
- import os
- import sys
  
---- a/bin/convert_bruker
-+++ b/bin/convert_bruker
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwibiascorrect
+===================================================================
+--- mrtrix3.orig/bin/dwibiascorrect
++++ mrtrix3/bin/dwibiascorrect
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
  
- import sys, os.path
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwigradcheck
+===================================================================
+--- mrtrix3.orig/bin/dwigradcheck
++++ mrtrix3/bin/dwigradcheck
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
  
---- a/bin/dwi2response
-+++ b/bin/dwi2response
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/labelsgmfix
+===================================================================
+--- mrtrix3.orig/bin/labelsgmfix
++++ mrtrix3/bin/labelsgmfix
 @@ -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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/docs/format_config_options
+===================================================================
+--- mrtrix3.orig/docs/format_config_options
++++ mrtrix3/docs/format_config_options
 @@ -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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/set_path
+===================================================================
+--- mrtrix3.orig/set_path
++++ mrtrix3/set_path
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
  
- # Script for checking the orientation of the diffusion gradient table
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwicat
+===================================================================
+--- mrtrix3.orig/bin/dwicat
++++ mrtrix3/bin/dwicat
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
  
---- a/bin/dwiintensitynorm
-+++ b/bin/dwiintensitynorm
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwifslpreproc
+===================================================================
+--- mrtrix3.orig/bin/dwifslpreproc
++++ mrtrix3/bin/dwifslpreproc
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
  
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwinormalise
+===================================================================
+--- mrtrix3.orig/bin/dwinormalise
++++ mrtrix3/bin/dwinormalise
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
  
- # Make the corresponding MRtrix3 Python libraries available
---- a/bin/dwipreproc
-+++ b/bin/dwipreproc
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/dwishellmath
+===================================================================
+--- mrtrix3.orig/bin/dwishellmath
++++ mrtrix3/bin/dwishellmath
 @@ -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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/for_each
+===================================================================
+--- mrtrix3.orig/bin/for_each
++++ mrtrix3/bin/for_each
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
  
---- a/bin/labelsgmfix
-+++ b/bin/labelsgmfix
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/mrtrix_cleanup
+===================================================================
+--- mrtrix3.orig/bin/mrtrix_cleanup
++++ mrtrix3/bin/mrtrix_cleanup
 @@ -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
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/bin/responsemean
+===================================================================
+--- mrtrix3.orig/bin/responsemean
++++ mrtrix3/bin/responsemean
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
  
- import sys
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/generate_bash_completion.py
+===================================================================
+--- mrtrix3.orig/generate_bash_completion.py
++++ mrtrix3/generate_bash_completion.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
  
---- a/generate_bash_completion.py
-+++ b/generate_bash_completion.py
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #
+Index: mrtrix3/update_copyright
+===================================================================
+--- mrtrix3.orig/update_copyright
++++ mrtrix3/update_copyright
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
+ 
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
  #
- # 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
+Index: mrtrix3/run_pylint
+===================================================================
+--- mrtrix3.orig/run_pylint
++++ mrtrix3/run_pylint
+@@ -33,7 +33,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
+-    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/set_path
-+++ b/set_path
+Index: mrtrix3/docs/format_environment_variables
+===================================================================
+--- mrtrix3.orig/docs/format_environment_variables
++++ mrtrix3/docs/format_environment_variables
 @@ -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,
+ # Copyright (c) 2008-2020 the MRtrix3 contributors.
+ #


=====================================
debian/patches/series
=====================================
@@ -1,5 +1,5 @@
-up_blend_python
 # disabled testing
 # deb_run_tests
 debian_build_cfg
 python3.patch
+mrtrix_version.patch


=====================================
debian/patches/up_blend_python deleted
=====================================
@@ -1,8 +0,0 @@
---- a/bin/blend
-+++ b/bin/blend
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2
-+#!/usr/bin/env python3
- 
- # Copyright (c) 2008-2019 the MRtrix3 contributors.
- #


=====================================
debian/rules
=====================================
@@ -65,7 +65,7 @@ override_dh_compress:
 	dh_compress -X.html
 
 override_dh_clean:
-	./build clean
+	[ -f config ] && ./build clean || true
 	find . -name '*.pyc' -delete
 	-rm clean \
 		config configure.log build.log \



View it on GitLab: https://salsa.debian.org/med-team/mrtrix3/-/compare/53d04cf1954dbfaa89ff58f69dcf8dc2a11ad632...61e154fed1f2f6c6f73df57a6473de17ddd14bcd

-- 
View it on GitLab: https://salsa.debian.org/med-team/mrtrix3/-/compare/53d04cf1954dbfaa89ff58f69dcf8dc2a11ad632...61e154fed1f2f6c6f73df57a6473de17ddd14bcd
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210303/3aef5aa7/attachment-0001.htm>


More information about the debian-med-commit mailing list