distributable:
  url: https://taglib.github.io/releases/taglib-{{version.raw}}.tar.gz
  strip-components: 1

versions:
  github: taglib/taglib

dependencies:
  zlib.net: ^1
  github.com/nemtrif/utfcpp: ^4

build:
  dependencies:
    cmake.org: '*'
    linux:
      gnu.org/gcc: '*'
  script:
    - cmake $CMAKE_ARGS
    - make --jobs {{ hw.concurrency }} install
    - run: sed -i -e "s|prefix=|prefix=\$(dirname \$0)/..|g" -e "s|{{prefix}}|\$(dirname \$0)/..|g" taglib-config
      working-directory: '{{prefix}}/bin'
  env:
    CMAKE_ARGS:
      - -DCMAKE_INSTALL_PREFIX="{{prefix}}
      - -DCMAKE_INSTALL_LIBDIR=lib
      - -DCMAKE_BUILD_TYPE=Release
      - -DCMAKE_FIND_FRAMEWORK=LAST
      - -DCMAKE_VERBOSE_MAKEFILE=ON
      - -Wno-dev
      - -DBUILD_TESTING=OFF
      - -DWITH_MP4=ON
      - -DWITH_ASF=ON
      - -DBUILD_SHARED_LIBS=ON

provides:
  - bin/taglib-config

test:
  script:
    - taglib-config --version | grep {{version.raw}}
    - taglib-config --prefix | grep {{prefix}}
