Blame view

install/install-3rdparty-macos-sierra.sh 38.2 KB
Carolina Galvão committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#!/bin/bash
#
#  Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
#
#  This file is part of the TerraLib - a Framework for building GIS enabled applications.
#
#  TerraLib is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation, either version 3 of the License,
#  or (at your option) any later version.
#
#  TerraLib is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with TerraLib. See COPYING. If not, write to
#  TerraLib Team at <terralib-team@terralib.org>.
#
#
#  Description: Install all required software for TerraLib/TerraView on MAC OS Sierra.
#
#  Author: Gilberto Ribeiro de Queiroz
#  Author: Carolina Galvão dos Santos
#
#  Example:
#  $ TERRALIB_DEPENDENCIES_DIR="/Users/gribeiro/MyLibs" ./install-3rdparty-macos-sierra.sh
#

clear

echo "****************************************"
echo "* TerraLib Installer for Mac OS Sierra *"
echo "****************************************"
echo ""
sleep 1s

#
# Used to update the package location at header of generated third parties.
# Usage: fixRPath <arg1>, where arg1 is a list of files (full path) to be fixed.
# Note: used in build proccess of Boost and QWT packages.
#
function fixRPath()
{
raphael.costa committed
46 47
  _FILES=$1

Carolina Galvão committed
48 49 50
  for _FILE in $_FILES;
  do
    install_name_tool -id $_FILE $_FILE
raphael.costa committed
51

Carolina Galvão committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
    for _FILE2 in $_FILES;
    do
      install_name_tool -change @rpath/`basename "$_FILE"` $_FILE $_FILE2
    done
  done
}

#
# Used to append informations on build log file.
# Usage: log_lib <arg1>, where arg1 the name of package being logged.
#
function log_lib()
{
  echo "=========================================================================" >> build.log
  echo "Warnings for $1">> build.log
}

#
# If first argument is false it aborts the script and
# report the message passed as second argument.
#
function valid()
{
  if [ $1 -ne 0 ]; then
    echo $2
    echo ""
    exit
  fi
}


#
# Check for terralib-3rdparty-macos-sierra.tar.gz
#
if [ ! -f ./terralib-3rdparty-macos-sierra.tar.gz ]; then
  echo "Please, make sure to have terralib-3rdparty-macos-sierra.tar.gz in the current directory!"
  exit
fi


#
# Extract packages
#
echo "extracting packages..."
sleep 1s

tar xzvf terralib-3rdparty-macos-sierra.tar.gz > /dev/null 2> /dev/null
valid $? "Error: could not extract 3rd party libraries (terralib-3rdparty-macos-sierra.tar.gz)"

echo "packages extracted!"
sleep 1s


#
# Go to 3rd party libraries dir
#
cd terralib-3rdparty-macos-sierra > /dev/null
valid $? "Error: could not enter 3rd-party libraries dir (terralib-3rdparty-macos-sierra)"


#
# Check installation dir
#
if [ "$TERRALIB_DEPENDENCIES_DIR" == "" ]; then
  TERRALIB_DEPENDENCIES_DIR="/opt/terralib"
fi

export PATH="$PATH:$TERRALIB_DEPENDENCIES_DIR/bin"
export LD_LIBRARY_PATH="$PATH:$TERRALIB_DEPENDENCIES_DIR/lib"

echo "installing 3rd-party libraries to '$TERRALIB_DEPENDENCIES_DIR' ..."
sleep 1s


#
# PCRE version 8.37
# Site: http://www.pcre.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libpcre.a" ]; then
  echo "installing PCRE..."
raphael.costa committed
132 133
  log_lib "PCRE"

Carolina Galvão committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
  sleep 1s

  tar xzvf pcre-8.37.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress pcre-8.37.tar.gz!"

  cd pcre-8.37 > /dev/null
  valid $? "Error: could not enter pcre-8.32 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure PCRE!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make PCRE!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install PCRE!"

  cd .. > /dev/null
fi


#
Carolina Galvão committed
156
# SWIG version 3.0.12
Carolina Galvão committed
157 158 159 160
# Site: http://www.swig.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/bin/swig" ]; then
  echo "installing SWIG..."
raphael.costa committed
161
  log_lib "SWIG"
Carolina Galvão committed
162 163 164

  sleep 1s

Carolina Galvão committed
165 166
  tar xzvf swig-3.0.12.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress swig-3.0.12.tar.gz!"
Carolina Galvão committed
167

Carolina Galvão committed
168 169
  cd swig-3.0.12 > /dev/null
  valid $? "Error: could not enter swig-3.0.12 dir!"
Carolina Galvão committed
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-pcre-prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure SWIG!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make SWIG!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install SWIG!"

  cd .. > /dev/null
fi


#
# FreeXL version 1.0.1
# Site: https://www.gaia-gis.it/fossil/freexl/index
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libfreexl.dylib" ]; then
  echo "installing FreeXL..."
raphael.costa committed
190
  log_lib "FreeXL"
Carolina Galvão committed
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218

  sleep 1s

  tar xzvf freexl-1.0.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress freexl-1.0.1.tar.gz!"

  cd freexl-1.0.1 > /dev/null
  valid $? "Error: could not enter freexl-1.0.1 dir!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure FreeXL!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make FreeXL!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install FreeXL!"

  cd .. > /dev/null
fi


#
# OOSP-UUID version 1.6.2
# Site: http://www.ossp.org/pkg/lib/uuid/
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libuuid.dylib" ]; then
  echo "installing OOSP-UUID..."
raphael.costa committed
219
  log_lib "OOSP-UUID"
Carolina Galvão committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247

  sleep 1s

  tar xvf uuid-1.6.2.tar > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress uuid-1.6.2.tar!"

  cd uuid-1.6.2 > /dev/null
  valid $? "Error: could not enter uuid-1.6.2 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-cxx > /dev/null 2>> ../build.log
  valid $? "Error: could not configure OOSP-UUID!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make OOSP-UUID!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install OOSP-UUID!"

  cd .. > /dev/null
