summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gentoo.org>2017-09-06 00:57:12 +0300
committerAndrew Savchenko <bircoph@gentoo.org>2017-09-06 00:57:12 +0300
commite2a368ee1cd093904bcfed550fc92bf2b388e5b1 (patch)
tree6e2e466c011144ba26329ac0bba11af2170b95d5
parentapp-text/cuneiform: test fix for bug 595010 (diff)
downloadbircoph-e2a368ee1cd093904bcfed550fc92bf2b388e5b1.zip
bircoph-e2a368ee1cd093904bcfed550fc92bf2b388e5b1.tar.gz
bircoph-e2a368ee1cd093904bcfed550fc92bf2b388e5b1.tar.bz2
app-text/cuneiform: wip
- fix several build issues with gcc-6 - fix manual for {image,graphics}magick flipping
-rw-r--r--app-text/cuneiform/cuneiform-1.1.0-r2.ebuild14
-rw-r--r--app-text/cuneiform/files/abs-types_cast.patch (renamed from app-text/cuneiform/files/gcc6-abs.patch)5
-rw-r--r--app-text/cuneiform/files/charset-signedness.patch90
-rw-r--r--app-text/cuneiform/files/minmax.patch59
4 files changed, 163 insertions, 5 deletions
diff --git a/app-text/cuneiform/cuneiform-1.1.0-r2.ebuild b/app-text/cuneiform/cuneiform-1.1.0-r2.ebuild
index 3c2e1f9..faed1b8 100644
--- a/app-text/cuneiform/cuneiform-1.1.0-r2.ebuild
+++ b/app-text/cuneiform/cuneiform-1.1.0-r2.ebuild
@@ -29,11 +29,19 @@ DOCS=( readme.txt )
PATCHES=(
"${FILESDIR}/c-assert.diff"
"${FILESDIR}/libm.diff"
- "${FILESDIR}/gcc6-abs.patch"
+ "${FILESDIR}/abs-types_cast.patch"
+ "${FILESDIR}/charset-signedness.patch"
+ "${FILESDIR}/minmax.patch"
)
src_prepare(){
- use graphicsmagick && PATCHES+=( "${FILESDIR}/graphicsmagick.diff" )
+ if use graphicsmagick; then
+ PATCHES+=( "${FILESDIR}/graphicsmagick.diff" )
+ else
+ sed -e 's/GraphicsMagick/ImageMagick/g' \
+ -e 's/fBgm/fBImageMagick/g' \
+ "${FILESDIR}/${PN}.1" > "${PN}.1" || die
+ fi
cmake-utils_src_prepare
# respect LDFLAGS
@@ -50,5 +58,5 @@ src_prepare(){
src_install() {
cmake-utils_src_install
- doman "${FILESDIR}/${PN}.1"
+ doman "${PN}.1"
}
diff --git a/app-text/cuneiform/files/gcc6-abs.patch b/app-text/cuneiform/files/abs-types_cast.patch
index f472a12..578553e 100644
--- a/app-text/cuneiform/files/gcc6-abs.patch
+++ b/app-text/cuneiform/files/abs-types_cast.patch
@@ -1,3 +1,4 @@
+std::abs() overload is not happy with int32_t
--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rimage/sources/main/cricontrol.cpp.orig 2011-04-19 16:49:57.000000000 +0400
+++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rimage/sources/main/cricontrol.cpp 2017-09-05 12:55:11.908311163 +0300
@@ -594,8 +594,8 @@
@@ -6,8 +7,8 @@
- wNewHeight = (mbMarginsFlag ? abs(mrMargins.rmBottomMarg - mrMargins.rmTopMarg) : mpSourceDIB->GetLinesNumber());
- wNewWidth = (mbMarginsFlag ? abs(mrMargins.rmLeftMarg - mrMargins.rmRightMarg) : mpSourceDIB->GetLineWidth());
-+ wNewHeight = (mbMarginsFlag ? std::abs(mrMargins.rmBottomMarg - mrMargins.rmTopMarg) : mpSourceDIB->GetLinesNumber());
-+ wNewWidth = (mbMarginsFlag ? std::abs(mrMargins.rmLeftMarg - mrMargins.rmRightMarg) : mpSourceDIB->GetLineWidth());
++ wNewHeight = (mbMarginsFlag ? abs(static_cast<int>(mrMargins.rmBottomMarg - mrMargins.rmTopMarg)) : mpSourceDIB->GetLinesNumber());
++ wNewWidth = (mbMarginsFlag ? abs(static_cast<int>(mrMargins.rmLeftMarg - mrMargins.rmRightMarg)) : mpSourceDIB->GetLineWidth());
mpSourceDIB->GetResolutionDPM( &wXResolution, &wYResolution);
if ( !mpDestinationDIB->CreateDIBBegin( wNewWidth, wNewHeight, BitCount) )
diff --git a/app-text/cuneiform/files/charset-signedness.patch b/app-text/cuneiform/files/charset-signedness.patch
new file mode 100644
index 0000000..983af11
--- /dev/null
+++ b/app-text/cuneiform/files/charset-signedness.patch
@@ -0,0 +1,90 @@
+char may be signed on unsigned depending on arch and compiler,
+since upper table needs to be set for cp12* charsets, we need
+unsigned char unconditionally
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/include/utf8-tables.h.orig 2011-04-19 16:49:57.000000000 +0400
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/include/utf8-tables.h 2017-09-05 16:53:26.627848057 +0300
+@@ -68,7 +68,7 @@
+ #endif
+
+
+-const char win1250_to_utf8[][4] = {
++const unsigned char win1250_to_utf8[][4] = {
+ {0, 0, 0, 0},
+ {1, 0, 0, 0},
+ {2, 0, 0, 0},
+@@ -328,7 +328,7 @@
+ };
+
+
+-const char win1251_to_utf8[][4] = {
++const unsigned char win1251_to_utf8[][4] = {
+ {0, 0, 0, 0},
+ {1, 0, 0, 0},
+ {2, 0, 0, 0},
+@@ -587,7 +587,7 @@
+ {209, 143, 0, 0},
+ };
+
+-const char win1252_to_utf8[][4] = {
++const unsigned char win1252_to_utf8[][4] = {
+ {0, 0, 0, 0},
+ {1, 0, 0, 0},
+ {2, 0, 0, 0},
+@@ -847,7 +847,7 @@
+ };
+
+
+-const char win1254_to_utf8[][4] = {
++const unsigned char win1254_to_utf8[][4] = {
+ {0, 0, 0, 0},
+ {1, 0, 0, 0},
+ {2, 0, 0, 0},
+@@ -1107,7 +1107,7 @@
+ };
+
+
+-const char win1257_to_utf8[][4] = {
++const unsigned char win1257_to_utf8[][4] = {
+ {0, 0, 0, 0},
+ {1, 0, 0, 0},
+ {2, 0, 0, 0},
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/codetables.cpp.orig 2017-09-05 17:49:05.000000000 +0300
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/codetables.cpp 2017-09-05 17:49:38.263100712 +0300
+@@ -937,13 +937,13 @@
+ * codepage.
+ */
+
+-const char * getUTF8Str(const unsigned char in, const int codepage) {
++const unsigned char * getUTF8Str(const unsigned char in, const int codepage) {
+ switch(codepage) {
+ case 1250 : return win1250_to_utf8[in];
+ case 1251 : return win1251_to_utf8[in];
+ case 1252 : return win1252_to_utf8[in];
+ case 1254 : return win1254_to_utf8[in];
+ case 1257 : return win1257_to_utf8[in];
+- default : return "?";
++ default : return reinterpret_cast<const unsigned char*>("?");
+ }
+ }
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/rout_own.h.orig 2011-04-19 16:49:57.000000000 +0400
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/rout_own.h 2017-09-05 17:22:32.078758198 +0300
+@@ -458,7 +458,7 @@
+ void ResetCodeTables();
+ Bool UpdateActiveCodeTable();
+ long GetCodePage();
+-const char * getUTF8Str(const unsigned char in, const int codepage);
++const unsigned char * getUTF8Str(const unsigned char in, const int codepage);
+
+ //*****************************************************************
+ // Rout.cpp
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/text.cpp.orig 2011-04-19 16:49:57.000000000 +0400
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rout/src/text.cpp 2017-09-05 17:23:01.388753649 +0300
+@@ -310,7 +310,7 @@
+ *gMemCur++ = c2;
+ }
+ else {
+- const char *utfchar;
++ const unsigned char *utfchar;
+ utfchar = getUTF8Str((char )c2, GetCodePage());
+ int i;
+ for(i=0; utfchar[i] != '\0' ;i++){
diff --git a/app-text/cuneiform/files/minmax.patch b/app-text/cuneiform/files/minmax.patch
new file mode 100644
index 0000000..625dc9b
--- /dev/null
+++ b/app-text/cuneiform/files/minmax.patch
@@ -0,0 +1,59 @@
+min and max functions are part of stdlib, having them as defines
+breaks libstdc++ internals.
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/include/minmax.h.orig 2017-09-05 22:47:42.245551111 +0300
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/include/minmax.h 2017-09-05 22:48:57.433930220 +0300
+@@ -60,6 +60,10 @@
+ * code use them without proper includes which lead to link errors.
+ */
+
++//#ifdef __cplusplus
++//#include <algorithm>
++//#endif
++
+ #ifndef MIN
+ #define MIN(a,b) (((a)>(b))?(b):(a))
+ #endif
+@@ -67,6 +71,8 @@
+ #define MAX(a,b) (((a)>(b))?(a):(b))
+ #endif
+
++#ifndef __cplusplus
++
+ #ifndef min
+ #define min(a,b) (((a)>(b))?(b):(a))
+ #endif
+@@ -74,4 +80,5 @@
+ #define max(a,b) (((a)>(b))?(a):(b))
+ #endif
+
++#endif // __cplusplus
+ #endif
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rcutp/sources/main/rcutp_func.cpp.orig 2011-04-19 16:49:57.000000000 +0400
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rcutp/sources/main/rcutp_func.cpp 2017-09-05 23:37:11.405501024 +0300
+@@ -902,8 +902,8 @@
+ if(l1<0 || r1<0) return -1;
+ if(i>0)
+ {
+- minl=MIN(minl,l1); minr=min(minr,r1);
+- maxl=MAX(maxl,l1); maxr=max(maxr,r1);
++ minl=MIN(minl,l1); minr=MIN(minr,r1);
++ maxl=MAX(maxl,l1); maxr=MAX(maxr,r1);
+ }
+ else
+ {
+--- cuneiform-linux-1.1.0/cuneiform_src/Kern/rcutp/sources/main/rcutp_mainfunc.cpp.orig 2011-04-19 16:49:57.000000000 +0400
++++ cuneiform-linux-1.1.0/cuneiform_src/Kern/rcutp/sources/main/rcutp_mainfunc.cpp 2017-09-05 23:53:03.816381210 +0300
+@@ -73,13 +73,6 @@
+
+ extern int16_t minrow,bbs1,bbs2,bbs3,bbs4,Nb1,Nb2,Nb3;
+ extern uchar language;
+-#ifndef max
+-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+-#endif
+-
+-#ifndef min
+-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+-#endif
+
+ extern int16_t up_position,dw_position;
+ uchar MemForCutPoints[65536];