{% set version = "3.12.0" %}

package:
  name: qgis
  version: {{ version }}

source:
  url: https://qgis.org/downloads/qgis-{{ version }}.tar.bz2
  sha256: 19e9c185dfe88cad7ee6e0dcf5ab7b0bbfe1672307868a53bf771e0c8f9d5e9c
  patches:
    # QGIS inserts Qt plugin locations into PATH relative to build location
    # This patch fixes it so PATH is relative to install location
    - patches/0001-linux-fix-plugins-path.patch  # [linux]
    # by default looks for pyrcc5.bat on Windows, but we have pyrcc5.exe
    - patches/0002-CMake-PyQtMacros.patch  # [win]
    # gets the wrong geos lib
    - patches/0003-CMake-GEOS.patch  # [win]
    # don't try and install MSVC runtime libs as they already exist
    - patches/0004-CMakeLists-nosyslibs.patch  # [win]
    # QGIS needs to #include <functional> for GCC7 & VC14, at least
    - patches/0005-include-functional.patch
    # Need to set "H5_BUILT_AS_DYNAMIC_LIB" to use the shared libs on Windows
    # https://trac.osgeo.org/gdal/wiki/HDF#BuildingonWindowswithMSVC
    - patches/0006-CMakeLists-providers-MDAL-HDF5.patch  # [win]

build:
  number: 0
  skip: true  # [py2k]

requirements:
  build:
    - cmake
    - ninja
    - m2-flex  # [win]
    - m2-bison  # [win]
    - m2-m4  # [win]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    # The CDT packages below are those used in qt-feedstock
    - {{ cdt('mesa-libgl-devel') }}  # [linux]
    - {{ cdt('mesa-dri-drivers') }}  # [linux]
    - {{ cdt('libselinux') }}  # [linux]
    - {{ cdt('libxdamage') }}  # [linux]
    - {{ cdt('libxfixes') }}  # [linux]
    - {{ cdt('libxxf86vm') }}  # [linux]
    - {{ cdt('libxcb') }}  # [linux]
    - {{ cdt('libxext') }}  # [linux]
    - {{ cdt('xorg-x11-server-xvfb') }}  # [linux]
    - {{ cdt('libxau') }}  # [linux]
  host:
    - python
    - six
    - flex  # [unix]
    - bison  # [unix]
    - m4  # [unix]
    - pkgconfig
    - sip
    - expat
    - icu
    - libzip
    - libtasn1  # [osx]
    - exiv2
    # Qt stack.
    - qt
    - pyqt
    - qscintilla2
    - qca
    - qjson
    - qwt
    - qwtpolar
    - qtkeychain
    - qtlocation
    # included in win-64 Qt already but needed for linux/osx
    - qtserialport  # [unix]
    # GDAL stack.
    - gdal
    - geos
    - proj
    # GSL for georeferencer.
    - gsl
    - sqlite
    - libspatialindex
    - libspatialite
    # For PostgreSQL support.
    - postgresql
    - psycopg2
    # XOrg CDT packages used in qt-feedstock
    - xorg-libice      # [linux]
    - xorg-libsm       # [linux]
    - xorg-libx11      # [linux]
    - xorg-libxext     # [linux]
    - xorg-libxrender  # [linux]
    - xorg-libxt       # [linux]
    - xorg-inputproto  # [linux]
    - gtk2  # [linux]
  run:
    - python
    - icu
    - libzip
    - libtasn1  # [osx]
    - qt
    - pyqt
    - qscintilla2
    - qca
    - qjson
    - qwt
    - qwtpolar
    - qtkeychain
    - qtlocation
    - qtserialport  # [unix]
    - gdal
    - geos
    - proj
    - gsl
    - sqlite
    - libspatialindex
    - libspatialite
    - psycopg2
    - postgresql
    - exiv2
    # Runtime Python library deps
    - python-dateutil
    - future
    - httplib2
    - jinja2
    - markupsafe
    - mock
    - nose2
    - owslib
    - plotly
    - pygments
    - pyproj
    - requests
    - six
    - sip
    - pytz
    - pyyaml
    - yaml
    - owslib
    # XOrg CDT packages used in qt-feedstock
    - xorg-libice      # [linux]
    - xorg-libsm       # [linux]
    - xorg-libx11      # [linux]
    - xorg-libxext     # [linux]
    - xorg-libxrender  # [linux]
    - xorg-libxt       # [linux]
    - xorg-inputproto  # [linux]
    - gtk2  # [linux]

test:
  files:
    - test_data
    - test_py_qgis.py
  commands:
    - {{ RECIPE_DIR }}/run_test.bat  # [win]
    - bash {{ RECIPE_DIR }}/run_test.sh  # [not win]

about:
  home: http://qgis.org/
  license: GPL-2.0
  license_file: COPYING
  summary: 'A free and open source Geographic Information System (GIS).'
  description: |
    QGIS is a user friendly Open Source Geographic Information System (GIS)
    licensed under the GNU General Public License. QGIS is an official
    project of the Open Source Geospatial Foundation (OSGeo). It runs on
    Linux, Unix, Mac OSX, Windows and Android and supports numerous vector,
    raster, and database formats and functionalities.
  doc_url: https://www.qgis.org/en/docs/index.html
  dev_url: https://github.com/qgis/QGIS

extra:
  recipe-maintainers:
    - ceholden
    - ocefpaf
    - kmuehlbauer
    - SrNetoChan
    - gillins
