distributable:
  url: https://ftp.gnu.org/gnu/patch/patch-{{version}}.tar.gz
  strip-components: 1

versions:
  url: https://ftp.gnu.org/gnu/patch/
  match: /patch-(\d+\.\d+(\.\d+)?)\.tar\.gz/
  strip:
    - /patch-/
    - /.tar.gz/

provides:
  - bin/patch

build:
  script: |
    ./configure --prefix={{prefix}}
    make --jobs {{ hw.concurrency }} install

test:
  script: |
    echo hello > file
    cat $FIXTURE | patch ./file
    test "$(cat file)" = goodbye
  fixture: |
    1c1
    < hello
    ---
    > goodbye
