From 9194c5e28d9ad287c609356b052335e02e1b5971 Mon Sep 17 00:00:00 2001 From: Matthias von Faber Date: Sat, 19 Aug 2017 17:40:38 +0200 Subject: [PATCH] New package: zinnia-0.06 --- common/shlibs | 1 + srcpkgs/libzinnia | 1 + srcpkgs/libzinnia-devel | 1 + ...mpile-error-of-std-make_pair-in-C-11.patch | 39 +++++++++++++++++ .../patches/minimum-distance-precision.patch | 12 ++++++ srcpkgs/zinnia/template | 42 +++++++++++++++++++ 6 files changed, 96 insertions(+) create mode 120000 srcpkgs/libzinnia create mode 120000 srcpkgs/libzinnia-devel create mode 100644 srcpkgs/zinnia/patches/Fix-compile-error-of-std-make_pair-in-C-11.patch create mode 100644 srcpkgs/zinnia/patches/minimum-distance-precision.patch create mode 100644 srcpkgs/zinnia/template diff --git a/common/shlibs b/common/shlibs index d8ec477b17..eb90c56ec8 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2895,3 +2895,4 @@ liblsmash.so.2 liblsmash-2.9.1_1 libgnustep-base.so.1.25 gnustep-base-1.25.0_1 libtermbox.so.1 termbox-1.1.0_1 libmysofa.so.0 libmysofa-0.6_1 +libzinnia.so.0 libzinnia-0.06_1 diff --git a/srcpkgs/libzinnia b/srcpkgs/libzinnia new file mode 120000 index 0000000000..34013b988e --- /dev/null +++ b/srcpkgs/libzinnia @@ -0,0 +1 @@ +zinnia \ No newline at end of file diff --git a/srcpkgs/libzinnia-devel b/srcpkgs/libzinnia-devel new file mode 120000 index 0000000000..34013b988e --- /dev/null +++ b/srcpkgs/libzinnia-devel @@ -0,0 +1 @@ +zinnia \ No newline at end of file diff --git a/srcpkgs/zinnia/patches/Fix-compile-error-of-std-make_pair-in-C-11.patch b/srcpkgs/zinnia/patches/Fix-compile-error-of-std-make_pair-in-C-11.patch new file mode 100644 index 0000000000..f9dccb82b5 --- /dev/null +++ b/srcpkgs/zinnia/patches/Fix-compile-error-of-std-make_pair-in-C-11.patch @@ -0,0 +1,39 @@ +From b49a0187e74ff619f28fb20e2b5ecfec1d437d6f Mon Sep 17 00:00:00 2001 +From: Yohei Yukawa +Date: Sat, 5 Sep 2015 02:06:05 -0700 +Subject: [PATCH] Fix compile error of std::make_pair in C++11 + +std::make_pair is not designed to be used with explicit type +parameters. In practice doing that can result in compile error +with Clang 3.4 on Ubuntu 14.04 when C++11 is enabled. + +This CL removes explicit type parameters so that Zinnia can be +built even if C++11 is enabled. +--- + AUTHORS | 1 + + trainer.cpp | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/AUTHORS b/AUTHORS +index a44e82c..fa52d6a 100644 +--- AUTHORS ++++ AUTHORS +@@ -1 +1,2 @@ + Taku Kudo ++Google Inc. <*@google.com> +diff --git a/trainer.cpp b/trainer.cpp +index a889bc7..84230b0 100644 +--- trainer.cpp ++++ trainer.cpp +@@ -104,7 +104,7 @@ class TrainerImpl: public Trainer { + if (!fn) { + return false; + } +- x_.push_back(std::make_pair(y, fn)); ++ x_.push_back(std::make_pair(y, fn)); + return true; + } + +-- +2.14.1 + diff --git a/srcpkgs/zinnia/patches/minimum-distance-precision.patch b/srcpkgs/zinnia/patches/minimum-distance-precision.patch new file mode 100644 index 0000000000..6f9739e235 --- /dev/null +++ b/srcpkgs/zinnia/patches/minimum-distance-precision.patch @@ -0,0 +1,12 @@ +--- feature.cpp ++++ feature.cpp +@@ -42,7 +42,8 @@ float minimum_distance(const Node *first, const Node *last, + + const float a = last->x - first->x; + const float b = last->y - first->y; +- const float c = last->y * first->x - last->x * first->y; ++ const float c = static_cast(last->y * first->x) ++ - static_cast(last->x * first->y); + + float max = -1.0; + for (const Node *n = first; n != last; ++n) { diff --git a/srcpkgs/zinnia/template b/srcpkgs/zinnia/template new file mode 100644 index 0000000000..88e7770813 --- /dev/null +++ b/srcpkgs/zinnia/template @@ -0,0 +1,42 @@ +# Template file for 'zinnia' +pkgname=zinnia +version=0.06 +revision=1 +short_desc="OCR system for hand-written input" +maintainer="Matthias von Faber " +homepage="http://taku910.github.io/zinnia/" +license="2-clause-BSD" +build_style=gnu-configure +hostmakedepends="libtool pkg-config" +makedepends="libtool pkg-config" +distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}/${version}/${pkgname}-${version}.tar.gz" +checksum=ece3af93f937282971634fd81d3e997f848e8cfa958220e26a4564ca064ac20b + +post_install() { + vlicense COPYING +} + +libzinnia_package() { + short_desc+=" - runtime library" + pkg_install() { + vmove "usr/lib/*.so.*" + } +} + +pre_build() { + # Force flags from environment + sed -i -e 's|^CFLAGS\b|#CFLAGS|' \ + -e 's|^CXXFLAGS\b|#CXXFLAGS|' \ + -e 's|^LDFLAGS\b|#LDFLAGS|' Makefile +} + +libzinnia-devel_package() { + depends="lib${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + } +}