pkgname=lcms
pkgver=2.17
pkgdesc='Small-footprint color management engine, version 2'
arch=('x86_64')
homepage='http://www.littlecms.com/'
license=('MIT')
depends=('libtiff')
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/mm2/Little-CMS/releases/download/lcms${pkgver}/${sources[0]/lcms/lcms2}")
md5sums=("9f44275ee8ac122817e94fdc50ecce13")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    -D default_library=shared
    -D threaded=true
    -D fastfloat=true
    -D jpeg=enabled
    -D tiff=enabled
    -D tests=disabled
    -D utils=true
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

src_install() {
  meson install -C build --destdir "$pkgdir"
  install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:ft=sh syn=sh et sw=2:
