{% set version = "4.9-9" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-matching
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/Matching_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/Matching/Matching_{{ version }}.tar.gz
  sha256: 9c92737348f1e0b23c2d44775989f0a8b84563833c400255eeb702b673439a48

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-mass >=7.2_1
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-mass >=7.2_1

test:
  commands:
    - $R -e "library('Matching')"           # [not win]
    - "\"%R%\" -e \"library('Matching')\""  # [win]

about:
  home: http://sekhon.berkeley.edu/matching
  license: GPL-3.0-only
  summary: Provides functions for multivariate and propensity score matching  and for finding optimal balance based on a genetic search algorithm.  A variety of univariate and multivariate metrics to determine if balance has been obtained are also provided.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr

# Package: Matching
# Version: 4.9-6
# Date: 2019-04-07
# Title: Multivariate and Propensity Score Matching with Balance Optimization
# Author: Jasjeet Singh Sekhon <sekhon@berkeley.edu>
# Maintainer: Jasjeet Singh Sekhon <sekhon@berkeley.edu>
# Description: Provides functions for multivariate and propensity score matching  and for finding optimal balance based on a genetic search algorithm.  A variety of univariate and multivariate metrics to determine if balance has been obtained are also provided.
# Depends: R (>= 2.6.0), MASS (>= 7.2-1), graphics, grDevices, stats
# Suggests: parallel, rgenoud (>= 2.12), rbounds
# License: GPL-3
# URL: http://sekhon.berkeley.edu/matching
# NeedsCompilation: yes
# Packaged: 2019-05-07 21:02:01 UTC; sekhon
# Repository: CRAN
# Date/Publication: 2019-05-07 22:20:29 UTC
