{% set version = '1.2.0' %}

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

{% set cran_mirror = 'https://cran.r-project.org' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/askpass_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/askpass/askpass_{{ version }}.tar.gz
  sha256: b922369781934d0ffc8d0c0177e8ace56796c2e6a726f65e460c16f792592cef

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: testthat
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-sys >=2.1

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-sys >=2.1

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('askpass')"           # [not win]
    - "\"%R%\" -e \"library('askpass')\""  # [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/r-lib/askpass
  license: MIT
  summary: 'Cross-platform utilities for prompting the user for credentials or a passphrase,
    for example to authenticate with a server or read a protected key. Includes native
    programs for MacOS and Windows, hence no ''tcltk'' is required. Password entry can
    be invoked in two different ways: directly from R via the askpass() function, or
    indirectly as password-entry back-end for ''ssh-agent'' or ''git-credential'' via
    the SSH_ASKPASS and GIT_ASKPASS environment variables. Thereby the user can be prompted
    for credentials or a passphrase if needed when R calls out to git or ssh.'
  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

extra:
  recipe-maintainers:
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: askpass
# Type: Package
# Title: Password Entry Utilities for R, Git, and SSH
# Version: 1.2.0
# Authors@R: person("Jeroen", "Ooms", role = c("aut", "cre"), email = "jeroen@berkeley.edu", comment = c(ORCID = "0000-0002-4035-0289"))
# Description: Cross-platform utilities for prompting the user for credentials or a passphrase, for example to authenticate with a server or read a protected key. Includes native programs for MacOS and Windows, hence no 'tcltk' is required. Password entry can be invoked in two different ways: directly from R via the askpass() function, or indirectly as password-entry back-end for 'ssh-agent' or 'git-credential' via the SSH_ASKPASS and GIT_ASKPASS environment variables. Thereby the user can be prompted for credentials or a passphrase if needed when R calls out to git or ssh.
# License: MIT + file LICENSE
# URL: https://github.com/r-lib/askpass
# BugReports: https://github.com/r-lib/askpass/issues
# Encoding: UTF-8
# Imports: sys (>= 2.1)
# RoxygenNote: 7.2.3
# Suggests: testthat
# Language: en-US
# NeedsCompilation: yes
# Packaged: 2023-09-03 19:16:12 UTC; jeroen
# Author: Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>)
# Maintainer: Jeroen Ooms <jeroen@berkeley.edu>
# Repository: CRAN
# Date/Publication: 2023-09-03 20:00:02 UTC

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