{% set version = "4.3.0a" %}

package:
  name: libspatialite
  version: {{ version }}

source:
  url: http://archive.ubuntu.com/ubuntu/pool/universe/s/spatialite/spatialite_{{ version }}.orig.tar.gz
  # url: http://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-{{ version }}.tar.gz
  sha256: 88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499
  patches:
    # Skips 3 tests (check_extension, check_sql_stmt, and check_get_normal_zoom_extension_load) that are failing on OS X.
    # Re-visit this once a new release is out.
    - skip_failing_test.patch  # [osx]
    - makefile.vc.patch  # [win]
    - config-msvc.patch  # [win]
    - gg_extras.patch  # [win]
    - proj_api.patch

build:
  number: 23
  # Missing dependencies freexl, proj and geos on s390x.
  skip: true  # [(win and vc<14) or s390x]
  run_exports:
    # No idea.  Staying with minor version pin.
    - {{ pin_subpackage('libspatialite', max_pin='x.x') }}

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - autoconf  # [unix]
    - automake  # [unix]
    - libtool   # [unix]
    - m2-patch    # [win]
    - make  # [not win]
    - patch       # [not win]
    - pkg-config  # [not win]
  host:
    - freexl
    - geos
    - libiconv  # [osx or win]
    - libxml2 2.10
    # This used to be pinned here to <8.0.0.
    - proj
    - sqlite
    - zlib
  run:
    - freexl
    - geos
    - libiconv  # [osx or win]
    - libxml2 >=2.10,<2.11.0a0
    # This used to be pinned here to <8.0.0, but we need to follow the pinning
    # in conda_build_config.yaml.
    - proj
    - sqlite
    - zlib

about:
  home: https://www.gaia-gis.it/fossil/libspatialite/index
  license: LGPL-2.1-or-later
  license_family: LGPL
  license_file: COPYING
  summary: 'Extend the SQLite core to support fully fledged Spatial SQL capabilities'
  desciption: |
    SpatiaLite is an open source library intended to extend the SQLite core to
    support fully fledged Spatial SQL capabilities.
    SQLite is intrinsically simple and lightweight. It implemented as
    a single lightweight library implementing the full SQL engine
    standard SQL implementation: almost complete SQL-92.
    There is no complex client/server architecture.
    A whole database simply corresponds to a single monolithic file (no size limits)
    any DB-file can be safely exchanged across different platforms, because the
    internal architecture is universally portable no installation, no configuration.
  doc_url: https://www.gaia-gis.it/fossil/libspatialite/index
  dev_url: https://www.gaia-gis.it/fossil/libspatialite/dir?type=tree

extra:
  recipe-maintainers:
    - danclewley
    - gillins
    - ocefpaf
