# Description: SDL graphics drawing primitives and other support functions.
# URL: https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: libsdl

name=sdl_gfx
version=2.0.26
release=2
source=(https://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-$version.tar.gz)

build() {
	cd SDL_gfx-$version

	# shipped configure was not regenerated since 2.0.25, resulting in bad soname
	sed -i -e 's/-O //' configure.in
	mv configure.in configure.ac
	autoreconf -fvi

	./configure --prefix=/usr
	make
	make DESTDIR=$PKG install

	# not sure why this path is wrong, it breaks mjpegtools
	sed \
		-e 's|^#include <SDL.h>|#include <SDL/SDL.h>|' \
		-i $PKG/usr/include/SDL/SDL_gfxPrimitives.h
}
