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

pkgname=luit
pkgver=20250912
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=('spdx:MIT')
source=(https://invisible-mirror.net/archives/${pkgname}/${pkgname}-${pkgver}.tgz{,.asc}
        luit-20190106-fix-ldflags.patch)
depends=('gcc-libs' 'libiconv' 'zlib')
makedepends=('gcc' 'libiconv-devel' 'patch' 'zlib-devel' 'autotools')
sha256sums=('46958060e66f35bcb8a51ba22da1c13d726d28a86c1cf520511bcf7914bef39e'
            'SKIP'
            'b2384d6801841d30830354c0806356be993ff86e9c8f1dfdca80a1de011da981')
validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB'
              '19882D92DDA4C400C22C0D56CC2AF4472167BE03') # "Thomas Dickey <dickey@invisible-island.net>"


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"
}
