app=gpsd
version=3.21
build=1sml
homepage="https://gpsd.gitlab.io/gpsd/"
download="http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-3.21.tar.xz"
desc="GPS daemon for serving navigational software"
requires="libusb eudev bluez"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  applypatch $srcdir/gpsd-use-local-timepps-header.patch
  cp $srcdir/timepps.h . 

  CPPFLAGS="-I. -DHAVE_SYS_TIMEPPS_H" 
  scons prefix="/" sbindir="/bin" qt=no systemd=no 
  DESTDIR=$pkg scons install

  mkfinalpkg
}

sha512sums="
f08fe049f83552a7e73023fb8b8cdfbe23928950f7e628fe7ae733ca0a2d662d9f1204e308a1638e5b46e821f8405a6439ee8b1c8720c7c867093f457358f95e  gpsd-3.21.tar.lz
b692c9fc77a9db3fc621693d3b9e3ef9bc2efbbc7b01651168d7b928d29d48a489b8859930bad01b6021e211372e069a726b78dd5938385ed4ae0153b38f4170  gpsd-use-local-timepps-header.patch
eb11fc19243d1789016d88eb7645bfe67c46304547781489bf36eb1dd4c252d523681ff835a6488fa0ef62b6b9e2f781c672279f4439f5d5640a3f214a113048  timepps.h
"
