{% set version = "0.10.0" %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/fixest_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/fixest/fixest_{{ version }}.tar.gz
  sha256: 57a707e1443cec07c71ce5ca80e108aca4f1b6aefde320a7d7a47b1a75d31b81

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

# Suggests: knitr, rmarkdown, data.table, plm, MASS, pander
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - llvm-openmp                  # [osx]
    - libgomp                      # [linux]    
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]

  host:
    - r-base
    - r-rcpp
    - r-dreamerr >=1.2.3
    - r-nlme
    - r-numderiv
    - r-sandwich

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp
    - r-dreamerr >=1.2.3
    - r-nlme
    - r-numderiv
    - r-sandwich

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

about:
  home: https://lrberge.github.io/fixest/, https://github.com/lrberge/fixest

  license: GPL-3.0-only
  summary: Fast and user-friendly estimation of econometric models with multiple fixed-effects. Includes ordinary least squares (OLS), generalized linear models (GLM) and the negative binomial. The core of the package is based on optimized parallel C++ code, scaling especially well for large data sets. The method to obtain
    the fixed-effects coefficients is based on Berge (2018) <https://wwwen.uni.lu/content/download/110162/1299525/file/2018_13>. Further provides tools to export and view the results of several estimations with intuitive design to cluster the standard-errors.

  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  feedstock-name: r-fixest
  recipe-maintainers:
    - conda-forge/r
    - izahn
