samtux
6/23/2017 - 2:31 AM

Patch for Orfeo Toolbox 6.0.0 in arch Linux

Patch for Orfeo Toolbox 6.0.0 in arch Linux

# Maintainer: Argyros Argyridis <arargyridis@gmail.com>
# Contributor: Samuel Mesa <samuelmesa@linuxmail.org>

pkgname=orfeo-toolbox
pkgver=6.0.0
_pkgver=6.0
minorver=1
pkgrel=2
pkgdesc="ORFEO Toolbox (OTB) is an open source library of image processing algorithms"
arch=(x86_64 i686)
url="http://www.orfeo-toolbox.org/otb/"
license=('CeCILL')
groups=()
depends=('cmake' 'gdal' 'agg' 'freeglut' 'curl' 'fftw' 'tinyxml' 'muparser' 'fltk' 'python2' 'openscenegraph-qt4' 
		'hdf5'  'insight-toolkit' 'libkml' 'ossim' 'libsvm' 'mapnik' 'qwt5')
makedepends=('boost' 'swig')
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=

source=(https://www.orfeo-toolbox.org/packages/OTB-$pkgver.tar.gz
    001_expresion.patch
		git://github.com/jmichel-otb/GKSVM.git)
noextract=()

md5sums=('a327179e973eb21462d7db24f98f24fd'
         '38fc197b7a9d5862cb4315e955c62e4d'
         'SKIP')


_gitname="GKSVM"

prepare() {
	## Module for monteverdi build
	cd 	$srcdir/  
	cp -ra $srcdir/GKSVM $srcdir/OTB-release-$_pkgver/Modules/Remote

  cd $srcdir/OTB-release-${_pkgver}
  patch -Np0 -i "${srcdir}/001_expresion.patch"
}

build() {  
  cd $srcdir/  
  msg "Extracting archive..." 
  msg "starting make..."
  
  if  [ -d "$srcdir/build/" ]; then
    rm -rf $srcdir/build/
  fi
  mkdir $srcdir/build/

cd $srcdir/build

cmake ../OTB-release-$_pkgver \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -fPIC" \
-DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DOTB_USE_CURL=ON \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DOTB_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
-DPYTHON_LIBRARIES=/usr/lib/libpython2.7.so \
-DPYTHON_INCLUDE_PATH=/usr/include/python2.7/ \
-DOTB_INSTALL_PYTHON_DIR=/usr/lib/python2.7/site-packages/ \
-DITK_DIR=/usr/lib64/cmake/ITK-4.10 \
-DBUILD_SHARED_LIBS=ON \
-DOTB_USE_QT4=ON \
-DOTB_USE_MAPNIK=OFF \
-DOTB_USE_OPENCV=OFF \
-DOTB_USE_MUPARSER=ON \
-DOTB_USE_LIBKML=ON \
-DOTB_USE_LIBSVM=ON \
-DOTB_USE_OPENGL=ON \
-DOTB_USE_GLUT=ON \
-DOTB_DATA_USE_LARGEINPUT=ON \
-DOTB_BUILD_ALL_MODULES_FOR_TESTS=ON \
-DOTB_USE_GLEW=ON \
-DOTB_USE_QWT=ON \
-DQWT_INCLUDE_DIR=/usr/include/qwt5 \
-DQWT_LIBRARY=/usr/lib64/libqwt5.so 

make -j2

  
}

package() {
  # Install an ldconfig conf for Orfeo libs to be visible on the
  # system. Arch runs `ldconfig' after install automatically:
  echo "/usr/lib/otb  /usr/lib/otb/applications" > "${srcdir}/${pkgname}.conf"
  echo "export OTB_APPLICATION_PATH=/usr/lib/otb/applications/" > "${srcdir}/${pkgname}.sh"
  
  install -D -m644 "${srcdir}/${pkgname}.conf" "${pkgdir}/etc/ld.so.conf.d/${pkgname}.conf"
  install -D -m755 "${srcdir}/${pkgname}.sh" "${pkgdir}/etc/profile.d/${pkgname}.sh"
  
  cd "$srcdir/"build
  make DESTDIR="$pkgdir" install
}
From 4faf4e08573266c01b9d315414aa4af02a7893f6 Mon Sep 17 00:00:00 2001
From: Manuel Grizonnet <manuel.grizonnet@cnes.fr>
Date: Tue, 13 Jun 2017 08:31:12 +0200
Subject: [PATCH] COMP: mantis 1430 - expression cannot be used as a function

---
 Modules/Feature/Textures/include/otbSFSTexturesFunctor.h |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git /Modules/Feature/Textures/include/otbSFSTexturesFunctor.h /Modules/Feature/Textures/include/otbSFSTexturesFunctor.h
index 45c24ff..b1b9ee1 100644
--- Modules/Feature/Textures/include/otbSFSTexturesFunctor.h
+++ Modules/Feature/Textures/include/otbSFSTexturesFunctor.h
@@ -95,11 +95,13 @@ public:
   }
   void SetTextureStatus(unsigned int id, bool isSelected){ m_SelectedTextures[id] = isSelected; }
 
-  unsigned int GetSpatialThreshold(){ return m_SpatialThreshold; }
-  InternalPixelType GetSpectralThreshold(){ return m_SpectralThreshold; }
-  unsigned int GetRatioMaxConsiderationNumber(){ return m_RatioMaxConsiderationNumber; }
-  double  GetAlpha(){ return m_Alpha; }
-  unsigned int GetNumberOfDirections(){ return m_NumberOfDirections(); }
+  // Define some getters using itkGetMacro
+  itkGetMacro(SpatialThreshold,unsigned int);
+  itkGetMacro(SpectralThreshold,InternalPixelType);
+  itkGetMacro(RatioMaxConsiderationNumber,unsigned int);
+  itkGetMacro(Alpha,double);
+  itkGetMacro(NumberOfDirections,unsigned int);
+  
   std::vector<bool> GetTexturesStatus(){ return m_SelectedTextures; }
 
   inline OutputType operator ()(const TIter& it)
-- 
1.7.10.4