fi


#
# BZIP2 verson 1.0.6
# Site: http://www.bzip.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libbz2.a" ]; then
  echo "installing bzip2..."
raphael.costa committed
248
  log_lib "bzip2"
Carolina Galvão committed
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268

  sleep 1s

  tar xzvf bzip2-1.0.6.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress bzip2-1.0.6.tar.gz!"

  cd bzip2-1.0.6 > /dev/null
  valid $? "Error: could not enter bzip2-1.0.6 dir!"

  make > /dev/null 2>> ../build.log
  valid $? "Error: could not make BZIP2!"

  make install PREFIX=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: Could not install BZIP2!"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
# SQLite version 3.26.0
# Site: https://www.sqlite.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libsqlite3.dylib" ]; then
  echo "installing SQLite..."
  log_lib "SQLite"

  sleep 1s

  tar xzvf sqlite-autoconf-3260000.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress sqlite-autoconf-3260000.tar.gz!"

  cd sqlite-autoconf-3260000 > /dev/null
  valid $? "Error: could not enter sqlite-autoconf-3260000!"

  CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_SOUNDEX" ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure sqlite!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make sqlite"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install sqlite"

 cd .. > /dev/null
fi


#
# Proj version 6.3.1
# Site: https://proj.org
Carolina Galvão committed
300 301
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libproj.dylib" ]; then
Rodrigo Avancini committed
302 303
  echo "installing Proj..."
  log_lib "Proj"
Carolina Galvão committed
304 305 306

  sleep 1s

Rodrigo Avancini committed
307 308
  tar xzvf proj-6.3.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress proj-6.3.1.tar.gz!"
Carolina Galvão committed
309

Rodrigo Avancini committed
310 311
  cd proj-6.3.1 > /dev/null
  valid $? "Error: could not enter proj-6.3.1 dir!"
Carolina Galvão committed
312

Rodrigo Avancini committed
313 314 315 316 317
  mkdir cmake-build > /dev/null
  cd cmake-build > /dev/null

  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DSQLITE3_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include -DSQLITE3_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/libsqlite3.dylib .. > /dev/null 2>> ../build.log
  valid $? "Error: could not configure Proj!"
Carolina Galvão committed
318 319

  make -j 4 > /dev/null 2>> ../build.log
Rodrigo Avancini committed
320 321 322 323
  valid $? "Error: could not make Proj!"

  ctest > /dev/null 2>> ../build.log
  valid $? "Error: Proj tests fail!"
Carolina Galvão committed
324 325

  make install > /dev/null 2>> ../build.log
Rodrigo Avancini committed
326
  valid $? "Error: Could not install Proj!"
Carolina Galvão committed
327

Rodrigo Avancini committed
328
  cd ../.. > /dev/null
Carolina Galvão committed
329 330 331 332
fi


#
Rodrigo Avancini committed
333
# GEOS version 3.7.3
Carolina Galvão committed
334 335 336 337
# Site: http://geos.osgeo.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgeos.dylib" ]; then
  echo "installing GEOS..."
raphael.costa committed
338
  log_lib "GEOS"
Carolina Galvão committed
339 340 341

  sleep 1s

Rodrigo Avancini committed
342 343
  tar xjvf geos-3.7.3.tar.bz2 > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress geos-3.7.3.tar.bz2!"
Carolina Galvão committed
344

Rodrigo Avancini committed
345 346
  cd geos-3.7.3 > /dev/null
  valid $? "Error: could not enter geos-3.7.3 dir!"
Carolina Galvão committed
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure GEOS!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make GEOS!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install GEOS!"

  cd .. > /dev/null
fi


#
# libPNG version 1.5.17
# Site: http://www.libpng.org/pub/png/libpng.html
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libpng.dylib" ]; then
  echo "installing libPNG..."
raphael.costa committed
367
  log_lib "libPNG"
Carolina Galvão committed
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388

  sleep 1s

  tar xzvf libpng-1.5.17.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libpng-1.5.17.tar.gz!"

  cd libpng-1.5.17 > /dev/null
  valid $? "Error: could not enter libpng-1.5.17 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure libPNG!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make libPNG!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install libPNG!"

  cd .. > /dev/null
fi

Hugo Richard Gomes Vieira committed
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
#
# lib openjpeg version 2.1.2
# Site: https://www.openjpeg.org/
#

if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libopenjp2.dylib" ]; then
  echo "installing openjpeg..."
  echo ""
  sleep 1s

  tar xzvf openjpeg-2.1.2.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress openjpeg-2.1.2.tar.gz!"

  cd openjpeg-2.1.2 > /dev/null
  valid $? "Error: could not enter openjpeg-2.1.2 dir!"

Rodrigo Avancini committed
405
  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} > /dev/null 2>> ../build.log
Hugo Richard Gomes Vieira committed
406 407
  valid $? "Error: could not configure openjpeg!"

Rodrigo Avancini committed
408
  make -j 4 > /dev/null 2>> ../build.log
Hugo Richard Gomes Vieira committed
409 410
  valid $? "Error: could not make openjpeg!"

Rodrigo Avancini committed
411
  make install > /dev/null 2>> ../build.log
Hugo Richard Gomes Vieira committed
412 413 414 415
  valid $? "Error: Could not install openjpeg!"

  cd ..
fi
Carolina Galvão committed
416 417 418 419 420 421 422

#
# Independent JPEG Group version v9a
# Site: http://www.ijg.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libjpeg.dylib" ]; then
  echo "installing Independent JPEG Group Library..."
raphael.costa committed
423
  log_lib "JPEG"
Carolina Galvão committed
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450

  sleep 1s

  tar xzvf jpegsrc.v9a.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress jpegsrc.v9a.tar.gz!"

  cd jpeg-9a > /dev/null
  valid $? "Error: could not enter jpeg-9a dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure JPEG!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make JPEG!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install JPEG!"

  cd .. > /dev/null
fi


