-TERMUX_PKG_SRCURL=http://www.leptonica.com/source/leptonica-${TERMUX_PKG_VERSION}.tar.gz
-TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-giflib --without-libwebp CPPFLAGS=-I/data/data/com.termux/files/usr/include"
+TERMUX_PKG_SRCURL=https://github.com/DanBloomberg/leptonica/archive/${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_SHA256=2092e126652ff07bc2569971a1d6c6411e1d481539d39c98031534c6f83dfc82
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-giflib --without-libwebp --without-libopenjpeg"
+
+termux_step_pre_configure() {
+ ./autobuild
+}