distributable:
  url: https://gmplib.org/download/gmp/gmp-{{ version }}.tar.bz2
  strip-components: 1

versions:
  url: https://gmplib.org/download/gmp
  match: /gmp-(\d+\.\d+\.\d+)\.tar\.bz2/
  strip:
    - /gmp-/
    - /.tar.bz2/

#TODO make by default runs test
# disable that
# but we should have a `build.test` node that runs it after build

build:
  dependencies:
    gnu.org/m4: 1
  script: |-
    ./configure \
      --enable-cxx \
      --with-pic \
      --build={{ hw.target }} \
      --prefix="{{ prefix }}"
    make --jobs {{ hw.concurrency }}
    make --jobs {{ hw.concurrency }} check
    make --jobs {{ hw.concurrency }} install

test:
  script: |
    cc test.c {{ prefix }}/lib/libgmp.a
    ./a.out
