{% set version = '1.9.0' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/TMB_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/TMB/TMB_{{ version }}.tar.gz
  sha256: 2c9dd281d911c2cb1cc01c6a8e114826891280f15e0ed4a00b4f195e15df25d7

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: numDeriv, parallel
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]

  host:
    - r-base
    - r-matrix >=1.0_12
    - r-rcppeigen

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-matrix >=1.0_12
    - r-rcppeigen

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('TMB')"           # [not win]
    - "\"%R%\" -e \"library('TMB')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://github.com/kaskr/adcomp/wiki
  license: GPL-2
  summary: 'With this tool, a user should be able to quickly implement complex random effect
    models through simple C++ templates. The package combines ''CppAD'' (C++ automatic
    differentiation), ''Eigen'' (templated matrix-vector library) and ''CHOLMOD'' (sparse
    matrix routines available from R) to obtain an efficient implementation of the applied
    Laplace approximation with exact derivatives. Key features are: Automatic sparseness
    detection, parallelism through ''BLAS'' and parallel user templates.'
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - katietz

# The original CRAN metadata for this package was:

# Package: TMB
# Type: Package
# Title: Template Model Builder: A General Random Effect Tool Inspired by 'ADMB'
# Version: 1.9.0
# Date: 2022-05-26
# Authors@R: c(person("Kasper","Kristensen",role=c("aut","cre","cph"),email="kaskr@dtu.dk"), person("Brad","Bell",role="cph"), person("Hans","Skaug",role="ctb"), person("Arni","Magnusson",role="ctb"), person("Casper","Berg",role="ctb"), person("Anders","Nielsen",role="ctb"), person("Martin","Maechler",role="ctb"), person("Theo","Michelot",role="ctb"), person("Mollie","Brooks",role="ctb"), person("Alex","Forrence",role="ctb"), person("Christoffer","Moesgaard Albertsen",role="ctb"), person("Cole","Monnahan",role="ctb") )
# Maintainer: Kasper Kristensen <kaskr@dtu.dk>
# Author: Kasper Kristensen [aut, cre, cph], Brad Bell [cph], Hans Skaug [ctb], Arni Magnusson [ctb], Casper Berg [ctb], Anders Nielsen [ctb], Martin Maechler [ctb], Theo Michelot [ctb], Mollie Brooks [ctb], Alex Forrence [ctb], Christoffer Moesgaard Albertsen [ctb], Cole Monnahan [ctb]
# Copyright: See the file COPYRIGHTS
# Description: With this tool, a user should be able to quickly implement complex random effect models through simple C++ templates. The package combines 'CppAD' (C++ automatic differentiation), 'Eigen' (templated matrix-vector library) and 'CHOLMOD' (sparse matrix routines available from R) to obtain an efficient implementation of the applied Laplace approximation with exact derivatives. Key features are: Automatic sparseness detection, parallelism through 'BLAS' and parallel user templates.
# License: GPL-2
# URL: https://github.com/kaskr/adcomp/wiki
# BugReports: https://github.com/kaskr/adcomp/issues
# Depends: R (>= 3.0.0)
# Imports: graphics, methods, stats, utils, Matrix (>= 1.0-12)
# LinkingTo: Matrix, RcppEigen
# Suggests: numDeriv, parallel
# RoxygenNote: 6.0.1
# NeedsCompilation: yes
# Packaged: 2022-05-26 15:44:01 UTC; kaskr
# Repository: CRAN
# Date/Publication: 2022-05-27 12:40:16 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
