pkgname=fish
pkgver=3.3.1
pkgrel=1
epoch=
pkgdesc="a smart and user-friendly command line shell"
arch=('i686' 'x86_64')
url="https://fishshell.com/"
license=('GPL2')
groups=()
depends=('bc' 'gcc-libs' 'gettext' 'libiconv' 'libpcre2_16' 'man-db' 'ncurses')
makedepends=('doxygen' 'gcc' 'gettext-devel' 'intltool' 'libiconv-devel' 'ncurses-devel' 'pcre2-devel' 'cmake')
optdepends=('python: for manual page completion parser and web configuration tool')
install=fish.install
backup=('etc/fish/config.fish' 'etc/fish/msys2.fish' 'etc/fish/perlbin.fish')
source=("https://github.com/fish-shell/fish-shell/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz"{,.asc}
        config.fish
        msys2.fish
        msystem.fish
        perlbin.fish)
        
sha512sums=('fc50ca44fab3f2d942284d4f714150f7ccf1e49c73da36f8d4ae4a33a9b3280f98bed15848839f5d443b4274fd0ff90174bafa6a8e9a4da226dda63d7766a660'
'1757ef4c93b302fe86f669d3549884d9e6f265b45be1945ec1c7551d2d0489b5f51dfe5c288f5b415f905f0ad1d9d0d1d304f08682459b171ac72a293651cc8a'
'817195e2a6cdec1791b96666ee95f87f76569048268645a947f9283f711906fd3f2f5f1a4908b2b1edc0b9742215e0ac1c1cdaf10f9ec50d38b115fc05ae44b7'
'81d0a0b436a5a9dd2973e0de932833605c9f3fc57cc71ba32a15856e29b5192fa8ab450bb17d6f53636c8724327901a2d8ecd72fecb4afe120c258dcc581129d'
'13c512b5ea02bab2b81a502b0285c4c8b9654a45534138c71f079035d6cb90e39d960404ac111eb287ae7391ee6388ac3d97ed943961c8380066a9b2856ea307'
'a675062ebaf7da53845ba3a005d9f4b90c514c7eea2ead0f16592246925a00862afe7fd7326a86006f8d6077e02c3c37a87358105d4bb661001161bfd1788724'
)

validpgpkeys=('003837986104878835FA516D7A67D962D88A709A') # David Adam <zanchey@gmail.com>

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  cmake \
    -B build \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_SYSCONFDIR=/etc \
    -DCMAKE_BUILD_TYPE=None \
    -Wno-dev
  make -C build VERBOSE=1
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}/build"
  rm -rf "${srcdir}/${pkgname}-${pkgver}/build/user_doc"
  make DESTDIR="${pkgdir}" install
  install -D -m644 "${srcdir}/config.fish" "${pkgdir}/etc/fish/config.fish"
  install -D -m644 "${srcdir}/msys2.fish" "${pkgdir}/etc/fish/msys2.fish"
  install -D -m644 "${srcdir}/msystem.fish" "${pkgdir}/etc/fish/msystem.fish"
  install -D -m644 "${srcdir}/perlbin.fish" "${pkgdir}/etc/fish/perlbin.fish"
}
