# Maintainer: Alec Su <ae40515@yahoo.com.tw>

pkgname=luit
pkgver=20201003
pkgrel=1
pkgdesc="Luit is a filter that can be run between an arbitrary application and a UTF-8 terminal emulator"
arch=('i686' 'x86_64')
url='https://invisible-island.net/luit/luit.html'
license=('MIT')
source=(ftp://ftp.invisible-island.net/luit/luit-${pkgver}.tgz
        luit-20190106-fix-ldflags.patch)
depends=('gcc-libs' 'libiconv' 'zlib')
makedepends=('diffutils' 'gcc' 'libiconv-devel' 'make' 'patch' 'zlib-devel')
sha256sums=('c948da3c8b163e8e8f23cbe1255e7f3fa234c48aaf470b201ce55a3ecb4ad985'
            'b2384d6801841d30830354c0806356be993ff86e9c8f1dfdca80a1de011da981')

prepare() {
    cd "${srcdir}/luit-${pkgver}"
    patch -p0 -i "${srcdir}/luit-20190106-fix-ldflags.patch"
}

build() {
    cd "${srcdir}/luit-${pkgver}"
    ./configure --prefix=/usr 
    make
}

package() {
    cd "${srcdir}/luit-${pkgver}"
    make DESTDIR="${pkgdir}" install

    install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