#
# TIFF version 4.0.3
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libtiff.dylib" ]; then
  echo "installing TIFF..."
raphael.costa committed
451
  log_lib "TIFF"
Carolina Galvão committed
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474

  sleep 1s

  tar xzvf tiff-4.0.3.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress tiff-4.0.3.tar.gz!"

  cd tiff-4.0.3 > /dev/null
  valid $? "Error: could not enter tiff-4.0.3!"

  ./configure --enable-cxx --with-jpeg-include-dir=$TERRALIB_DEPENDENCIES_DIR/include --with-jpeg-lib-dir=$TERRALIB_DEPENDENCIES_DIR/lib --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure TIFF!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make TIFF!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install TIFF!"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
475
# GeoTIFF version 1.5.1
Carolina Galvão committed
476 477 478
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgeotiff.dylib" ]; then
  echo "installing GeoTIFF..."
raphael.costa committed
479
  log_lib "GeoTIFF"
Carolina Galvão committed
480 481 482

  sleep 1s

Rodrigo Avancini committed
483 484
  tar xzvf libgeotiff-1.5.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libgeotiff-1.5.1.tar.gz!"
Carolina Galvão committed
485

Rodrigo Avancini committed
486 487
  cd libgeotiff-1.5.1 > /dev/null
  valid $? "Error: could not enter libgeotiff-1.5.1!"
Carolina Galvão committed
488

Rodrigo Avancini committed
489
  #CPPFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"
Carolina Galvão committed
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
  ./configure --with-jpeg=$TERRALIB_DEPENDENCIES_DIR --with-zlib --with-libtiff=$TERRALIB_DEPENDENCIES_DIR --with-proj=$TERRALIB_DEPENDENCIES_DIR --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure GeoTIFF!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make GeoTIFF!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install GeoTIFF!"

  cd .. > /dev/null
fi


#
# SZIP version 2.1
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libsz.dylib" ]; then
  echo "installing SZIP..."
raphael.costa committed
508
  log_lib "SZIP"
Carolina Galvão committed
509 510 511 512 513 514 515 516 517

  sleep 1s

  tar xzvf szip-2.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress szip-2.1.tar.gz!"

  cd szip-2.1 > /dev/null
  valid $? "Error: could not enter szip-2.1!"

Rodrigo Avancini committed
518
  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
Carolina Galvão committed
519 520 521 522 523 524 525 526 527 528 529 530 531
  valid $? "Error: could not configure SZIP!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make SZIP!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install SZIP!"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
# OpenSSL version 1.1.1c
# Site: https://github.com/openssl/openssl/releases
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libssl.dylib" ]; then
  echo "installing OpenSSL..."
  sleep 1s

  tar xzvf openssl-1.1.1c.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress openssl-1.1.1c.tar.gz!"

  cd openssl-1.1.1c > /dev/null 2> /dev/null
  valid $? "Error: could not enter openssl-1.1.1c!"

  ./config --prefix=$TERRALIB_DEPENDENCIES_DIR shared -fPIC zlib-dynamic no-asm no-gost --with-zlib-include=$TERRALIB_DEPENDENCIES_DIR/include > /dev/null 2> /dev/null
  valid $? "Error: could not configure OpenSSL!"

  make -j 4 > /dev/null 2> /dev/null
  valid $? "Error: could not make OpenSSL!"

  CONFIG_OPTS="--strict-warnings zlib" make test > /dev/null 2> /dev/null
  valid $? "Error: could not test OpenSSL!"

  make install > /dev/null 2> /dev/null
  valid $? "Error: Could not install OpenSSL!"

  cd ..
fi


#
# CURL version 7.68.0
Carolina Galvão committed
563 564 565 566
# Site: http://curl.haxx.se/libcurl/
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libcurl.dylib" ]; then
  echo "installing CURL..."
raphael.costa committed
567
  log_lib "CURL"
Carolina Galvão committed
568 569 570

  sleep 1s

Rodrigo Avancini committed
571 572
  tar xzvf curl-7.68.0.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress curl-7.68.0.tar.gz!"
Carolina Galvão committed
573

Rodrigo Avancini committed
574 575
  cd curl-7.68.0 > /dev/null
  valid $? "Error: could not enter curl-7.68.0!"
Carolina Galvão committed
576

Rodrigo Avancini committed
577
  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-ssl=$TERRALIB_DEPENDENCIES_DIR --with-zlib --libdir=$TERRALIB_DEPENDENCIES_DIR/lib > /dev/null 2>> ../build.log
Carolina Galvão committed
578 579 580 581 582 583 584 585 586 587 588 589 590
  valid $? "Error: could not configure CURL!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make CURL!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install CURL!"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
591
# ICU version 59.2
Carolina Galvão committed
592
#
593
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libicuuc.dylib" ]; then
Carolina Galvão committed
594
  echo "installing ICU..."
raphael.costa committed
595
  log_lib "ICU"
Carolina Galvão committed
596 597 598

  sleep 1s

Rodrigo Avancini committed
599 600
  tar xzvf icu4c-59_2-src.tgz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress icu4c-59_2-src.tgz!"
Carolina Galvão committed
601 602 603 604 605 606 607

  cd icu/source > /dev/null
  valid $? "Error: could not enter icu/source!"

  chmod +x runConfigureICU configure install-sh > /dev/null
  valid $? "Error: could not set runConfigureICU to execute mode!"

raphael.costa committed
608
  CPPFLAGS="-DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1 -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" ./runConfigureICU MacOSX --prefix=$TERRALIB_DEPENDENCIES_DIR --enable-rpath > /dev/null 2>> ../build.log
Carolina Galvão committed
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
  valid $? "Error: could not runConfigureICU!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make ICU!"

  #make check
  #valid $? "Error: could not check ICU build!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install ICU!"

  cd ../.. > /dev/null
fi


#
Rodrigo Avancini committed
625
# Xerces-c version 3.1.4
Carolina Galvão committed
626 627 628
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxerces-c.dylib" ]; then
  echo "installing Xerces..."
