# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Federico Cinelli <cinelli@aur.archlinux.org>
# Contributor: Bob Finch <w9ya@arrl.net>

pkgname=shapelib
pkgver=1.6.2
pkgrel=1
pkgdesc='Simple C API for reading and writing ESRI Shapefiles'
arch=('x86_64')
url='http://shapelib.maptools.org/'
license=('LGPL')
depends=('gcc-libs')
source=(https://download.osgeo.org/$pkgname/$pkgname-$pkgver.tar.gz
        https://github.com/OSGeo/shapelib/commit/bf455986.patch)
sha256sums=('4b74a36ced94e9a7bea401157e664addcc5be251e7df7f88d4674361da012c21'
            'bbb06459385e2df8834c3667b2c0541b6d08c52d31bc944453a6ff9988b13616')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../bf455986.patch # Fix build with GCC 15
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="${pkgdir}" install
}
