# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: T.J. Townsend <blakkheim@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: graysky <therealgraysky AT protonmail DOT com>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: Army <uli[dot]armbruster[at]gmail[dot]com>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - configure with --without-lto

pkgname=ncmpcpp
pkgver=0.10.1
pkgrel=1
pkgdesc='Featureful ncurses based MPD client inspired by ncmpc'
url='https://github.com/ncmpcpp/ncmpcpp'
arch=('x86_64')
license=('GPL-2.0-only')
depends=('curl' 'libcurl.so' 'libmpdclient' 'libmpdclient.so' 'fftw' 'libfftw3.so' 'boost-libs'
         'libboost_filesystem.so' 'libboost_locale.so' 'libboost_program_options.so'
         'libboost_thread.so' 'icu' 'libicui18n.so' 'libicuuc.so'
         'glibc' 'gcc-libs' 'ncurses' 'libncursesw.so' 'readline' 'libreadline.so' 'taglib')
makedepends=('boost' 'git')
source=(git+https://github.com/ncmpcpp/ncmpcpp.git#tag=${pkgver})
sha512sums=('5d8e1ac3de2398977fc251cc193db2a03b5ba8c39813b293f0d4f539bbe0873810de13a2a7e3037e2821058e361eb981debbc266b8d7fbfb91ef8d8a00bbf2b8')
b2sums=('c70a4d6457fd830da7ee8ccfa284071ea01115b86aff87af82ae3ae87e9bd4e897bb3b3fc62e0cafbf5070f1d1f0bf34c3a9c0bbfdcf80f1eefc4d3c0fc15256')

prepare() {
  cd ${pkgname}
  autoreconf -fiv
  sed -e 's/CXXFLAGS=/CXXFLAGS+=/' \
      -e 's/CPPFLAGS=/CPPFLAGS+=/' \
      -e 's/LDFLAGS=/LDFLAGS+=/' \
      -e 's/-march=native//' \
      -i extras/Makefile
}

build() {
  cd ${pkgname}
  BOOST_LIB_SUFFIX='' ./configure \
    --prefix=/usr \
    --enable-clock \
    --enable-outputs \
    --enable-visualizer \
    --with-fftw \
    --with-taglib \
    --without-lto
  make
  make -C extras
}

package() {
  cd ${pkgname}
  make DESTDIR="${pkgdir}" install
  install -Dm 755 extras/artist_to_albumartist -t "${pkgdir}/usr/bin"
}

# vim: ts=2 sw=2 et: