--- /dev/null
+# Maintainer: Andrea Zagli <andrea.zagli.free@gmail.com>
+
+_realname=gimagereader
+pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
+pkgver=3.1
+pkgrel=1
+arch=('any')
+pkgdesc="A simple Gtk/Qt front-end to tesseract-ocr (mingw-w64)"
+license=("LGPL 2")
+url="https://github.com/manisandro/gImageReader"
+depends=("${MINGW_PACKAGE_PREFIX}-gtk3mm"
+ "${MINGW_PACKAGE_PREFIX}-libxslt")
+makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
+ "${MINGW_PACKAGE_PREFIX}-gcc"
+ "${MINGW_PACKAGE_PREFIX}-gobject-introspection"
+ "${MINGW_PACKAGE_PREFIX}-pkg-config"
+ "gettext")
+options=('strip' '!debug' 'staticlibs')
+source=("${_realname}-${pkgver}.tar.bz2"::https://bitbucket.org/rw_grim/${_realname}/get/v$pkgver.tar.bz2
+ 001-win.patch)
+sha256sums=('fe0d6e450ff9f63e866bf75344cb561985dccae1e89e4162c20d07d961b71fc9'
+ '583b969c8d67fd303cf219e5a6f475be8f4f535711324966efc57479fe031153')
+
+prepare() {
+ cd rw_grim-gplugin-9f4dea11d6eb
+
+ patch -p1 -i ${srcdir}/001-win.patch
+}
+
+build() {
+ [[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST}
+ mkdir -p build-${MINGW_CHOST}
+ cd build-${MINGW_CHOST}
+
+ ${MINGW_PREFIX}/bin/cmake \
+ -DCMAKE_INSTALL_PREFIX=${pkgdir}${MINGW_PREFIX} \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
+ -DCMAKE_C_FLAGS="${CFLAGS}" \
+ -DBUILD_GJS="Off" \
+ -DBUILD_LUA="Off" \
+ -DBUILD_PYTHON="Off" \
+ -DBUILD_SEED="Off" \
+ -DTESTING_ENABLED="Off" \
+ -G "MSYS Makefiles" \
+ ../rw_grim-gplugin-9f4dea11d6eb
+
+ make
+}
+
+package() {
+ cd "$srcdir/build-${MINGW_CHOST}"
+ make install
+
+ install -Dm644 "${srcdir}/rw_grim-gplugin-9f4dea11d6eb/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
+
+ mv "$pkgdir${MINGW_PREFIX}/lib/libgplugin.dll" "$pkgdir${MINGW_PREFIX}/bin"
+ mv "$pkgdir${MINGW_PREFIX}/lib/libgplugin-gtk.dll" "$pkgdir${MINGW_PREFIX}/bin"
+
+ local MINGW_PREFIX_W=$(cygpath -m "${pkgdir}${MINGW_PREFIX}")
+ sed -e "s#${MINGW_PREFIX_W}#${MINGW_PREFIX}#g" \
+ -i "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/gplugin.pc \
+ -i "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/gplugin-gtk.pc
+}