summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Bachmann2018-11-26 17:47:59 +0100
committerTobias Bachmann2018-11-26 17:47:59 +0100
commit5b6a58592b3b3f47d83fe4199a0413861a980209 (patch)
tree276b6e3ccf039b1834f914d7d72417ce330302bd
parent9a505b4833ab107ae2a5829e81648b773e3be10f (diff)
downloadaur-5b6a58592b3b3f47d83fe4199a0413861a980209.tar.gz
Initial commit for FSL 6.0
-rw-r--r--.SRCINFO34
-rw-r--r--001-use_distribution_environment.patch232
-rw-r--r--002-fix_meldata_usage_of_ifstream.patch11
-rw-r--r--003-fix_fsl_exec_empty_errorCode.patch12
-rwxr-xr-xPKGBUILD118
-rwxr-xr-ximcp124
-rwxr-xr-ximglob124
-rwxr-xr-ximmv123
8 files changed, 331 insertions, 447 deletions
diff --git a/.SRCINFO b/.SRCINFO
index af37d14e4c47..c651090baaef 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = fsl
pkgdesc = A comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data
- pkgver = 5.0.11
+ pkgver = 6.0.0
pkgrel = 1
url = http://www.fmrib.ox.ac.uk/fsl/
- arch = i686
arch = x86_64
license = custom
makedepends = boost
@@ -21,25 +20,28 @@ pkgbase = fsl
depends = python
depends = glu
depends = boost-libs
- depends = vtk6
+ depends = vtk
depends = sqlite
+ depends = python3
+ depends = fslpy
+ depends = bc
optdepends = cuda
- source = http://www.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.11-sources.tar.gz
- source = http://www.fmrib.ox.ac.uk/fsldownloads/fsl-5.0.11-feeds.tar.gz
- source = systemvars.mk
- source = externallibs.mk
- source = fsl_exec.patch
+ source = http://www.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-sources.tar.gz
+ source = http://www.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.0-feeds.tar.gz
source = imcp
source = imglob
source = immv
- sha1sums = 4e80fce7b9626c351766966ba3be5d428e1c27cc
- sha1sums = 7f9d1289887f6ff684599ce3d7a260f3d81011f2
- sha1sums = 679c65c90e79b7f748ad1c2d4b5abeebebf05dfd
- sha1sums = db514c2eaa48ae924cb1c26d8b0b25d47a812876
- sha1sums = 2df550b126a6ec6022a164a18dddffe4e59962f9
- sha1sums = e2d4cc873a23eedcea093715b49ace41fc6f6e1c
- sha1sums = f6d6d0177561b0f036a7e1fae4443332becd134b
- sha1sums = efb997fbaaffb5129eca2ea9388b45421e6e6de4
+ source = 001-use_distribution_environment.patch
+ source = 002-fix_meldata_usage_of_ifstream.patch
+ source = 003-fix_fsl_exec_empty_errorCode.patch
+ sha256sums = 94853ddd1c16d03050a0ef58b8801fd094a7b3636cc3cf35b36c576091143276
+ sha256sums = 0d41376add12a6dbf67da19c1875f18bb6fa05e24e8a43d97eff160c70881ad2
+ sha256sums = c61f185fbe7e297c4518e96377aa5ff4852f90eda0dbb9ae8edc5e24735e14ad
+ sha256sums = 7a1039cdc38b4d728f14efce3b0fda0cadc7bfcd3432556c3f3113985bf2720a
+ sha256sums = b6f61a6d5672b6684f19150f6e21ded1bd04ec6415dcf07a32291e4002bfa5d8
+ sha256sums = d1dada74e7625ce3a9031af851ff1f3aed9a3f5600dc49a5db13f829cb8c41cb
+ sha256sums = 13d4cf35343e7a73bc2534c94b1b0d4db41c338d374e6982091e4cf7a421d420
+ sha256sums = 64b4ccefa63a3cf920b185dd52e94b918c24f2cedaebcec8efb767bd80a6418a
pkgname = fsl
diff --git a/001-use_distribution_environment.patch b/001-use_distribution_environment.patch
new file mode 100644
index 000000000000..ef84b6e115d8
--- /dev/null
+++ b/001-use_distribution_environment.patch
@@ -0,0 +1,232 @@
+--- a/fsl/etc/fslconf/fsl.sh 2014-05-19 16:54:10.000000000 +0200
++++ b/fsl/etc/fslconf/fsl.sh 2018-11-25 11:26:42.623047078 +0100
+@@ -26,8 +26,8 @@
+ # The following variables specify paths for programs and can be changed
+ # or replaced by different programs ( e.g. FSLDISPLAY=open for MacOSX)
+
+-FSLTCLSH=$FSLDIR/bin/fsltclsh
+-FSLWISH=$FSLDIR/bin/fslwish
++FSLTCLSH=/usr/bin/tclsh
++FSLWISH=/usr/bin/wish
+
+ export FSLTCLSH FSLWISH
+
+--- a/fsl/etc/fslconf/fsl.csh 2014-05-19 16:54:10.000000000 +0200
++++ b/fsl/etc/fslconf/fsl.csh 2018-11-25 11:26:42.623047078 +0100
+@@ -25,8 +25,8 @@
+ # The following variables specify paths for programs and can be changed
+ # or replaced by different programs ( e.g. FSLDISPLAY=open for MacOSX)
+
+-setenv FSLTCLSH $FSLDIR/bin/fsltclsh
+-setenv FSLWISH $FSLDIR/bin/fslwish
++setenv FSLTCLSH /usr/bin/tclsh
++setenv FSLWISH /usr/bin/wish
+
+ # The following variables are used for running code in parallel across
+ # several machines ( i.e. for FDT )
+--- a/fsl/etc/fslconf/fsl-devel.sh 2014-05-19 16:54:10.000000000 +0200
++++ b/fsl/etc/fslconf/fsl-devel.sh 2018-11-25 11:26:42.623047078 +0100
+@@ -26,8 +26,8 @@
+ # The following variables specify paths for programs and can be changed
+ # or replaced by different programs ( e.g. FSLDISPLAY=open for MacOSX)
+
+-FSLTCLSH=$FSLDIR/bin/fsltclsh
+-FSLWISH=$FSLDIR/bin/fslwish
++FSLTCLSH=/usr/bin/tclsh
++FSLWISH=/usr/bin/wish
+
+ export FSLTCLSH FSLWISH
+
+--- a/fsl/extras/build 2016-11-15 15:30:21.000000000 +0100
++++ b/fsl/extras/build 2018-11-25 14:10:48.382885194 +0100
+@@ -96,21 +96,20 @@
+ BUILDICONV=1
+ fi
+ fi
+-PROJECTS="tcl tk"
++PROJECTS=""
+ if [ ${BUILDZLIB} -eq 1 ]; then
+- PROJECTS="${PROJECTS} zlib"
++ PROJECTS="${PROJECTS}"
+ fi
+-PROJECTS="${PROJECTS} libpng"
++PROJECTS="${PROJECTS}"
+ if [ ${BUILDICONV} -eq 1 ]; then
+- PROJECTS="${PROJECTS} libiconv"
++ PROJECTS="${PROJECTS}"
+ fi
+-PROJECTS="${PROJECTS} libgd libgdc libprob libcprob newmat cprob newran fftw"
+-PROJECTS="${PROJECTS} boost libxml2-2.9.2 libxml++-2.34.0 libsqlite libnlopt ../include/armawrap/dummy_newmat"
++PROJECTS="${PROJECTS} libgdc libprob libcprob cprob newran ../include/armawrap/dummy_newmat"
+ for projname in $PROJECTS; do
+ if [ -d $FSLESRCDIR/$projname ] ; then
+ buildIt $FSLESRCDIR $projname 1
+ elif [ "$projname" = "boost" -a -d ${FSLEXTINC}/boost/boost ]; then
+- buildIt $FSLEXTINC boost 0
++ buildIt $FSLEXTINC 0
+ fi
+ done
+
+--- a/fsl/src/mist-clean/Makefile 2018-10-17 13:00:28.000000000 +0200
++++ b/fsl/src/mist-clean/Makefile 2018-11-25 11:26:42.643047048 +0100
+@@ -2,15 +2,15 @@
+
+ NLOPT_INC = ${FSLEXTINC}
+ NLOPT_LIB = ${FSLEXTLIB}
+-SQLITE_INC = ${FSLEXTINC}/libsqlite
+-SQLITE_LIB = ${FSLEXTLIB}
++SQLITE_INC = /usr/include/libsqlite
++SQLITE_LIB = /usr/lib
+
+ PROJNAME = mist
+
+ XFILES = mist/mist
+ SCRIPTS = bin/mist_1_train bin/mist_2_fit bin/mist_FA_reg bin/mist_display bin/mist_mesh_utils
+
+-USRCXXFLAGS = -std=c++11
++USRCXXFLAGS = -std=c++11 -DBOOST_LOG_DYN_LINK
+ USRINCFLAGS = -I${FSLDIR}/include/newimage -I${INC_NEWMAT} -I${INC_ZLIB} -I${INC_GDC} -I${INC_GD} -I${SQLITE_INC} -I${NLOPT_INC} -I${VTKDIR_INC} -Icommon
+ USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_ZLIB} -L${LIB_BOOST} -L${LIB_GDC} -L${LIB_GD} -L${NLOPT_LIB} -L${VTKDIR_LIB}
+
+@@ -19,14 +19,14 @@
+ LIBRT = -lrt
+ endif
+
+-LDLIBS = -lvtkIOLegacy${VTKSUFFIX} -lvtkIOCore${VTKSUFFIX} -lvtkFiltersModeling${VTKSUFFIX} -lvtkFiltersCore${VTKSUFFIX} \
++LDLIBS = -lsqlite3 -lvtkIOLegacy${VTKSUFFIX} -lvtkIOCore${VTKSUFFIX} -lvtkFiltersModeling${VTKSUFFIX} -lvtkFiltersCore${VTKSUFFIX} \
+ -lvtkCommonExecutionModel${VTKSUFFIX} -lvtkCommonDataModel${VTKSUFFIX} -lvtkCommonMisc${VTKSUFFIX} \
+ -lvtkCommonSystem${VTKSUFFIX} -lvtkCommonTransforms${VTKSUFFIX} -lvtkCommonMath${VTKSUFFIX} \
+ -lvtkCommonCore${VTKSUFFIX} -lvtksys${VTKSUFFIX} \
+ -lboost_log -lboost_log_setup -lboost_thread -lboost_filesystem -lboost_date_time -lboost_chrono \
+ -lboost_system -lboost_serialization -lboost_regex -lwarpfns -lbasisfield -lnewimage -lmiscmaths \
+ -lnewmat -lgdc -lgd -lpng -lNewNifti -lutils -lznz -lm -lz -lnlopt -lpthread -ldl \
+- ${SQLITE_LIB}/libsqlite3.a ${LIBRT}
++ ${LIBRT}
+
+ HDRS = common/gibbsshapemodel.h common/mrfshapemodel.h common/mvnshapemodel.h common/plotting.h common/profilefilters.h common/profilemixtures.h common/profilemodel.h common/profilepriors.h common/serialisation.h common/shape.h common/shapemodel.h common/stats.h common/transformation.h mist/builddate.h
+
+--- a/fsl/config/_FSLMACHTYPE/externallibs.mk 2018-10-10 13:12:48.000000000 +0200
++++ b/fsl/config/_FSLMACHTYPE/externallibs.mk 2018-11-25 11:26:48.363038307 +0100
+@@ -7,26 +7,27 @@
+ FSLEXTBIN=${FSLDIR}/extras/bin
+
+ # GD library
+-LIB_GD = ${FSLEXTLIB}
+-INC_GD = ${FSLEXTINC}
++LIB_GD = /usr/lib
++INC_GD = /usr/include
+
+ # GDC library
+ LIB_GDC = ${FSLEXTLIB}
+ INC_GDC = ${FSLEXTINC}/libgdc
+
+ # LIBXML2 library
+-INC_XML2 = ${FSLEXTINC}/libxml2
++INC_XML2 = /usr/include/libxml2
+
+ # LIBXML++ library
+-INC_XML++ = ${FSLEXTINC}/libxml++-2.6
+-INC_XML++CONF = ${FSLEXTLIB}/libxml++-2.6/include
++INC_XML++ = /usr/include/libxml++-2.6
++INC_XML++CONF = /usr/lib/libxml++-2.6/include
++
+ # GSL library
+-LIB_GSL = ${FSLEXTLIB}
+-INC_GSL = ${FSLEXTINC}/gsl
++LIB_GSL = /usr/lib
++INC_GSL = /usr/include/gsl
+
+ # PNG library
+-LIB_PNG = ${FSLEXTLIB}
+-INC_PNG = ${FSLEXTINC}
++LIB_PNG = /usr/lib
++INC_PNG = /usr/include/libpng1.6
+
+ # PROB library
+ LIB_PROB = ${FSLEXTLIB}
+@@ -38,7 +39,9 @@
+
+ # NEWMAT library
+ #LIB_NEWMAT = ${FSLEXTLIB} -llapack -lblas or just -lopenblas
+-LIB_NEWMAT = ${FSLEXTLIB} -lopenblas
++#LIB_NEWMAT = /usr/lib/newmat
++#INC_NEWMAT = /usr/include/newmat
++LIB_NEWMAT = ${FSLEXTLIB} -llapack -lblas
+ INC_NEWMAT = ${FSLEXTINC}/armawrap/armawrap -DARMA_USE_LAPACK -DARMA_USE_BLAS -DARMA_64BIT_WORD
+
+ # NEWRAN library
+@@ -46,29 +49,29 @@
+ INC_NEWRAN = ${FSLEXTINC}/newran
+
+ # ZLIB library
+-LIB_ZLIB = /lib64
++LIB_ZLIB = /usr/lib
+ INC_ZLIB = /usr/include
+
+ # BOOST library
+-BOOSTDIR = ${FSLEXTINC}/boost
+-LIB_BOOST = ${BOOSTDIR}
+-INC_BOOST = ${BOOSTDIR}
++#BOOSTDIR = ${FSLEXTINC}/boost
++LIB_BOOST = /usr/lib
++INC_BOOST = /usr/include/boost
+
+ # QT library
+-QTDIR = /usr/lib/qt3
+-LIB_QT = ${QTDIR}/lib
+-INC_QT = ${QTDIR}/include
++#QTDIR = /usr/lib/qt5
++LIB_QT = /usr/lib
++INC_QT = ${QTDIR}/include/qt
+
+ # QWT library
+-QWTDIR = /usr/local/qwt
+-LIB_QWT = ${QWTDIR}/lib
+-INC_QWT = ${QWTDIR}/include
++#QWTDIR = /usr/local/qwt
++LIB_QWT = /usr/lib
++INC_QWT = /usr/include/qwt
+
+ # FFTW3 library
+-LIB_FFTW3 = ${FSLEXTLIB}
+-INC_FFTW3 = ${FSLEXTINC}/fftw3
++LIB_FFTW3 = /usr/lib
++INC_FFTW3 = /usr/include
+
+ # VTK library
+-VTKDIR_INC = /home/fs0/cowboy/var/caper_linux_64-gcc4.4/VTK7/include/vtk-7.0
+-VTKDIR_LIB = /home/fs0/cowboy/var/caper_linux_64-gcc4.4/VTK7/lib
+-VTKSUFFIX = -7.0
+\ No newline at end of file
++VTKDIR_INC = /usr/include/vtk
++VTKDIR_LIB = /usr/lib
++VTKSUFFIX =
+--- a/fsl/config/_FSLMACHTYPE/systemvars.mk 2017-09-04 14:09:26.000000000 +0200
++++ b/fsl/config/_FSLMACHTYPE/systemvars.mk 2018-11-25 11:26:48.363038307 +0100
+@@ -8,7 +8,7 @@
+ CP = /bin/cp
+ MV = /bin/mv
+ INSTALL = install -p
+-TCLSH = ${FSLDIR}/bin/fsltclsh
++TCLSH = /usr/bin/tclsh
+ RANLIB = echo
+
+ FSLML = ${FSLDIR}/bin/fslml
+@@ -30,14 +30,14 @@
+
+ DEPENDFLAGS = -MM
+
+-OPTFLAGS = -g -O3 -fexpensive-optimizations ${ARCHFLAGS}
++OPTFLAGS = -march=native -g -O3 -fexpensive-optimizations ${ARCHFLAGS}
+ MACHDBGFLAGS = -g
+-GNU_ANSI_FLAGS = -Wall -ansi -pedantic -Wno-long-long
++GNU_ANSI_FLAGS = -Wall -ansi -pedantic -std=c++11 -Wno-long-long
+ SGI_ANSI_FLAGS = -ansi -fullwarn
+ ANSI_FLAGS = ${GNU_ANSI_FLAGS}
+
+ # CUDA development environment
+-CUDA_INSTALLATION = /opt/cuda-7.5
++CUDA_INSTALLATION = /opt/cuda
+ GENCODE_FLAGS = $(shell ${FSLDIR}/config/common/supportedGencodes.sh ${CUDA_INSTALLATION})
+ LIB_CUDA = ${CUDA_INSTALLATION}/lib64
+ INC_CUDA = ${CUDA_INSTALLATION}/include
diff --git a/002-fix_meldata_usage_of_ifstream.patch b/002-fix_meldata_usage_of_ifstream.patch
new file mode 100644
index 000000000000..e35e74b7e2b0
--- /dev/null
+++ b/002-fix_meldata_usage_of_ifstream.patch
@@ -0,0 +1,11 @@
+--- a/fsl/src/melodic/meldata.cc 2018-10-23 18:49:51.000000000 +0200
++++ b/fsl/src/melodic/meldata.cc 2018-11-25 11:26:42.639047054 +0100
+@@ -1015,7 +1015,7 @@
+ Resels = 1.0;
+
+ in.open(logger.appendDir("smoothest").c_str(), ios::in);
+- if(in>0){
++ if(!!in){
+ for(int ctr=1; ctr<7; ctr++)
+ in >> str;
+ in.close();
diff --git a/003-fix_fsl_exec_empty_errorCode.patch b/003-fix_fsl_exec_empty_errorCode.patch
new file mode 100644
index 000000000000..5e8cb0269cd2
--- /dev/null
+++ b/003-fix_fsl_exec_empty_errorCode.patch
@@ -0,0 +1,12 @@
+--- a/fsl/src/misc_tcl/fsl_exec.tcl 2018-10-23 18:49:44.000000000 +0200
++++ b/fsl/src/misc_tcl/fsl_exec.tcl 2018-11-25 18:52:30.636934316 +0100
+@@ -175,6 +175,9 @@
+ set logout ""
+ }
+
++ # make sure errorCode is set
++ if { ! [ info exists ::errorCode ] } { set ::errorCode "NONE" }
++
+ # run and log the actual command
+ if { $do_logout } {
+ fsl:echo $logout "\n$thecommand"
diff --git a/PKGBUILD b/PKGBUILD
index 15143ef13613..dcc5383a058c 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,117 +1,68 @@
+# Maintainer: Tobias Bachmann <tobachmann@gmx.de>
# Contributor: fishburn <frankthefishburn@gmail.com>
-# Note: As of 5.0.11 certain key scripts (imcp, imglob, immv) are no longer shipped by upstream
-# Their recommendation is to install fslpython, but this requires running an opaque installer and
-# doubles the package size with no additional obvious benefit than these 3 tiny scripts. So I
-# have decided to just bundle the scripts from 5.0.10 with the package from now on.
-
pkgname=fsl
-pkgver=5.0.11
+pkgver=6.0.0
pkgrel=1
pkgdesc="A comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data"
-arch=("i686" "x86_64")
+arch=("x86_64")
url="http://www.fmrib.ox.ac.uk/fsl/"
license=(custom)
-depends=(gd libxml2 libxml++2.6 gsl libpng nlopt newmat tcl tk zlib python glu boost-libs vtk6 sqlite)
+depends=(gd libxml2 libxml++2.6 gsl libpng nlopt newmat tcl tk zlib python glu boost-libs vtk sqlite python3 fslpy bc)
makedepends=(boost fftw)
optdepends=(cuda)
-sha1sums=('4e80fce7b9626c351766966ba3be5d428e1c27cc'
- '7f9d1289887f6ff684599ce3d7a260f3d81011f2'
- '679c65c90e79b7f748ad1c2d4b5abeebebf05dfd'
- 'db514c2eaa48ae924cb1c26d8b0b25d47a812876'
- '2df550b126a6ec6022a164a18dddffe4e59962f9'
- 'e2d4cc873a23eedcea093715b49ace41fc6f6e1c'
- 'f6d6d0177561b0f036a7e1fae4443332becd134b'
- 'efb997fbaaffb5129eca2ea9388b45421e6e6de4')
-
source=("http://www.fmrib.ox.ac.uk/fsldownloads/fsl-${pkgver}-sources.tar.gz"
"http://www.fmrib.ox.ac.uk/fsldownloads/fsl-${pkgver}-feeds.tar.gz"
- "systemvars.mk"
- "externallibs.mk"
- "fsl_exec.patch"
"imcp"
"imglob"
- "immv")
+ "immv"
+ "001-use_distribution_environment.patch"
+ "002-fix_meldata_usage_of_ifstream.patch"
+ "003-fix_fsl_exec_empty_errorCode.patch")
+
+sha256sums=('94853ddd1c16d03050a0ef58b8801fd094a7b3636cc3cf35b36c576091143276'
+ '0d41376add12a6dbf67da19c1875f18bb6fa05e24e8a43d97eff160c70881ad2'
+ 'c61f185fbe7e297c4518e96377aa5ff4852f90eda0dbb9ae8edc5e24735e14ad'
+ '7a1039cdc38b4d728f14efce3b0fda0cadc7bfcd3432556c3f3113985bf2720a'
+ 'b6f61a6d5672b6684f19150f6e21ded1bd04ec6415dcf07a32291e4002bfa5d8'
+ 'd1dada74e7625ce3a9031af851ff1f3aed9a3f5600dc49a5db13f829cb8c41cb'
+ '13d4cf35343e7a73bc2534c94b1b0d4db41c338d374e6982091e4cf7a421d420'
+ '64b4ccefa63a3cf920b185dd52e94b918c24f2cedaebcec8efb767bd80a6418a')
prepare() {
-
cd "${srcdir}"
-
export FSLDIR="${srcdir}/fsl"
. "${FSLDIR}/etc/fslconf/fsl.sh"
- export FSLMACHTYPE=`${FSLDIR}/etc/fslconf/fslmachtype.sh`
-
- # Create new configuration
- mkdir -p "${FSLDIR}/config/${FSLMACHTYPE}"
- cp "${srcdir}/systemvars.mk" "${FSLDIR}/config/${FSLMACHTYPE}/"
- cp "${srcdir}/externallibs.mk" "${FSLDIR}/config/${FSLMACHTYPE}/"
-
- # Copy makepkg build flags into configuration
+ export FSLMACHTYPE=$(${FSLDIR}/etc/fslconf/fslmachtype.sh)
+ mkdir "${FSLDIR}/config/${FSLMACHTYPE}"
+ # Use config linux_64-gcc4.8 as template
+ cp "${FSLDIR}"/config/linux_64-gcc4.8/{externallibs.mk,systemvars.mk} "${FSLDIR}/config/${FSLMACHTYPE}"
+ sed -i "s/_FSLMACHTYPE/${FSLMACHTYPE}/g" "${srcdir}/001-use_distribution_environment.patch"
+
+ # Apply patches
+ patch -Np1 -i "${srcdir}/001-use_distribution_environment.patch"
+ patch -Np1 -i "${srcdir}/002-fix_meldata_usage_of_ifstream.patch"
+ # From https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=fsl;e8fa48c1.1501
+ patch -Np1 -i "${srcdir}/003-fix_fsl_exec_empty_errorCode.patch"
+
+ # Insert makepkg build flags into configuration
sed -i '0,/${AccumulatedIncFlags}/{s^${AccumulatedIncFlags}^& '"${CFLAGS}"'^}' "${srcdir}/fsl/config/common/vars.mk"
sed -i '0,/${AccumulatedIncFlags}/{s^${AccumulatedIncFlags}^& '"${CPPFLAGS}"'^}' "${srcdir}/fsl/config/common/vars.mk"
sed -i '1,/${AccumulatedIncFlags}/!{s^${AccumulatedIncFlags}^& '"${CXXFLAGS}"'^}' "${srcdir}/fsl/config/common/vars.mk"
sed -i '1,/${AccumulatedIncFlags}/!{s^${AccumulatedIncFlags}^& '"${CPPFLAGS}"'^}' "${srcdir}/fsl/config/common/vars.mk"
sed -i 's^LDFLAGS = .*$^& '"${LDFLAGS}"'^g' "${srcdir}/fsl/config/common/vars.mk"
-
- # Fix 32-bit
- if test "$CARCH" == i686; then
- sed -i "s^-m64^^g" "${FSLDIR}/config/${FSLMACHTYPE}/systemvars.mk"
- fi
-
- # Use system TCL/Tk
- sed -i 's^$FSLDIR/bin/fsltclsh^/usr/bin/tclsh^g' "${FSLDIR}/etc/fslconf/fsl.sh"
- sed -i 's^$FSLDIR/bin/fsltclsh^/usr/bin/tclsh^g' "${FSLDIR}/etc/fslconf/fsl-devel.sh"
- sed -i 's^$FSLDIR/bin/fsltclsh^/usr/bin/tclsh^g' "${FSLDIR}/etc/fslconf/fsl.csh"
- sed -i 's^$FSLDIR/bin/fslwish^/usr/bin/wish^g' "${FSLDIR}/etc/fslconf/fsl.sh"
- sed -i 's^$FSLDIR/bin/fslwish^/usr/bin/wish^g' "${FSLDIR}/etc/fslconf/fsl-devel.sh"
- sed -i 's^$FSLDIR/bin/fslwish^/usr/bin/wish^g' "${FSLDIR}/etc/fslconf/fsl.csh"
-
- # Disable building of system libraries
- sed -i 's/ libgd / /g' "${FSLDIR}/extras/build"
- sed -i 's/ libxml2-2.9.2 / /g' "${FSLDIR}/extras/build"
- sed -i 's/ libxml++-2.34.0 / /g' "${FSLDIR}/extras/build"
- sed -i 's/ newmat / /g' "${FSLDIR}/extras/build"
- sed -i 's/ boost / /g' "${FSLDIR}/extras/build"
- sed -i 's/ libnlopt / /g' "${FSLDIR}/extras/build"
- sed -i 's/ libpng"/"/g' "${FSLDIR}/extras/build"
- sed -i 's/ libiconv"/"/g' "${FSLDIR}/extras/build"
- sed -i 's/ zlib"/"/g' "${FSLDIR}/extras/build"
- sed -i 's/ fftw"/"/g' "${FSLDIR}/extras/build"
- sed -i 's/"tcl tk"/""/g' "${FSLDIR}/extras/build"
-
- # Link mist-clean against system sqlite
- sed -i 's^${SQLITE_LIB}/libsqlite3.a^-lsqlite3^g' "${srcdir}/fsl/src/mist-clean/Makefile"
-
- # Fix Melodic use of ifstream
- sed -i 's^if(in>0)^if(!!in)^g' "${FSLDIR}/src/melodic/meldata.cc"
-
- # Add missing library directories
- sed -i 's^-L${LIB_ZLIB}$^& -L${LIB_PROB}^g' "${FSLDIR}/src/asl_mfree/Makefile"
- sed -i 's^-L${LIB_NEWMAT} $^&-L${LIB_PROB}^g' "${FSLDIR}/src/first/Makefile"
- sed -i 's^-L${LIB_NEWMAT} $^&-L${LIB_PROB}^g' "${FSLDIR}/src/topup/Makefile"
-
- # Fix problem w/ dynamically-linked boost
- sed -i 's^USRCXXFLAGS = -std=c++11$^& -DBOOST_LOG_DYN_LINK^g' "${FSLDIR}/src/mist-clean/Makefile"
-
- # Fix fsl_exec.tcl session issue (https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=fsl;e8fa48c1.1501)
- patch -p0 < fsl_exec.patch
-
- # Fix missing library path in Eddy makefile
- sed -i 's^USRLDFLAGS=-L${LIB_NEWMAT}^USRLDFLAGS=-L${LIB_PROB} -L${LIB_NEWMAT}^g' "${FSLDIR}/src/eddy/Makefile"
-
}
build() {
-
export FSLDIR="${srcdir}/fsl"
cd "${FSLDIR}"
./build
- cp -v "${srcdir}"/{imcp,imglob,immv} "${srcdir}/fsl/bin"
+ # Install missing binaries, which are no longer shipped (depends on fslpy)
+ /usr/bin/install -m 755 "${srcdir}"/{imcp,imglob,immv} "${srcdir}/fsl/bin"
}
check() {
-
export FSLDIR="${srcdir}/fsl"
export FEEDSDIR="${srcdir}/feeds"
. "${FSLDIR}/etc/fslconf/fsl.sh"
@@ -120,7 +71,6 @@ check() {
}
package() {
-
rm -rf "${srcdir}/fsl/src"
rm -rf "${srcdir}/fsl/extras/src"
rm -rf "${srcdir}/fsl/extras/include"
@@ -145,6 +95,7 @@ package() {
mkdir -p "${pkgdir}/usr/share/licenses/fsl"
grep -v \< "${srcdir}/fsl/doc/fsl/licence.html" | cat -s > "${pkgdir}/usr/share/licenses/fsl/LICENSE"
+ # Fix permissions
find "${pkgdir}" -type f -exec chmod 644 {} \;
find "${pkgdir}" -type d -exec chmod 755 {} \;
find "${pkgdir}/opt/fsl/bin" -exec chmod 755 {} \;
@@ -154,7 +105,8 @@ package() {
mkdir -p "${pkgdir}/opt/fsl/feeds/results"
chmod -R 777 "${pkgdir}/opt/fsl/feeds/results"
chmod 755 "${pkgdir}/opt/fsl/feeds/RUN"
-
+
+ # Clean up
find "${pkgdir}" -empty -delete
find "${pkgdir}" -type f -exec sed -i 's^/usr/local/fsl^/opt/fsl^g' "{}" \;
}
diff --git a/imcp b/imcp
index a7478bf8ceb1..5b91bc26c6d7 100755
--- a/imcp
+++ b/imcp
@@ -1,118 +1,10 @@
-#!/bin/sh
-
-# imcp - copy image files
-#
-# Stephen Smith and Mark Jenkinson, FMRIB Image Analysis Group
-#
-# Copyright (C) 1999-2004 University of Oxford
-#
-# Part of FSL - FMRIB's Software Library
-# http://www.fmrib.ox.ac.uk/fsl
-# fsl@fmrib.ox.ac.uk
-#
-# Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
-# Imaging of the Brain), Department of Clinical Neurology, Oxford
-# University, Oxford, UK
-#
-#
-# LICENCE
-#
-# FMRIB Software Library, Release 5.0 (c) 2012, The University of
-# Oxford (the "Software")
-#
-# The Software remains the property of the University of Oxford ("the
-# University").
-#
-# The Software is distributed "AS IS" under this Licence solely for
-# non-commercial use in the hope that it will be useful, but in order
-# that the University as a charitable foundation protects its assets for
-# the benefit of its educational and research purposes, the University
-# makes clear that no condition is made or to be implied, nor is any
-# warranty given or to be implied, as to the accuracy of the Software,
-# or that it will be suitable for any particular purpose or for use
-# under any specific conditions. Furthermore, the University disclaims
-# all responsibility for the use which is made of the Software. It
-# further disclaims any liability for the outcomes arising from using
-# the Software.
-#
-# The Licensee agrees to indemnify the University and hold the
-# University harmless from and against any and all claims, damages and
-# liabilities asserted by third parties (including claims for
-# negligence) which arise directly or indirectly from the use of the
-# Software or the sale of any products based on the Software.
-#
-# No part of the Software may be reproduced, modified, transmitted or
-# transferred in any form or by any means, electronic or mechanical,
-# without the express permission of the University. The permission of
-# the University is not required if the said reproduction, modification,
-# transmission or transference is done without financial return, the
-# conditions of this Licence are imposed upon the receiver of the
-# product, and all original and amended source code is included in any
-# transmitted product. You may be held legally responsible for any
-# copyright infringement that is caused or encouraged by your failure to
-# abide by these terms and conditions.
-#
-# You are not permitted under this Licence to use this Software
-# commercially. Use for which any financial return is received shall be
-# defined as commercial use, and includes (1) integration of all or part
-# of the source code or the Software into a product for sale or license
-# by or on behalf of Licensee to third parties or (2) use of the
-# Software or any derivative of it for research with the final aim of
-# developing software products for sale or license to a third party or
-# (3) use of the Software or any derivative of it for research with the
-# final aim of developing non-software products for sale or license to a
-# third party, or (4) use of the Software to provide any service to an
-# external organisation for which payment is received. If you are
-# interested in using the Software commercially, please contact Oxford
-# University Innovation ("OUI"), the technology transfer company of the
-# University, to negotiate a licence. Contact details are:
-# Innovation@innovation.ox.ac.uk quoting reference DE/9564.
-export LC_ALL=C
-
-if [ $# -lt 2 ] ; then
- echo "Usage: $0 <file1> <file2>"
- echo "Usage: $0 <file1> <file2> ... <fileN> <directory>"
- echo " Copies images from file1 to file2 (including all extensions)"
- echo " NB: filenames can be basenames or include an extension"
- exit 1;
-fi
-
-if [ $# -eq 2 -a ! -d $2 ] ; then
- f1=`${FSLDIR}/bin/remove_ext $1`;
- f2=`${FSLDIR}/bin/remove_ext $2`;
- # do the copies
- if [ -f ${f1}.hdr ] ; then /bin/cp ${f1}.hdr ${f2}.hdr ; fi
- if [ -f ${f1}.hdr.gz ] ; then /bin/cp ${f1}.hdr.gz ${f2}.hdr.gz ; fi
- if [ -f ${f1}.img ] ; then /bin/cp ${f1}.img ${f2}.img ; fi
- if [ -f ${f1}.img.gz ] ; then /bin/cp ${f1}.img.gz ${f2}.img.gz ; fi
- if [ -f ${f1}.nii ] ; then /bin/cp ${f1}.nii ${f2}.nii ; fi
- if [ -f ${f1}.nii.gz ] ; then /bin/cp ${f1}.nii.gz ${f2}.nii.gz ; fi
- if [ -f ${f1}.mnc ] ; then /bin/cp ${f1}.mnc ${f2}.mnc ; fi
- if [ -f ${f1}.mnc.gz ] ; then /bin/cp ${f1}.mnc.gz ${f2}.mnc.gz ; fi
-fi
-
-if [ $# -gt 2 -o -d $2 ] ; then
- for nm in $@ ; do
- dir=$nm;
- done
- if [ ! -d $dir ] ; then
- echo "When using multiple arguments, last name must be a directory"
- exit 1;
- fi
- # remove directory from list of files
- flist="echo $@ | sed s/$dir \*\$//";
- for fn in $flist ; do
- f1=`${FSLDIR}/bin/remove_ext $fn`;
- # do the copies
- if [ -f ${f1}.hdr ] ; then /bin/cp ${f1}.hdr ${dir} ; fi
- if [ -f ${f1}.hdr.gz ] ; then /bin/cp ${f1}.hdr.gz ${dir} ; fi
- if [ -f ${f1}.img ] ; then /bin/cp ${f1}.img ${dir} ; fi
- if [ -f ${f1}.img.gz ] ; then /bin/cp ${f1}.img.gz ${dir} ; fi
- if [ -f ${f1}.nii ] ; then /bin/cp ${f1}.nii ${dir} ; fi
- if [ -f ${f1}.nii.gz ] ; then /bin/cp ${f1}.nii.gz ${dir} ; fi
- if [ -f ${f1}.mnc ] ; then /bin/cp ${f1}.mnc ${dir} ; fi
- if [ -f ${f1}.mnc.gz ] ; then /bin/cp ${f1}.mnc.gz ${dir} ; fi
- done
-fi
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+import re
+import sys
+from fsl.scripts.imcp import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/imglob b/imglob
index 8f7a06127c4c..d5b40a51d29e 100755
--- a/imglob
+++ b/imglob
@@ -1,120 +1,10 @@
-#!/usr/bin/env python
-# imglob - expand list of image filenames
-# Stephen Smith, Mark Jenkinson and Matthew Webster FMRIB Image Analysis Group
-# Copyright (C) 2009 University of Oxford
-# Part of FSL - FMRIB's Software Library
-# http://www.fmrib.ox.ac.uk/fsl
-# fsl@fmrib.ox.ac.uk
-#
-# Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
-# Imaging of the Brain), Department of Clinical Neurology, Oxford
-# University, Oxford, UK
-#
-#
-# LICENCE
-#
-# FMRIB Software Library, Release 5.0 (c) 2012, The University of
-# Oxford (the "Software")
-#
-# The Software remains the property of the University of Oxford ("the
-# University").
-#
-# The Software is distributed "AS IS" under this Licence solely for
-# non-commercial use in the hope that it will be useful, but in order
-# that the University as a charitable foundation protects its assets for
-# the benefit of its educational and research purposes, the University
-# makes clear that no condition is made or to be implied, nor is any
-# warranty given or to be implied, as to the accuracy of the Software,
-# or that it will be suitable for any particular purpose or for use
-# under any specific conditions. Furthermore, the University disclaims
-# all responsibility for the use which is made of the Software. It
-# further disclaims any liability for the outcomes arising from using
-# the Software.
-#
-# The Licensee agrees to indemnify the University and hold the
-# University harmless from and against any and all claims, damages and
-# liabilities asserted by third parties (including claims for
-# negligence) which arise directly or indirectly from the use of the
-# Software or the sale of any products based on the Software.
-#
-# No part of the Software may be reproduced, modified, transmitted or
-# transferred in any form or by any means, electronic or mechanical,
-# without the express permission of the University. The permission of
-# the University is not required if the said reproduction, modification,
-# transmission or transference is done without financial return, the
-# conditions of this Licence are imposed upon the receiver of the
-# product, and all original and amended source code is included in any
-# transmitted product. You may be held legally responsible for any
-# copyright infringement that is caused or encouraged by your failure to
-# abide by these terms and conditions.
-#
-# You are not permitted under this Licence to use this Software
-# commercially. Use for which any financial return is received shall be
-# defined as commercial use, and includes (1) integration of all or part
-# of the source code or the Software into a product for sale or license
-# by or on behalf of Licensee to third parties or (2) use of the
-# Software or any derivative of it for research with the final aim of
-# developing software products for sale or license to a third party or
-# (3) use of the Software or any derivative of it for research with the
-# final aim of developing non-software products for sale or license to a
-# third party, or (4) use of the Software to provide any service to an
-# external organisation for which payment is received. If you are
-# interested in using the Software commercially, please contact Oxford
-# University Innovation ("OUI"), the technology transfer company of the
-# University, to negotiate a licence. Contact details are:
-# Innovation@innovation.ox.ac.uk quoting reference DE/9564.
-
-from __future__ import print_function
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+import re
import sys
-import os
-import glob
-
-def usage():
- print("Usage: $0 [-extension/extensions] <list of names>")
- print(" -extension for one image with full extension")
- print(" -extensions for image list with full extensions")
- sys.exit(1)
-
-def isImage(input,allExtensions): #Returns whether an input filename has an image extension ( and the basename and extension pair )
- for extension in allExtensions:
- if input[-len(extension):] == extension:
- return True, input[:-len(extension)], extension
- return False, input, ''
-
-def removeImageExtension(input,allExtensions):
- return isImage(input,allExtensions)[1]
-
-if len(sys.argv) <= 1:
- usage()
-
-deleteExtensions=True
-primaryExtensions=['.nii.gz', '.nii', '.hdr.gz', '.hdr']
-secondaryExtensions=['.img.gz', '.img']
-allExtensions=primaryExtensions+secondaryExtensions
-validExtensions=primaryExtensions
-startingArg=1
-if sys.argv[1] == "-extensions":
- validExtensions=allExtensions
- deleteExtensions=False
- startingArg=2
-if sys.argv[1] == "-extension":
- deleteExtensions=False
- startingArg=2
-
-filelist=[]
-for arg in range(startingArg, len(sys.argv)):
-# if isImage(sys.argv[arg],allExtensions)[0]: #These enable a "pedantic" style mode currently not used
-# filelist.extend(glob.glob(sys.argv[arg]))
-# else:
-# for currentExtension in validExtensions:
-# filelist.extend(glob.glob(sys.argv[arg]+currentExtension))
- for currentExtension in validExtensions:
- filelist.extend(glob.glob(removeImageExtension(sys.argv[arg],allExtensions)+currentExtension))
+from fsl.scripts.imglob import main
-if deleteExtensions:
- filelist = [ removeImageExtension(file,allExtensions) for file in filelist ]
-filelist=list(set(filelist))
-filelist.sort()
-if len(filelist) > 0:
- print(' '.join(filelist))
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())
diff --git a/immv b/immv
index 8e065f2f9d14..d4c62583c148 100755
--- a/immv
+++ b/immv
@@ -1,117 +1,10 @@
-#!/bin/sh
-
-# immv - rename/move image files
-#
-# Stephen Smith and Mark Jenkinson, FMRIB Image Analysis Group
-#
-# Copyright (C) 1999-2004 University of Oxford
-#
-# Part of FSL - FMRIB's Software Library
-# http://www.fmrib.ox.ac.uk/fsl
-# fsl@fmrib.ox.ac.uk
-#
-# Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance
-# Imaging of the Brain), Department of Clinical Neurology, Oxford
-# University, Oxford, UK
-#
-#
-# LICENCE
-#
-# FMRIB Software Library, Release 5.0 (c) 2012, The University of
-# Oxford (the "Software")
-#
-# The Software remains the property of the University of Oxford ("the
-# University").
-#
-# The Software is distributed "AS IS" under this Licence solely for
-# non-commercial use in the hope that it will be useful, but in order
-# that the University as a charitable foundation protects its assets for
-# the benefit of its educational and research purposes, the University
-# makes clear that no condition is made or to be implied, nor is any
-# warranty given or to be implied, as to the accuracy of the Software,
-# or that it will be suitable for any particular purpose or for use
-# under any specific conditions. Furthermore, the University disclaims
-# all responsibility for the use which is made of the Software. It
-# further disclaims any liability for the outcomes arising from using
-# the Software.
-#
-# The Licensee agrees to indemnify the University and hold the
-# University harmless from and against any and all claims, damages and
-# liabilities asserted by third parties (including claims for
-# negligence) which arise directly or indirectly from the use of the
-# Software or the sale of any products based on the Software.
-#
-# No part of the Software may be reproduced, modified, transmitted or
-# transferred in any form or by any means, electronic or mechanical,
-# without the express permission of the University. The permission of
-# the University is not required if the said reproduction, modification,
-# transmission or transference is done without financial return, the
-# conditions of this Licence are imposed upon the receiver of the
-# product, and all original and amended source code is included in any
-# transmitted product. You may be held legally responsible for any
-# copyright infringement that is caused or encouraged by your failure to
-# abide by these terms and conditions.
-#
-# You are not permitted under this Licence to use this Software
-# commercially. Use for which any financial return is received shall be
-# defined as commercial use, and includes (1) integration of all or part
-# of the source code or the Software into a product for sale or license
-# by or on behalf of Licensee to third parties or (2) use of the
-# Software or any derivative of it for research with the final aim of
-# developing software products for sale or license to a third party or
-# (3) use of the Software or any derivative of it for research with the
-# final aim of developing non-software products for sale or license to a
-# third party, or (4) use of the Software to provide any service to an
-# external organisation for which payment is received. If you are
-# interested in using the Software commercially, please contact Oxford
-# University Innovation ("OUI"), the technology transfer company of the
-# University, to negotiate a licence. Contact details are:
-# Innovation@innovation.ox.ac.uk quoting reference DE/9564.
-export LC_ALL=C
-
-if [ $# -lt 1 ] ; then
- echo "Usage: $0 <file1> <file2>"
- echo " Moves images from file1 to file2 (including all extensions)"
- echo " NB: filenames can be basenames or include an extension"
- exit 1;
-fi
-
-if [ $# -eq 2 -a ! -d $2 ] ; then
- f1=`${FSLDIR}/bin/remove_ext $1`;
- f2=`${FSLDIR}/bin/remove_ext $2`;
- # do the moves
- if [ -f ${f1}.hdr ] ; then /bin/mv ${f1}.hdr ${f2}.hdr ; fi
- if [ -f ${f1}.hdr.gz ] ; then /bin/mv ${f1}.hdr.gz ${f2}.hdr.gz ; fi
- if [ -f ${f1}.img ] ; then /bin/mv ${f1}.img ${f2}.img ; fi
- if [ -f ${f1}.img.gz ] ; then /bin/mv ${f1}.img.gz ${f2}.img.gz ; fi
- if [ -f ${f1}.nii ] ; then /bin/mv ${f1}.nii ${f2}.nii ; fi
- if [ -f ${f1}.nii.gz ] ; then /bin/mv ${f1}.nii.gz ${f2}.nii.gz ; fi
- if [ -f ${f1}.mnc ] ; then /bin/mv ${f1}.mnc ${f2}.mnc ; fi
- if [ -f ${f1}.mnc.gz ] ; then /bin/mv ${f1}.mnc.gz ${f2}.mnc.gz ; fi
-fi
-
-if [ $# -gt 2 -o -d $2 ] ; then
- for nm in $@ ; do
- dir=$nm;
- done
- if [ ! -d $dir ] ; then
- echo "When using multiple arguments, last name must be a directory"
- exit 1;
- fi
- # remove directory from list of files
- flist="echo $@ | sed s/$dir \*\$//";
- for fn in $flist ; do
- f1=`${FSLDIR}/bin/remove_ext $fn`;
- # do the copies
- if [ -f ${f1}.hdr ] ; then /bin/mv ${f1}.hdr ${dir} ; fi
- if [ -f ${f1}.hdr.gz ] ; then /bin/mv ${f1}.hdr.gz ${dir} ; fi
- if [ -f ${f1}.img ] ; then /bin/mv ${f1}.img ${dir} ; fi
- if [ -f ${f1}.img.gz ] ; then /bin/mv ${f1}.img.gz ${dir} ; fi
- if [ -f ${f1}.nii ] ; then /bin/mv ${f1}.nii ${dir} ; fi
- if [ -f ${f1}.nii.gz ] ; then /bin/mv ${f1}.nii.gz ${dir} ; fi
- if [ -f ${f1}.mnc ] ; then /bin/mv ${f1}.mnc ${dir} ; fi
- if [ -f ${f1}.mnc.gz ] ; then /bin/mv ${f1}.mnc.gz ${dir} ; fi
- done
-fi
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+import re
+import sys
+from fsl.scripts.immv import main
+if __name__ == '__main__':
+ sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
+ sys.exit(main())