raphael.costa committed
629
  log_lib "Xerces"
Carolina Galvão committed
630 631 632

  sleep 1s

Rodrigo Avancini committed
633 634
  tar xzvf xerces-c-3.1.4.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress xerces-c-3.1.4.tar.gz!"
Carolina Galvão committed
635

Rodrigo Avancini committed
636 637
  cd xerces-c-3.1.4 > /dev/null
  valid $? "Error: could not enter xerces-c-3.1.4!"
Carolina Galvão committed
638

Rodrigo Avancini committed
639
  CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64 -O3 -std=c++11" CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --enable-netaccessor-curl --disable-static --enable-msgloader-icu --with-icu=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
Carolina Galvão committed
640 641
  valid $? "Error: could not configure Xerces-c!"

Rodrigo Avancini committed
642
  make -j 4 > /dev/null 2>> ../build.log
Carolina Galvão committed
643 644 645 646 647 648 649 650 651 652
  valid $? "Error: could not make Xerces-c!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install Xerces-c!"

  cd .. > /dev/null
fi


#
Carolina Galvão committed
653
# libxml2 version 2.9.1
Carolina Galvão committed
654 655 656
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxml2.dylib" ]; then
  echo "installing libxml2..."
raphael.costa committed
657
  log_lib "libxml2"
Carolina Galvão committed
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680

  sleep 1s

  tar xzvf libxml2-2.9.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libxml2-2.9.1.tar.gz!"

  cd libxml2-2.9.1 > /dev/null
  valid $? "Error: could not enter libxml2-2.9.1!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-icu --without-python > /dev/null 2>> ../build.log
  valid $? "Error: could not configure libxml2!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make libxml2"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install libxml2"

  cd .. > /dev/null
fi


#
Carolina Galvão committed
681
# libxslt version 1.1.28
Carolina Galvão committed
682 683 684
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxslt.dylib" ]; then
  echo "installing libxslt..."
raphael.costa committed
685
  log_lib "libxslt"
Carolina Galvão committed
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708

  sleep 1s

  tar xzvf libxslt-1.1.28.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libxslt-1.1.28.tar.gz!"

  cd libxslt-1.1.28 > /dev/null
  valid $? "Error: could not enter libxslt-1.1.28!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-libxml-prefix=$TERRALIB_DEPENDENCIES_DIR --without-debug > /dev/null 2>> ../build.log
  valid $? "Error: could not configure libxslt!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make libxslt"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install libxslt"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
709
# Boost version 1.65
Carolina Galvão committed
710 711 712 713
# Site: http://www.boost.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libboost_thread.dylib" ]; then
  echo "installing boost..."
raphael.costa committed
714
  log_lib "boost"
Carolina Galvão committed
715 716 717

  sleep 1s

Rodrigo Avancini committed
718 719
  tar xzvf boost_1_65_0.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress boost_1_65_0.tar.gz!"
Carolina Galvão committed
720

Rodrigo Avancini committed
721 722
  cd boost_1_65_0 > /dev/null
  valid $? "Error: could not enter boost_1_65_0!"
Carolina Galvão committed
723

raphael.costa committed
724
  ./bootstrap.sh --with-toolset=clang --prefix=$TERRALIB_DEPENDENCIES_DIR -with-icu=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
Carolina Galvão committed
725 726
  valid $? "Error: could not configure Boost!"

Rodrigo Avancini committed
727
  ./b2 runtime-link=shared link=shared variant=release threading=multi -sICU_PATH=$TERRALIB_DEPENDENCIES_DIR install > /dev/null 2>> ../build.log
Carolina Galvão committed
728 729 730 731 732 733 734 735 736 737 738 739
  valid $? "Error: could not make boost"

  cd .. > /dev/null

  fixRPath "`ls $TERRALIB_DEPENDENCIES_DIR/lib/libboost*.dylib`" > /dev/null
fi

#
# PostgreSQL version 9.4.1
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/pgsql/lib/libpq.dylib" ]; then
  echo "installing PostgreSQL..."
raphael.costa committed
740
  log_lib "PostgreSQL"
Carolina Galvão committed
741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776

  sleep 1s

  tar xjvf postgresql-9.4.1.tar.bz2 > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress postgresql-9.4.1.tar.bz2!"

  cd postgresql-9.4.1 > /dev/null
  valid $? "Error: could not enter postgresql-9.4.1!"

  CPPFLAGS="-I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2" LDFLAGS="-lstdc++ -L$TERRALIB_DEPENDENCIES_DIR/lib" ./configure --with-libxml --with-libxslt --with-uuid=e2fs --prefix=$TERRALIB_DEPENDENCIES_DIR/pgsql --with-includes=$TERRALIB_DEPENDENCIES_DIR/include --with-libraries=$TERRALIB_DEPENDENCIES_DIR/lib > /dev/null 2>> ../build.log
  valid $? "Error: could not configure postgresql!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make postgresql"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install postgresql"

  cd contrib/uuid-ossp > /dev/null
  valid $? "Error: could not enter postgresql-9.4.1/contrib/uuid-ossp!"

  make > /dev/null 2>> ../build.log
  valid $? "Error: could not make postgresql-9.4.1/contrib/uuid-ossp"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install postgresql-9.4.1/contrib/uuid-ossp"

  cd ../../..
fi


#
# HDF4 version 4.2.9
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libmfhdf.a" ]; then
  echo "installing HDF4..."
raphael.costa committed
777
  log_lib "HDF4"
Carolina Galvão committed
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800

  sleep 1s

  tar xzvf hdf-4.2.9.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress hdf-4.2.9.tar.gz!"

  cd hdf-4.2.9 > /dev/null
  valid $? "Error: could not enter hdf-4.2.9!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-szlib=$TERRALIB_DEPENDENCIES_DIR --with-zlib --with-jpeg=$TERRALIB_DEPENDENCIES_DIR --enable-netcdf --disable-fortran > /dev/null 2>> ../build.log
  valid $? "Error: could not configure hdf-4!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make hdf-4"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install hdf-4"

  cd .. > /dev/null
fi


#
Rodrigo Avancini committed
801
# SpatiaLite version 4.3.0a
Carolina Galvão committed
802 803 804 805 806
# Site: https://www.gaia-gis.it/fossil/libspatialite
# Obs.: In the future we should turn on libxml2 support.
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libspatialite.dylib" ]; then
  echo "installing SpatiaLite..."
raphael.costa committed
807
  log_lib "SpatiaLite"
Carolina Galvão committed
808 809 810

  sleep 1s

Rodrigo Avancini committed
811 812
  tar xzvf libspatialite-4.3.0a.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libspatialite-4.3.0a.tar.gz!"
Carolina Galvão committed
813

Rodrigo Avancini committed
814 815
  cd libspatialite-4.3.0a > /dev/null
  valid $? "Error: could not enter libspatialite-4.3.0a!"
Carolina Galvão committed
816

Rodrigo Avancini committed
817
  CPPFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I$TERRALIB_DEPENDENCIES_DIR -I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2 -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2/libxml" LDFLAGS="-L$TERRALIB_DEPENDENCIES_DIR/lib"  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --enable-proj --enable-geos --enable-geosadvanced --enable-iconv --enable-freexl --enable-geocallbacks --enable-epsg --enable-mathsql --enable-libxml2=no --enable-geopackage --with-geosconfig=$TERRALIB_DEPENDENCIES_DIR/bin/geos-config  > /dev/null  2>> ../build.log
Carolina Galvão committed
818 819 820 821 822 823 824 825 826 827 828
  valid $? "Error: could not configure libspatialite!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make libspatialite"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install libspatialite"

  cd .. > /dev/null
fi

Carolina Galvão committed
829 830 831 832 833 834
#
# Minizip version 1.3.1
# Site: http://www.winimage.com/zLibDll/minizip.html
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libminizip.a" ]; then
  echo "installing minizip..."
raphael.costa committed
835
  log_lib "minizip"
Carolina Galvão committed
836 837 838

  sleep 1s

Carolina Galvão committed
839 840
  tar xzvf zlib-1.2.11.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress zlib-1.2.11.tar.gz!"
Carolina Galvão committed
841

Carolina Galvão committed
842 843 844
  cd zlib-1.2.11 > /dev/null
  valid $? "Error: could not enter minizip!"

Carolina Galvão committed
845
  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
Carolina Galvão committed
846 847 848
  valid $? "Error: could not configure minizip!"

  make > /dev/null 2>> ../build.log
Carolina Galvão committed
849 850 851
  valid $? "Error: Could not make minizip"

  make install > /dev/null 2>> ../build.log
Eric Silva Abreu committed
852

Carolina Galvão committed
853 854 855
  valid $? "Error: Could not install minizip"

  cd contrib/minizip > /dev/null
Carolina Galvão committed
856 857 858 859 860 861 862 863 864 865 866
  valid $? "Error: could not enter minizip!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure minizip!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make minizip"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install minizip"

Carolina Galvão committed
867
  cd ../../.. > /dev/null
Carolina Galvão committed
868 869
fi

Carolina Galvão committed
870

Carolina Galvão committed
871 872 873 874 875 876
#
# Uriparser version 0.8.4
# Site: https://sourceforge.net/projects/uriparser/files/Sources/0.8.4/
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/liburiparser.dylib" ]; then
  echo "installing uriparser..."
raphael.costa committed
877
  log_lib "uriparser"
Carolina Galvão committed
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904

  sleep 1s

  tar xzvf uriparser-0.8.4.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress uriparser-0.8.4.tar.gz!"

  cd uriparser-0.8.4 > /dev/null
  valid $? "Error: could not enter uriparser!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --disable-test --disable-doc > /dev/null 2>> ../build.log
  valid $? "Error: could not configure uriparser!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make uriparser"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install uriparser"

  cd .. > /dev/null
fi

#
# Libkml version 1.3.1
# Site: https://github.com/libkml/libkml
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libkmlbase.dylib" ]; then
  echo "installing libkml..."
raphael.costa committed
905
  log_lib "libkml"
Carolina Galvão committed
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928

  sleep 1s

  tar xzvf libkml-master.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress libkml-master.tar.gz!"

  cd libkml-master > /dev/null
  valid $? "Error: could not enter libkml-master!"

  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_MACOSX_RPATH:BOOL=YES -DCMAKE_PREFIX_PATH:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_INSTALL_PREFIX:PATH=${TERRALIB_DEPENDENCIES_DIR} > /dev/null 2>> ../build.log
  valid $? "Error: could not configure libkml!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make libkml"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install libkml"

  cd .. > /dev/null

  fixRPath "`ls $TERRALIB_DEPENDENCIES_DIR/lib/libkml*.1.dylib`" > /dev/null

fi
Carolina Galvão committed
929 930

#
Rodrigo Avancini committed
931
# GDAL/OGR version 3.0.4
Carolina Galvão committed
932
# Site: http://www.gdal.org
Carolina Galvão committed
933
# Obs.: in the future add a flag --with-php --with-python
Carolina Galvão committed
934
#
Carolina Galvão committed
935
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgdal.dylib" ]; then
Rodrigo Avancini committed
936 937
  echo "installing GDAL/OGR 3.0.4..."
  log_lib "GDAL/OGR 3.0.4"
Carolina Galvão committed
938 939 940

  sleep 1s

Rodrigo Avancini committed
941 942
  tar xzvf gdal-3.0.4.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress gdal-3.0.4.tar.gz!"
Carolina Galvão committed
943

Rodrigo Avancini committed
944 945
  cd gdal-3.0.4 > /dev/null
  valid $? "Error: could not enter gdal-3.0.4!"
Carolina Galvão committed
946

