{% set version = '0.3-4' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/backtest_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/backtest/backtest_{{ version }}.tar.gz
  sha256: 4d09a83430601ccfda4bcfc39b8966fd6c88634f578f4a9cdf5bfc76887015e8

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

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

requirements:
  build:
    - {{ posix }}zip               # [win]

  host:
    - r-base
    - r-lattice

  run:
    - r-base
    - r-lattice

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('backtest')"           # [not win]
    - "\"%R%\" -e \"library('backtest')\""  # [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://CRAN.R-project.org/package=backtest
  license: GPL-2
  summary: The backtest package provides facilities for exploring portfolio-based conjectures
    about financial instruments (stocks, bonds, swaps, options, et cetera).
  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: backtest
# Type: Package
# Title: Exploring Portfolio-Based Conjectures About Financial Instruments
# Version: 0.3-4
# Date: 2015-09-17
# Author: Jeff Enos <jeff@kanecap.com> and David Kane <dave@kanecap.com>, with contributions from Kyle Campbell <kyle.w.campbell@williams.edu>, Daniel Gerlanc <daniel@gerlanc.com>, Aaron Schwartz <Aaron.J.Schwartz@williams.edu>, Daniel Suo <danielsuo@gmail.com>, Alexei Colin <acolin@fas.harvard.edu>, and Luyi Zhao <luyizhao@gmail.com>
# Description: The backtest package provides facilities for exploring portfolio-based conjectures about financial instruments (stocks, bonds, swaps, options, et cetera).
# Maintainer: Daniel Gerlanc <dgerlanc@enplusadvisors.com>
# Depends: R (>= 2.10), methods, grid, lattice
# License: GPL (>= 2)
# LazyLoad: yes
# NeedsCompilation: no
# Packaged: 2015-09-17 13:50:53 UTC; daniel
# Repository: CRAN
# Date/Publication: 2015-09-17 22:50:01

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