# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: mrdotx <klassiker@gmx.de>

pkgname=libptytty
pkgver=2.0
pkgrel=6
pkgdesc='An offspring of rxvt-unicode that handles pty/tty/utmp/wtmp/lastlog handling in mostly OS-independent ways'
arch=(x86_64 aarch64)
url='https://software.schmorp.de/pkg/libptytty.html'
license=(GPL-2.0-or-later)
depends=(glibc libgcc)
makedepends=(cmake)
source=("$pkgname-$pkgver.tar.gz::https://dist.schmorp.de/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('9cca5fddbcc4025c2bbe043e3367ac902d0024a34301258dafcf0de70935c055279d88227168d112d0e4c0dc37f1f49e1ea587bd6bddf0b9d92400657bc7be08')
b2sums=('81112267157c1ba785052b2e1667c4af251991816005375d44efd1c4d9c58cc5e59324df35e556d45e46df6bceccc654d71e6c264dae5a15ea100cc9db63c5a6')

build() {
  local cmake_options=(
    -B build
    -S "$pkgname-$pkgver"
    -W no-dev
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D BUILD_SHARED_LIBS=ON
  )

  cmake "${cmake_options[@]}"

  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
