{% set version = '0.24.3' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/TTR_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/TTR/TTR_{{ version }}.tar.gz
  sha256: 4d9aef32647664be5cf965b05f21ed62cde9425fa87c21530852e05ef7aaba87

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: RUnit
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base
    - r-curl
    - r-xts >=0.10_0
    - r-zoo

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-curl
    - r-xts >=0.10_0
    - r-zoo

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('TTR')"           # [not win]
    - "\"%R%\" -e \"library('TTR')\""  # [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/joshuaulrich/TTR
  license: GPL-2
  summary: A collection of over 50 technical indicators for creating technical trading rules.
    The package also provides fast implementations of common rolling-window functions,
    and several volatility calculations.
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: TTR
# Type: Package
# Title: Technical Trading Rules
# Version: 0.24.3
# Author: Joshua Ulrich
# Maintainer: Joshua Ulrich <josh.m.ulrich@gmail.com>
# Imports: xts (>= 0.10-0), zoo, curl
# LinkingTo: xts
# Enhances: quantmod
# Suggests: RUnit
# Description: A collection of over 50 technical indicators for creating technical trading rules. The package also provides fast implementations of common rolling-window functions, and several volatility calculations.
# License: GPL (>= 2)
# URL: https://github.com/joshuaulrich/TTR
# BugReports: https://github.com/joshuaulrich/TTR/issues
# NeedsCompilation: yes
# Packaged: 2021-12-11 21:35:52 UTC; root
# Repository: CRAN
# Date/Publication: 2021-12-12 05:30:02 UTC

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