Hugo Richard Gomes Vieira committed
947
  CPPFLAGS="-I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2" LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --with-libkml=$TERRALIB_DEPENDENCIES_DIR --with-pg=$TERRALIB_DEPENDENCIES_DIR/pgsql/bin/pg_config --with-png=$TERRALIB_DEPENDENCIES_DIR --with-libtiff=$TERRALIB_DEPENDENCIES_DIR --with-geotiff=$TERRALIB_DEPENDENCIES_DIR --with-jpeg=$TERRALIB_DEPENDENCIES_DIR  --with-gif --with-ecw=yes --with-xerces=$TERRALIB_DEPENDENCIES_DIR --with-expat=yes --with-openjpeg-2.0=$TERRALIB_DEPENDENCIES_DIR --with-curl=$TERRALIB_DEPENDENCIES_DIR/bin/curl-config --with-sqlite3=$TERRALIB_DEPENDENCIES_DIR --with-geos=$TERRALIB_DEPENDENCIES_DIR/bin/geos-config --with-threads --with-spatialite=$TERRALIB_DEPENDENCIES_DIR --with-hdf4=$TERRALIB_DEPENDENCIES_DIR --with-freexl=$TERRALIB_DEPENDENCIES_DIR --prefix=$TERRALIB_DEPENDENCIES_DIR --with-xml2=$TERRALIB_DEPENDENCIES_DIR/bin/xml2-config  --without-python > /dev/null 2>> ../build.log
Rodrigo Avancini committed
948
  valid $? "Error: could not configure gdal 3.0.4!"
Carolina Galvão committed
949 950

  make -j 4 > /dev/null 2>> ../build.log
Rodrigo Avancini committed
951
  valid $? "Error: could not make gdal 3.0.4"
Carolina Galvão committed
952 953

  make install > /dev/null 2>> ../build.log
Rodrigo Avancini committed
954
  valid $? "Error: Could not install gdal 3.0.4"
Carolina Galvão committed
955 956 957 958 959 960 961 962 963 964

  cd .. > /dev/null
fi


#
# CppUnit version 1.12.1
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libcppunit.dylib" ]; then
  echo "installing CppUnit.."
raphael.costa committed
965
  log_lib "CppUnit"
Carolina Galvão committed
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993

  sleep 1s

  tar xzvf cppunit-1.12.1.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress cppunit-1.12.1.tar.gz!"

  cd cppunit-1.12.1 > /dev/null
  valid $? "Error: could not enter cppunit-1.12.1!"

  #LDFLAGS="-ldl" ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
#  valid $? "Error: could not configure cppunit!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make cppunit"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install cppunit"

  cd .. > /dev/null
fi


#
# Qt Property Browser
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqt_property_browser.dylib" ]; then
  echo "installing Qt Property Browser..."
raphael.costa committed
994
  log_lib "Qt Property Browser"
Carolina Galvão committed
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017

  sleep 1s

  tar xzvf qtpropertybrowser.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress qtpropertybrowser.tar.gz!"

  cd qtpropertybrowser > /dev/null
  valid $? "Error: could not change dir to qtpropertybrowser!"

  qmake "TERRALIB_DIR=$TERRALIB_DEPENDENCIES_DIR" > /dev/null 2>> ../build.log
  valid $? "Error: could not run qmake for qt-property-browser!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make qt-property-browser!"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install qt-property-browser!"

  cd .. > /dev/null
fi


#
Matheus C. Zaglia committed
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038
# QScintilla version 2.10
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqscintilla2.dylib" ]; then
  echo "installing QScintilla..."
  sleep 1s

  tar xzvf QScintilla_gpl-2.10.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress QScintilla_gpl-2.10.tar.gz!"

  cd QScintilla_gpl-2.10/Qt4Qt5 > /dev/null
  valid $? "Error: could not change dir to QScintilla_gpl-2.10/Qt4Qt5!"

  qmake "TERRALIB_DIR=$TERRALIB_DEPENDENCIES_DIR" > /dev/null 2>> ../build.log
  valid $? "Error: could not prepare QScintilla build with qmake!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make QScintilla!"

  make install  > /dev/null 2>> ../build.log
  valid $? "Error: Could not install QScintilla!"

Matheus C. Zaglia committed
1039 1040
  fixRPath "$TERRALIB_DEPENDENCIES_DIR/lib/libqscintilla2.dylib"

Matheus C. Zaglia committed
1041 1042
  cd ../.. > /dev/null
fi
Carolina Galvão committed
1043 1044 1045


#
Carolina Galvão committed
1046
# Lua version 5.3.4
Carolina Galvão committed
1047
#
Carolina Galvão committed
1048
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/liblua.dylib" ]; then
Carolina Galvão committed
1049
  echo "installing Lua..."
raphael.costa committed
1050
  log_lib "Lua"
Carolina Galvão committed
1051 1052 1053

  sleep 1s

Carolina Galvão committed
1054 1055
  tar xzvf lua-5.3.4.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress lua-5.3.4.tar.gz!"
Carolina Galvão committed
1056

Carolina Galvão committed
1057 1058
  cd lua-5.3.4 > /dev/null
  valid $? "Error: could not change dir to lua-5.3.4!"
Carolina Galvão committed
1059

Carolina Galvão committed
1060 1061
  mkdir cmake-build > /dev/null
  cd cmake-build > /dev/null
Carolina Galvão committed
1062

Carolina Galvão committed
1063 1064
  cmake -G "Xcode" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DINSTALL_INC=${TERRALIB_DEPENDENCIES_DIR}/include/lua .. > /dev/null 2>> ../build.log
  valid $? "Error: could not configure Lua!"
Carolina Galvão committed
1065

Carolina Galvão committed
1066
  cmake --build . --target install --config Release  > /dev/null 2>> ../build.log
Carolina Galvão committed
1067 1068
  valid $? "Error: could not install Lua!"

raphael.costa committed
1069
  cd ../.. > /dev/null
Carolina Galvão committed
1070 1071

  fixRPath "`ls $TERRALIB_DEPENDENCIES_DIR/lib/liblua.dylib`" > /dev/null
Carolina Galvão committed
1072
fi
Carolina Galvão committed
1073 1074


