diff --git a/testing/yara/APKBUILD b/testing/yara/APKBUILD
index 54dbc3ed9795f89a9b2c645fa13074d94ee14de3..b9e955bfb4d0eb16f2d9fb25f36f687006ab641d 100644
--- a/testing/yara/APKBUILD
+++ b/testing/yara/APKBUILD
@@ -2,7 +2,7 @@
 
 pkgname=yara
 pkgver=3.7.0
-pkgrel=0
+pkgrel=1
 pkgdesc="The pattern matching swiss knife for malware researchers"
 url="https://virustotal.github.io/yara/"
 arch="all !armhf"  # armhf: tests fail
@@ -12,6 +12,15 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/VirusTotal/$pkgname/archive/
 subpackages="$pkgname-doc"
 builddir="$srcdir/$pkgname-$pkgver"
 
+prepare() {
+	default_prepare
+	# Delete re_lexer.c to force it to be build with new version
+	# of flex, othwewise tests fail in some arches because of a bug
+	# in older version of flex.
+	# See: https://github.com/VirusTotal/yara/issues/771
+	rm "$srcdir"/yara-3.6.3/libyara/re_lexer.c
+}
+
 build() {
 	cd "$builddir"
 	autoreconf -fiv