Carolina Galvão committed
1075
#
Carolina Galvão committed
1076
# QtLua version 2.0
Carolina Galvão committed
1077
#
Carolina Galvão committed
1078 1079 1080 1081
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqtlua.dylib" ]; then
  echo "installing QtLua..."
  sleep 1s

Carolina Galvão committed
1082
  tar xzvf libqtlua-2.0.tar.gz > /dev/null 2> /dev/null
Carolina Galvão committed
1083 1084
  valid $? "Error: could not uncompress libqtlua-2.0.tar.gz!"

Carolina Galvão committed
1085
  cd libqtlua-2.0 > /dev/null
Carolina Galvão committed
1086
  valid $? "Error: could not change dir to libqtlua-2.0!"
raphael.costa committed
1087

Carolina Galvão committed
1088 1089
  mkdir cmake-build > /dev/null
  cd cmake-build > /dev/null
Carolina Galvão committed
1090

Carolina Galvão committed
1091
  cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DLUA_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/liblua.dylib -DLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include/lua .. > /dev/null 2>> ../build.log
Carolina Galvão committed
1092 1093
  valid $? "Error: could not configure QtLua!"

Carolina Galvão committed
1094
  cmake --build . --target install --config Release  > /dev/null 2>> ../build.log
Carolina Galvão committed
1095 1096
  valid $? "Error: could not install QtLua!"

Carolina Galvão committed
1097
  cd .. > /dev/null
Carolina Galvão committed
1098

Carolina Galvão committed
1099
  cp -r src/internal $TERRALIB_DEPENDENCIES_DIR/include/QtLua/ > /dev/null
Carolina Galvão committed
1100 1101 1102
  valid $? "Error: could not copy QtLua internal folder!"

  cd ..
Carolina Galvão committed
1103 1104

  fixRPath "`ls $TERRALIB_DEPENDENCIES_DIR/lib/libqtlua*.dylib`" > /dev/null
Carolina Galvão committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
fi


#
# QtLuaExtras
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/qtluae.dylib" ]; then
  echo "installing QtLuaExtras..."
  sleep 1s

Carolina Galvão committed
1115
  tar xzvf qtluae.tar.gz > /dev/null 2> /dev/null
Carolina Galvão committed
1116 1117
  valid $? "Error: could not uncompress qtluae.tar.gz!"

Carolina Galvão committed
1118
  cd qtluae > /dev/null
Carolina Galvão committed
1119 1120
  valid $? "Error: could not change dir to qtluae!"

Carolina Galvão committed
1121 1122
  mkdir cmake-build > /dev/null
  cd cmake-build > /dev/null
Carolina Galvão committed
1123

Carolina Galvão committed
1124
  cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DLUA_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/liblua.dylib -DLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include/lua -DQTLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include -DQTLUA_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/libqtlua.dylib ../build/cmake > /dev/null 2>> ../build.log
Carolina Galvão committed
1125 1126
  valid $? "Error: could not configure QtLuaExtras!"

Carolina Galvão committed
1127
  cmake --build . --target install --config Release > /dev/null 2>> ../build.log
Carolina Galvão committed
1128 1129
  valid $? "Error: could not install QtLuaExtras!"

Carolina Galvão committed
1130
  cp -a ${TERRALIB_DEPENDENCIES_DIR}/lib/libqtluae.dylib ${TERRALIB_DEPENDENCIES_DIR}/lib/qtluae.dylib > /dev/null
Carolina Galvão committed
1131 1132
  valid $? "Error: could not copy QtLuaExtras internal folder!"

Carolina Galvão committed
1133
  cd ../.. > /dev/null
Carolina Galvão committed
1134
fi
Carolina Galvão committed
1135 1136 1137


#
Carolina Galvão committed
1138
# Qwt version 6.1.2
Carolina Galvão committed
1139 1140 1141 1142
# Site: http://qwt.sourceforge.net
#
if [ ! -d "$TERRALIB_DEPENDENCIES_DIR/lib/qwt.framework" ]; then
  echo "installing Qwt..."
raphael.costa committed
1143
  log_lib "Qwt"
Carolina Galvão committed
1144 1145 1146 1147 1148 1149 1150 1151 1152

  sleep 1s

  tar xjvf qwt-6.1.2.tar.bz2 > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress qwt-6.1.2.tar.bz2!"

  cd qwt-6.1.2 > /dev/null
  valid $? "Error: could not change dir to qwt-6.1.2!"

Carolina Galvão committed
1153
  qmake qwt.pro "QWT_INSTALL_PREFIX_TARGET=$TERRALIB_DEPENDENCIES_DIR"  > /dev/null 2>> ../build.log
Carolina Galvão committed
1154 1155 1156 1157 1158 1159 1160 1161 1162
  valid $? "Error: could not configure Qwt!"

  make -j 4  > /dev/null 2>> ../build.log
  valid $? "Error: could not make Qwt!"

  make install  > /dev/null 2>> ../build.log
  valid $? "Error: could not copy Qwt internal folder!"

  cd ..  > /dev/null
raphael.costa committed
1163

Carolina Galvão committed
1164 1165 1166 1167 1168 1169 1170 1171
  fixRPath "$TERRALIB_DEPENDENCIES_DIR/lib/qwt.framework/Versions/6/qwt"  > /dev/null
fi


#
# GTest and GMock
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgmock.a" ]; then
Carolina Galvão committed
1172 1173 1174
  echo "installing GTest and GMock..."
  sleep 1s

Rodrigo Avancini committed
1175
  unzip -o googletest-master.zip > /dev/null 2> /dev/null
Carolina Galvão committed
1176
  valid $? "Error: could not uncompress googletest-master.zip!"
Carolina Galvão committed
1177

Carolina Galvão committed
1178 1179
  cd googletest-master/googletest > /dev/null
  valid $? "Error: could not enter googletestmaster!"
Carolina Galvão committed
1180

Carolina Galvão committed
1181 1182
  cmake . > /dev/null 2>> ../build.log
  valid $? "Error: could not configure googletest!"
Carolina Galvão committed
1183

Carolina Galvão committed
1184 1185
  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make googletest!"
Carolina Galvão committed
1186

Carolina Galvão committed
1187 1188
  cp libgtest.a $TERRALIB_DEPENDENCIES_DIR/lib/ > /dev/null
  valid $? "Error: could not copy libgtest.a!"
Carolina Galvão committed
1189

Carolina Galvão committed
1190 1191
  cp libgtest_main.a $TERRALIB_DEPENDENCIES_DIR/lib/ > /dev/null
  valid $? "Error: could not copy libgtest_main.a!"
Carolina Galvão committed
1192

Carolina Galvão committed
1193 1194
  cp -r include/gtest $TERRALIB_DEPENDENCIES_DIR/include/ > /dev/null
  valid $? "Error: could not copy include dir!"
Carolina Galvão committed
1195

Carolina Galvão committed
1196
  cd ../googlemock > /dev/null
Carolina Galvão committed
1197

Carolina Galvão committed
1198 1199
  cmake . > /dev/null 2>> ../build.log
  valid $? "Error: could not configure googlemock!"
Carolina Galvão committed
1200

Carolina Galvão committed
1201 1202
  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make googlemock!"
Carolina Galvão committed
1203

Carolina Galvão committed
1204 1205
  cp libgmock.a $TERRALIB_DEPENDENCIES_DIR/lib/ > /dev/null
  valid $? "Error: could not copy libgmock.a!"
Carolina Galvão committed
1206

Carolina Galvão committed
1207 1208
  cp libgmock_main.a $TERRALIB_DEPENDENCIES_DIR/lib/ > /dev/null
  valid $? "Error: could not copy libgmock_main.a!"
Carolina Galvão committed
1209

Carolina Galvão committed
1210 1211
  cp -r include/gmock $TERRALIB_DEPENDENCIES_DIR/include/ > /dev/null
  valid $? "Error: could not copy include dir!"
Carolina Galvão committed
1212

Carolina Galvão committed
1213 1214
  cd ../.. > /dev/null
fi
Carolina Galvão committed
1215

Carolina Galvão committed
1216
#
Carolina Galvão committed
1217
# Wtss-Cxx version 0.4.0
Carolina Galvão committed
1218
#
Carolina Galvão committed
1219
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libwtss_cxx_client.dylib" ]; then
Carolina Galvão committed
1220
  echo "installing Wtss-Cxx..."
raphael.costa committed
1221
  log_lib "Wtss-Cxx"
Carolina Galvão committed
1222 1223 1224 1225 1226 1227 1228 1229 1230

  sleep 1s

  tar xzvf wtss-cxx.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress wtss-cxx.tar.gz!"

  cd wtss-cxx > /dev/null
  valid $? "Error: could not change dir to wtss-cxx!"

Carolina Galvão committed
1231
  cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_INSTALL_PREFIX:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_BUILD_TYPE:STRING="Release" build/cmake > /dev/null 2>> ../build.log
Carolina Galvão committed
1232 1233 1234 1235 1236 1237 1238 1239 1240
  valid $? "Error: could not configure Wtss-Cxx!"

  make -j 4  > /dev/null 2>> ../build.log
  valid $? "Error: could not make Wtss-Cxx!"

  make install  > /dev/null 2>> ../build.log
  valid $? "Error: could not copy Wtss-Cxx internal folder!"

  cd ..  > /dev/null
Carolina Galvão committed
1241 1242

  fixRPath "$TERRALIB_DEPENDENCIES_DIR/lib/libwtss_cxx_client.dylib"  > /dev/null
Carolina Galvão committed
1243 1244 1245
fi

#
Carolina Galvão committed
1246 1247 1248 1249
# GeographicLib version 1.48
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libGeographic.dylib" ]; then
  echo "installing GeographicLib..."
raphael.costa committed
1250
  log_lib "GeographicLib"
Carolina Galvão committed
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274

  sleep 1s

  tar xzvf GeographicLib-1.48.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress GeographicLib-1.48.tar.gz!"

  cd GeographicLib-1.48 > /dev/null
  valid $? "Error: could not change dir to GeographicLib-1.48!"

  cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_INSTALL_PREFIX:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_BUILD_TYPE:STRING="Release" > /dev/null 2>> ../build.log
  valid $? "Error: could not configure GeographicLib!"

  make -j 4  > /dev/null 2>> ../build.log
  valid $? "Error: could not make GeographicLib"

  make install  > /dev/null 2>> ../build.log
  valid $? "Error: could not copy GeographicLib internal folder!"

  cd ..  > /dev/null

  fixRPath "`ls $TERRALIB_DEPENDENCIES_DIR/lib/libGeographic*.dylib`" > /dev/null
fi

#
Carolina Galvão committed
1275 1276 1277
# Gettext version 0.19.8.1
# Site: https://ftp.gnu.org/pub/gnu/gettext/
#
Rodrigo Avancini committed
1278
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgettextlib.dylib" ]; then
Carolina Galvão committed
1279
  echo "installing Gettext..."
raphael.costa committed
1280
  log_lib "gettext"
Carolina Galvão committed
1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302

  sleep 1s

  tar xzvf gettext-latest.tar.gz > /dev/null 2> /dev/null
  valid $? "Error: could not uncompress gettext-latest.tar.gz!"

  cd gettext-0.19.8.1 > /dev/null
  valid $? "Error: could not enter gettext-0.19.8.1!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR > /dev/null 2>> ../build.log
  valid $? "Error: could not configure gettext!"

  make -j 4 > /dev/null 2>> ../build.log
  valid $? "Error: could not make gettext"

  make install > /dev/null 2>> ../build.log
  valid $? "Error: Could not install gettext"

  cd .. > /dev/null
fi

#
Carolina Galvão committed
1303 1304 1305 1306 1307 1308 1309 1310
# Finished!
#
clear
echo "****************************************"
echo "* TerraLib Installer for Mac OS Sierra *"
echo "****************************************"
echo ""
echo "finished successfully!"