summaryrefslogtreecommitdiff
path: root/app-i18n/zhcon
diff options
context:
space:
mode:
Diffstat (limited to 'app-i18n/zhcon')
-rw-r--r--app-i18n/zhcon/Manifest14
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6+gcc-4.3.patch185
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6+linux-headers-2.6.26.patch18
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6-amd64.patch77
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6-automagic-fix.patch36
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6-curses.patch22
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6.configure.in.patch11
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6.make-fix.patch82
-rw-r--r--app-i18n/zhcon/files/zhcon-0.2.6.sysconfdir.patch24
-rw-r--r--app-i18n/zhcon/metadata.xml16
-rw-r--r--app-i18n/zhcon/zhcon-0.2.6-r2.ebuild53
11 files changed, 538 insertions, 0 deletions
diff --git a/app-i18n/zhcon/Manifest b/app-i18n/zhcon/Manifest
new file mode 100644
index 000000000000..18e7cadd4472
--- /dev/null
+++ b/app-i18n/zhcon/Manifest
@@ -0,0 +1,14 @@
+AUX zhcon-0.2.6+gcc-4.3.patch 5808 SHA256 376503635df1d7d420d3979535db8b41ceeaf3c53643d2cf5ca0582bb5ebc068 SHA512 f8bc5a21ec505494fa104c16ed1057a73b0da3be060b381a1ba8ad29d470dbb8e9361714821eb9ec19ae8898b77a7c9855ca163daf632c2e3bad90aa3c7239cb WHIRLPOOL c79166e903441493cf22ba22a10862a5868b965567832fe0b8f8a5a112802f4e6369c7970489c1d77fadc0f219ad5ed123e639ffd6b310e091bf673d05183adf
+AUX zhcon-0.2.6+linux-headers-2.6.26.patch 527 SHA256 4ac96b499010b099789fc2fb44715e4c30b170b37ca70512512fb2f02a085473 SHA512 2800b14b46341afdaf2e8d555232a78583415de168ba1fef32205a73b32fa838fcdb1a99f6d389b2d5df87c9d5d764fe44eba7e70d5164521e3ac65977de553c WHIRLPOOL 4a589c75ef9ac283913c92909f0cb084e15c8e3b4b2f3043d4a2ba5c6a8d4c4efd8e35e6bea6670ede6d300a6c66da1f712d0c5dd424c36a10375127eed4e596
+AUX zhcon-0.2.6-amd64.patch 2760 SHA256 86af4cd283c5b83fbb427248d79dd5a13e379870b735c678bb041736750ff103 SHA512 4c2a398b78b3026ddfb6a2a77308bb1a78cae51eff0691d42ff7c849a266414c74033f8ce6b6bf211a7ab6dcf39d94dffc96e27dd4e9604629a70f7a65bd907a WHIRLPOOL adc299b6a0a65edb966cf0c681035b6aa06a843d22adcc008a9e4c6c6753574d2b44ff32bd7322838145fd36e0db1ab166a862ed13c1497f85f21b88de511952
+AUX zhcon-0.2.6-automagic-fix.patch 1363 SHA256 977d728c7d1bc2953dc39ac3699791f63f6a10df60eeab5d338cce36d20fc71c SHA512 c88b2d15e8a9f47de46d6cd5e0ac6a0e5bbeaa45ffb39a91d9067fc3f730019ac753e8517e2636994b5ab5bc44c1bd081246b0700ecff61b3dab45caba0d3226 WHIRLPOOL 9dc3ba1e86e2507987af60d804a85c86f4b8c43f6211d5c3ff9b92ff2139ce488551ffad688a32577e4d0cc527f8baba3d64ad049389351c4106b5bb4f3890ad
+AUX zhcon-0.2.6-curses.patch 694 SHA256 7f64f8bba73ae1a5d8bc177ad8c2afec2c4993b618625b12f0e6ef89f381555b SHA512 245b60dd255cff47d70cd1d4dea7b816fcbc668cfa74d5642bb9689e3f819667e76b8336ec3c746d34a3c744d2a6c1d88b32b73f20e41e1f5c830524e158c265 WHIRLPOOL f2b5e12c3d862846b97668c4b9b302318eeac7e4af30628d8604d4c12cc87f582d09b12cfbdc1e51bf11dfe99c2b72d707ff0163d17bf8f6f4e967699b15618f
+AUX zhcon-0.2.6.configure.in.patch 379 SHA256 b60776306429db1afdda49e500bf1aa20c654c5b183e7e599afe08a0bc582dda SHA512 8d226fb01707b37bc5accd44fad01cf028ccfd4c9d826f4056700c9291b3f544333f80f716da4834dae5e32a6a17bdd1c7913635e14eb10764716a45b91229d6 WHIRLPOOL ffd96da9fc35c73fcb084236de210b3f565c5bb0ab9360e1e7f49ad5728919eaff408ef8d3a479474eee4c8770030679d6ae18b5d8de5918ccffeff159cad731
+AUX zhcon-0.2.6.make-fix.patch 3071 SHA256 90d62243a7bd482cdbdd627f559c93c5d4c5e931426f8225f75cda484d2571a1 SHA512 25ac39954f69c251ea1587f580879ca1e38502997b1b7313ef43a84d8626811c5b74e1a0065fec94f4c5acf378ee4495cb41c3ff3a902bd73973f15239c593a8 WHIRLPOOL 6274fb5cc03a093e644b2216c18aa25273c09e12538214916113c0b34aa8487153a4b3bd50fde55319e3c2a2aaddecd687a8530013a5ba3c4bd8534802b39be3
+AUX zhcon-0.2.6.sysconfdir.patch 874 SHA256 9d0ce6c403f808c9a0d942297b72723765155fceb2dc5345ea1e3d7e26510efc SHA512 db957f80b00be3bebb73120ef2556aaa673fda3b85817213617a81a651960279d23ecb768a164e161b9be7cd2289509cf0f8243eb7e2903b976b5b2bd0b0b951 WHIRLPOOL 3fb12fc1a79824c464ccc200abe2f10e80c53919fea00d23fe55ac0a9bf4c6ebf5bc9cfa699ea02a686a33367289a5bab41ca4e64e235e617fe212ab82edabdc
+DIST zhcon-0.2.5-to-0.2.6.diff.gz 2881 SHA256 c9da3f7290f7d74f3ca4f0d78c00c73c0100bcca5eba5d08c629ddc6c7ced9e1 SHA512 c4725e600cde5a629735506c8eaa3b78df4606cd2745891a21c4f25889cff10b6fe4cbeb3cf60b85ad62ed0e46c8e7bbb802b7675f79f3a1d82f6942c393d4ad WHIRLPOOL 07f46130be2e35ff6cb129781bc3a91d803e2e5ec21294c4d514077f04b269568ab8ea4f0950f26693e88a0b10a007dce64344f40362013df13d1424151bf575
+DIST zhcon-0.2.5.tar.gz 5011644 SHA256 4ce4dc1395b6f6a920d44aac069a284bff76df4019ac4164850d263538465d59 SHA512 35f1517b649e5afe3156eb1aa7735f3d3a988fad08c433b8f343df6ba3fdef89493afe61488a76059e4bfa1db4455d21d0bde7041bab37eb50e5ab0b622218fa WHIRLPOOL 9998d7eff8cbc6336d5980b98523ae2d4152b8510464ce3ddde9e109f27d06d7cfb649e5fcf0ddaa830c74401aaff1746a154259b36ab310f2fe0d146d091abc
+EBUILD zhcon-0.2.6-r2.ebuild 1358 SHA256 864d90c30ec654ce0cda1525aff043752ae131c8d16b6ffec7dfa3fc4e788201 SHA512 62b999c8ad154c9adb5b2e86854d2a79d39a30c2c53bd7dc494f3cbf0811c94b7e98ef2f4920f2734ee54cfa288dafaa65816eb0f41085f8826d98206c6d8036 WHIRLPOOL 882874500a99a16db0b50f32f814ae8b866fdc21e07e931fb7110ce085e11b6738d753765638a326b7c607314be6c92e1046d76a4740f182a80c3572bb703b29
+MISC ChangeLog 2940 SHA256 91cd96d00d66449e5b8c69334b13674af2c46a250ffea48e161264b4e917f0fa SHA512 8ea1c32dc6a79ad3938d3e6f89cc1df7f815a5a98c74c7357afcf7042fd2873ecc445e8884b60e483486e20876dde9a9f004a570e4bdcb80d1cc315b615b1a10 WHIRLPOOL 2261cead409b1b4de324e6d0f82743c034ad363be6d915cf335abddbcedd2a596a86e2163a0c395978c815d11f3f36612f41b81705e6b37395889744ac0dc659
+MISC ChangeLog-2015 3539 SHA256 1daf84c1971701c5ef988f7ebca00dd1d31df5147e4b52a87a7586b98b54d55c SHA512 0de62f12320f983762f2d410c871c67f2a28fc6fb84eeaa3797d77f58118671520bf9521984f9c1fd0ffa4a58d6b0374fd7a62a1c5c805d4ce84ae7f848bf8d8 WHIRLPOOL 77e38e66915c9d4a70483410a206bbdf65f659b9da647e2360de3ca59170e03a7b8fc71fd3ead4cc1bcd0174ef659651d73846727cb4ac292cfde28c22f3ff41
+MISC metadata.xml 620 SHA256 9ac4acad81a6711d3375dac37b0e19eb4d74a4cfba2584d4e81c2036ba700f28 SHA512 f67cb7edc94c9d26bf5b7e89d9a02333aec62d8dce387b2449c1879f93a56654a12292b92be63936615ca916452a0d19d62bee984e2462fb939a0fe98e2e7c84 WHIRLPOOL 8700e9d9d985952239154014f3cd2bda787920ae6ac40b350a4f1013ad32fdab97b0da32b1d6ec13a848b1b55b9d83f8fbc78ea1b491d464a95f26b620e2e406
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6+gcc-4.3.patch b/app-i18n/zhcon/files/zhcon-0.2.6+gcc-4.3.patch
new file mode 100644
index 000000000000..beece66b1da8
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6+gcc-4.3.patch
@@ -0,0 +1,185 @@
+diff -NrU5 zhcon-0.2.6.orig/src/basefont.cpp zhcon-0.2.6/src/basefont.cpp
+--- zhcon-0.2.6.orig/src/basefont.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/basefont.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -27,10 +27,12 @@
+ #include "global.h"
+ #include "debug.h"
+ #include "hzdecoder.h"
+ #include "basefont.h"
+
++#include <cstring>
++
+ BaseFont::BaseFont(string & fn, int w, int h)
+ :mFd(0)
+ ,mpBuf(0)
+ ,mWidth(w)
+ ,mHeight(h) {
+diff -NrU5 zhcon-0.2.6.orig/src/display/fblinear4.cpp zhcon-0.2.6/src/display/fblinear4.cpp
+--- zhcon-0.2.6.orig/src/display/fblinear4.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/display/fblinear4.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -20,10 +20,12 @@
+ #include <assert.h>
+ #include <endian.h>
+ #include "global.h"
+ #include "fblinear4.h"
+
++#include <cstring>
++
+ __u16 FBLinear4::nibbletab_cfb4[] = {
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ 0x0000,0xf000,0x0f00,0xff00,
+ 0x00f0,0xf0f0,0x0ff0,0xfff0,
+ 0x000f,0xf00f,0x0f0f,0xff0f,
+diff -NrU5 zhcon-0.2.6.orig/src/display/fblinear8.cpp zhcon-0.2.6/src/display/fblinear8.cpp
+--- zhcon-0.2.6.orig/src/display/fblinear8.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/display/fblinear8.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -20,10 +20,12 @@
+ #include <assert.h>
+ #include <endian.h>
+ #include "global.h"
+ #include "fblinear8.h"
+
++#include <cstring>
++
+ __u32 FBLinear8::nibbletab_cfb8[] = {
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ 0x00000000,0xff000000,0x00ff0000,0xffff0000,
+ 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
+ 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
+diff -NrU5 zhcon-0.2.6.orig/src/display/fbvgaplanes.cpp zhcon-0.2.6/src/display/fbvgaplanes.cpp
+--- zhcon-0.2.6.orig/src/display/fbvgaplanes.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/display/fbvgaplanes.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -36,10 +36,12 @@
+ : "a" ((char) value),
+ "d" ((unsigned short) port));
+ }
+ #endif
+
++#include <cstring>
++
+ /* based on kernel
+ * Force strict CPU ordering.
+ * And yes, this is required on UP too when we're talking
+ * to devices.
+ *
+diff -NrU5 zhcon-0.2.6.orig/src/display/vgadev.cpp zhcon-0.2.6/src/display/vgadev.cpp
+--- zhcon-0.2.6.orig/src/display/vgadev.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/display/vgadev.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -35,10 +35,12 @@
+ #include <cassert>
+ #include "debug.h"
+ #include "vgadev.h"
+ #include "lrmi.h"
+
++#include <cstring>
++
+ #define GRAPH_BASE 0xA0000
+ #define GRAPH_ADDR 0x3ce
+ #define GRAPH_DATA 0x3cf
+
+ char *VGADev::mpBuf = NULL;
+diff -NrU5 zhcon-0.2.6.orig/src/graphdev.cpp zhcon-0.2.6/src/graphdev.cpp
+--- zhcon-0.2.6.orig/src/graphdev.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/graphdev.cpp 2008-04-29 23:16:14.000000000 +0200
+@@ -24,20 +24,23 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <assert.h>
+ #include <iostream>
++#include <cstdlib>
+ #include "debug.h"
+
+ #include "display/fbdev.h"
+ #include "display/vgadev.h"
+ #if defined(linux) || defined(__FreeBSD__)
+ #ifdef HAVE_GGI_LIB
+ #include "display/libggi.h"
+ #endif
+ #endif
+
++#include <cstring>
++
+ using namespace std;
+ // mmap framebuffer address
+ GraphDev *GraphDev::mpGraphDev = NULL;
+
+ // font
+diff -NrU5 zhcon-0.2.6.orig/src/inputclient.cpp zhcon-0.2.6/src/inputclient.cpp
+--- zhcon-0.2.6.orig/src/inputclient.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/inputclient.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -14,10 +14,12 @@
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
++#include <cstdlib>
++
+ #include "inputclient.h"
+
+ Console* InputClient::mpCon = NULL;
+ InputClient::InputClient()
+ : mVisible(false),
+diff -NrU5 zhcon-0.2.6.orig/src/inputmanager.cpp zhcon-0.2.6/src/inputmanager.cpp
+--- zhcon-0.2.6.orig/src/inputmanager.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/inputmanager.cpp 2008-04-29 23:19:01.000000000 +0200
+@@ -22,10 +22,11 @@
+ using namespace std;
+
+ #include <unistd.h>
+ #include <sys/time.h>
+ #include <string>
++#include <cstdlib>
+
+ #include "global.h"
+ #include "debug.h"
+ #include "keymap.h"
+ #include "console.h"
+diff -NrU5 zhcon-0.2.6.orig/src/inputmanager.h zhcon-0.2.6/src/inputmanager.h
+--- zhcon-0.2.6.orig/src/inputmanager.h 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/inputmanager.h 2008-04-29 23:15:37.000000000 +0200
+@@ -24,10 +24,11 @@
+ *@author ejoy
+ */
+ using namespace std;
+ #include <cassert>
+ #include <vector>
++#include <sys/types.h>
+
+ #include "mouse.h"
+ #if defined(__FreeBSD__)
+ #include <sys/kbio.h>
+ #endif
+diff -NrU5 zhcon-0.2.6.orig/src/window.cpp zhcon-0.2.6/src/window.cpp
+--- zhcon-0.2.6.orig/src/window.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/window.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -22,10 +22,12 @@
+ #include <algorithm>
+ #include "global.h"
+ #include "debug.h"
+ #include "window.h"
+
++#include <cstring>
++
+ //static members for all the windows
+ Window* Window::mpConsole = NULL;
+ char* Window::mpOverlaps = NULL;
+
+ Window::Window(int x1, int y1, int x2, int y2, int type)
+diff -NrU5 zhcon-0.2.6.orig/src/zhcon.cpp zhcon-0.2.6/src/zhcon.cpp
+--- zhcon-0.2.6.orig/src/zhcon.cpp 2008-04-29 23:15:08.000000000 +0200
++++ zhcon-0.2.6/src/zhcon.cpp 2008-04-29 23:15:37.000000000 +0200
+@@ -81,10 +81,12 @@
+ #ifndef NDEBUG
+ #include "debug.h"
+ ofstream debug("debug");
+ #endif
+
++#include <cstring>
++
+ Zhcon* Zhcon::mpZhcon = NULL;
+ int Zhcon::mTtyPid = 0;
+ Zhcon::STATE Zhcon::mState = STOP;
+
+ void Zhcon::SignalVtLeave(int signo) {
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6+linux-headers-2.6.26.patch b/app-i18n/zhcon/files/zhcon-0.2.6+linux-headers-2.6.26.patch
new file mode 100644
index 000000000000..67d5b961a070
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6+linux-headers-2.6.26.patch
@@ -0,0 +1,18 @@
+diff --git a/src/display/lrmi.c b/src/display/lrmi.c
+index 85c6fe6..5c74260 100644
+--- a/src/display/lrmi.c
++++ b/src/display/lrmi.c
+@@ -33,6 +33,13 @@ This software has NO WARRANTY. Use it at your own risk.
+
+ #include "lrmi.h"
+
++#if defined(__linux__) && !defined(TF_MASK)
++ #define TF_MASK X86_EFLAGS_TF
++ #define IF_MASK X86_EFLAGS_IF
++ #define VIF_MASK X86_EFLAGS_VIF
++ #define IOPL_MASK X86_EFLAGS_IOPL
++#endif
++
+ #define REAL_MEM_BASE ((void *)0x10000)
+ #define REAL_MEM_SIZE 0x10000
+ #define REAL_MEM_BLOCKS 0x100
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6-amd64.patch b/app-i18n/zhcon/files/zhcon-0.2.6-amd64.patch
new file mode 100644
index 000000000000..58da5e99766a
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6-amd64.patch
@@ -0,0 +1,77 @@
+diff --git a/src/winime.cpp b/src/winime.cpp
+index 0c52393..85729a3 100644
+--- a/src/winime.cpp
++++ b/src/winime.cpp
+@@ -56,10 +56,10 @@ mCandilistBufLen(0)
+
+ memcpy(&mHead, mpBuf, sizeof(mHead));
+ int len = strlen(mHead.mCodeSet);
+- mpIndex1 = (char **) (mpBuf + sizeof(mHead));
+- mpIndex2 = (char **) (mpBuf + sizeof(mHead) + len * sizeof(char *));
+- mpText = mpBuf + sizeof(mHead) + len * sizeof(char *) +
+- len * len * sizeof(char *);
++ mpIndex1 = (int *) (mpBuf + sizeof(mHead));
++ mpIndex2 = (int *) (mpBuf + sizeof(mHead) + len * sizeof(int));
++ mpText = mpBuf + sizeof(mHead) + len * sizeof(int) +
++ len * len * sizeof(int);
+ }
+
+ WinIme::~WinIme() {
+@@ -246,32 +246,33 @@ int WinIme::Search(char c) {
+ // p = *t;
+ }
+ else
+- p = mpIndex1[Index(c)];
++ p = (char *)mpIndex1[Index(c)];
+
+ if (p == (char *) 0xffffffff)
+ found = false;
+- p = (unsigned int) p + mpText;
++ p = (unsigned long) p + mpText;
+ } //2nd level index
+ else if (mNum == 1) {
+ int l = strlen(mHead.mCodeSet);
+ if (c == mHead.mWildChar) {
+ char **t;
+ t =
+- find_if(mpIndex2 + Index(mInput[0]) * l,
+- mpIndex2 + (Index(mInput[0]) + 1) * l,
++ find_if((char **)(mpIndex2 + Index(mInput[0]) * l),
++ (char **)(mpIndex2 + (Index(mInput[0]) + 1) * l),
+ bind2nd(not_equal_to < char *>(),
+ (char *) 0xffffffff));
+- if (t == mpIndex2 + (Index(mInput[0]) + 1) * l)
++ if (t == ((char **)mpIndex2) + (Index(mInput[0]) + 1) * l)
+ p = (char *) 0xffffffff;
+ else
+ p = *t;
+- } else
+- p = mpIndex2[Index(mInput[0]) * l + Index(c)];
++ } else {
++ int dd = Index(mInput[0]) * l + Index(c);
++ p = (char *)(mpIndex2[Index(mInput[0]) * l + Index(c)]);
++ }
+
+ if (p == (char *) 0xffffffff)
+ found = false;
+-
+- p = (unsigned int) p + mpText;
++ p = (unsigned long) p + mpText;
+ } else if (mNum < mHead.mMaxCodes) {
+ p = mpOffset[mNum - 1];
+ if (p == (char *) 0xffffffff)
+diff --git a/src/winime.h b/src/winime.h
+index c2f51ab..816a270 100644
+--- a/src/winime.h
++++ b/src/winime.h
+@@ -83,8 +83,8 @@ class WinIme {
+ char* mpOffset[12];
+ int mFd;
+ char* mpBuf;
+- char** mpIndex1;
+- char** mpIndex2;
++ int *mpIndex1;
++ int *mpIndex2;
+ char* mpText;
+ char* mpCur; //current search position
+ unsigned int mBufSize;
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6-automagic-fix.patch b/app-i18n/zhcon/files/zhcon-0.2.6-automagic-fix.patch
new file mode 100644
index 000000000000..5b4b24137f1e
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6-automagic-fix.patch
@@ -0,0 +1,36 @@
+--- zhcon-0.2.5.orig/configure.in 2010-01-31 15:12:10.521592172 +0100
++++ zhcon-0.2.5/configure.in 2010-01-31 15:12:33.939593092 +0100
+@@ -170,18 +170,25 @@
+ dnl-----------------------------------------------------------------------
+ dnl Checks for gpm
+ dnl-----------------------------------------------------------------------
+-usegpm="yes"
+-AC_CHECK_HEADERS(gpm.h,,usegpm="no")
+-AC_CHECK_LIB(gpm,Gpm_Open,,usegpm="no")
++AC_ARG_WITH([gpm], AS_HELP_STRING([--without-gpm], [Build without gpm library (default: test)]))
++
++usegpm='no'
++if test "x$with_gpm" != "xno"; then
++ AC_CHECK_HEADERS(gpm.h,,AC_ERROR([gpm.h not found]))
++ AC_CHECK_LIB(gpm,Gpm_Open,,AC_ERROR([libgpm not found]))
++ usegpm='yes'
++fi
+
+ dnl-----------------------------------------------------------------------
+ dnl Checks for libggi
+ dnl-----------------------------------------------------------------------
+-useggi="yes"
+-AC_CHECK_HEADERS(ggi/ggi.h,,useggi="no")
+-AC_CHECK_LIB(ggi, main,,useggi="no")
+-if test "$useggi" = 'yes';then
+- AC_DEFINE(HAVE_GGI_LIB)
++AC_ARG_WITH([ggi], AS_HELP_STRING([--without-ggi], [Build without ggi library (default: test)]))
++
++useggi='no'
++if test "x$with_ggi" != "xno"; then
++ AC_CHECK_HEADERS(ggi/ggi.h,,AC_ERROR([ggi.h not found]))
++ AC_CHECK_LIB(ggi, ggiInit,, AC_ERROR([libggi not found]))
++ useggi='yes'
+ fi
+
+ AC_OUTPUT([Makefile
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6-curses.patch b/app-i18n/zhcon/files/zhcon-0.2.6-curses.patch
new file mode 100644
index 000000000000..200014e1d717
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6-curses.patch
@@ -0,0 +1,22 @@
+diff --git a/configure.in b/configure.in
+index 63172e4..6c2afcc 100644
+--- a/configure.in
++++ b/configure.in
+@@ -132,7 +132,7 @@ fi
+ AC_SUBST(ZHCON_LOCALE_DIR)
+
+ AC_CHECK_LIB(util, forkpty)
+-AC_CHECK_LIB(curses, main)
++AC_SEARCH_LIBS([tgetent], [cursesw curses ncursesw ncurses], [break;])
+
+ dnl for freebsd
+ dnl AC_CHECK_LIB(c, i386_set_ioperm)
+@@ -172,7 +172,7 @@ dnl Checks for gpm
+ dnl-----------------------------------------------------------------------
+ usegpm="yes"
+ AC_CHECK_HEADERS(gpm.h,,usegpm="no")
+-AC_CHECK_LIB(gpm,main,,usegpm="no")
++AC_CHECK_LIB(gpm,Gpm_Open,,usegpm="no")
+
+ dnl-----------------------------------------------------------------------
+ dnl Checks for libggi
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6.configure.in.patch b/app-i18n/zhcon/files/zhcon-0.2.6.configure.in.patch
new file mode 100644
index 000000000000..0624a934e02c
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6.configure.in.patch
@@ -0,0 +1,11 @@
+--- a/configure.in 2006-06-22 13:02:59.197841560 +0800
++++ b/configure.in 2006-06-22 12:48:59.000000000 +0800
+@@ -55,7 +55,7 @@
+
+ CFLAGS="$CFLAGS -funsigned-char -O2"
+ CXXFLAGS="$CXXFLAGS -funsigned-char -O2"
+-if test $enable_debug = 'yes';then
++if test "x$enable_debug" = "xyes";then
+ CFLAGS="$CFLAGS -O0 -g3 -Wall"
+ CXXFLAGS="$CXXFLAGS -O0 -g3 -Wall"
+ else
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6.make-fix.patch b/app-i18n/zhcon/files/zhcon-0.2.6.make-fix.patch
new file mode 100644
index 000000000000..ccde407ef81a
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6.make-fix.patch
@@ -0,0 +1,82 @@
+diff -Naur zhcon-0.2.5.orig/doc/Makefile.am zhcon-0.2.5/doc/Makefile.am
+--- zhcon-0.2.5.orig/doc/Makefile.am 2006-05-03 02:57:18.000000000 +0900
++++ zhcon-0.2.5/doc/Makefile.am 2011-01-25 18:08:26.483746175 +0900
+@@ -3,8 +3,8 @@
+ EXTRA_DIST = zhcon.1.in poem.big5 poem.gb poem.gb.utf8 bpsf.txt manual.tex manual.dvi manual.ps README.html default.css html.tar.gz
+
+ install-data-local:
+- $(mkinstalldirs) $(mandir)/man1/
+- $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(mandir)/man1/zhcon.1
++ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1/
++ $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(DESTDIR)$(mandir)/man1/zhcon.1
+
+ uninstall-local:
+- -rm -f $(mandir)/man1/zhcon.1
++ -rm -f $(DESTDIR)$(mandir)/man1/zhcon.1
+diff -Naur zhcon-0.2.5.orig/font/Makefile.am zhcon-0.2.5/font/Makefile.am
+--- zhcon-0.2.5.orig/font/Makefile.am 2006-04-25 01:39:04.000000000 +0900
++++ zhcon-0.2.5/font/Makefile.am 2011-01-25 18:08:26.483746175 +0900
+@@ -1,8 +1,8 @@
+ EXTRA_DIST = *.bpsf
+
+ install-data-local:
+- $(mkinstalldirs) $(libdir)/zhcon/font/
+- $(INSTALL_DATA) $(srcdir)/*.bpsf $(libdir)/zhcon/font/
++ $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/font/
++ $(INSTALL_DATA) $(srcdir)/*.bpsf $(DESTDIR)$(libdir)/zhcon/font/
+
+ uninstall-local:
+- -rm -f $(libdir)/zhcon/font/*.bpsf
++ -rm -f $(DESTDIR)$(libdir)/zhcon/font/*.bpsf
+diff -Naur zhcon-0.2.5.orig/input/Makefile.am zhcon-0.2.5/input/Makefile.am
+--- zhcon-0.2.5.orig/input/Makefile.am 2006-04-25 01:38:44.000000000 +0900
++++ zhcon-0.2.5/input/Makefile.am 2011-01-25 18:08:26.483746175 +0900
+@@ -1,8 +1,8 @@
+ EXTRA_DIST = *.mb
+
+ install-data-local:
+- $(mkinstalldirs) $(libdir)/zhcon/input/
+- $(INSTALL_DATA) $(srcdir)/*.mb $(libdir)/zhcon/input/
++ $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/input/
++ $(INSTALL_DATA) $(srcdir)/*.mb $(DESTDIR)$(libdir)/zhcon/input/
+
+ uninstall-local:
+- -rm -f $(libdir)/zhcon/input/*.mb
++ -rm -f $(DESTDIR)$(libdir)/zhcon/input/*.mb
+diff -Naur zhcon-0.2.5.orig/src/Makefile.am zhcon-0.2.5/src/Makefile.am
+--- zhcon-0.2.5.orig/src/Makefile.am 2006-05-03 02:12:41.000000000 +0900
++++ zhcon-0.2.5/src/Makefile.am 2011-01-25 18:11:42.446555911 +0900
+@@ -7,15 +7,12 @@
+
+ SUBDIRS = display
+
+-install-exec-local:
+- chmod 4755 $(bindir)/zhcon
+-
+ install-data-local:
+- $(mkinstalldirs) $(prefix)/etc
+- $(INSTALL_DATA) $(srcdir)/zhcon.conf $(prefix)/etc/zhcon.conf
++ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
++ $(INSTALL_DATA) $(srcdir)/zhcon.conf $(DESTDIR)$(sysconfdir)/zhcon.conf
+
+ uninstall-local:
+- -rm -f $(prefix)/etc/zhcon.conf
++ -rm -f $(DESTDIR)$(sysconfdir)/zhcon.conf
+
+ # set the include path found by configure
+ INCLUDES= $(all_includes)
+diff -Naur zhcon-0.2.5.orig/tools/Makefile.am zhcon-0.2.5/tools/Makefile.am
+--- zhcon-0.2.5.orig/tools/Makefile.am 2006-04-25 01:38:46.000000000 +0900
++++ zhcon-0.2.5/tools/Makefile.am 2011-01-25 18:04:22.701226453 +0900
+@@ -9,11 +9,6 @@
+ #getbpsf_LDADD = -L/usr/X11R6/lib -lX11
+ #getbpsf_CPPFLAGS = -I/usr/X11R6/include
+
+-LDFLAGS=
+-CXXFLAGS=
+-CCFLAGS=
+-LIBS=
+-
+ EXTRA_DIST = README getbpsf.txt gpm-1.19.6-pty.diff\
+ gpm-1.19.6-patched.tar.gz
+
diff --git a/app-i18n/zhcon/files/zhcon-0.2.6.sysconfdir.patch b/app-i18n/zhcon/files/zhcon-0.2.6.sysconfdir.patch
new file mode 100644
index 000000000000..bc1d8713cd22
--- /dev/null
+++ b/app-i18n/zhcon/files/zhcon-0.2.6.sysconfdir.patch
@@ -0,0 +1,24 @@
+diff -ruN zhcon-0.2.5/src/Makefile.am /tmp/zhcon-0.2.5/src/Makefile.am
+--- a/zhcon-0.2.5/src/Makefile.am 2006-06-22 12:35:01.531885552 +0800
++++ b/zhcon-0.2.5/src/Makefile.am 2006-06-22 12:31:44.000000000 +0800
+@@ -5,6 +5,8 @@
+
+ zhcon_LDADD = display/libdisplay.a
+
++zhcon_CPPFLAGS = -DSYSCONF_DIR=\"${sysconfdir}\"
++
+ SUBDIRS = display
+
+ install-exec-local:
+diff -ruN zhcon-0.2.5/src/zhcon.cpp /tmp/zhcon-0.2.5/src/zhcon.cpp
+--- a/zhcon-0.2.5/src/zhcon.cpp 2006-06-22 12:35:01.398905768 +0800
++++ b/zhcon-0.2.5/src/zhcon.cpp 2006-06-22 12:32:41.000000000 +0800
+@@ -123,7 +123,7 @@
+ string cfgfile = getenv("HOME");
+ cfgfile += "/.zhconrc";
+ if (access(cfgfile.c_str(), R_OK) != 0)
+- cfgfile = PREFIX "/etc/zhcon.conf";
++ cfgfile = SYSCONF_DIR"/zhcon.conf";
+
+ //for debug,a pause enable us to attach zhcon's pid in gdb
+ //char c;cin>>c;
diff --git a/app-i18n/zhcon/metadata.xml b/app-i18n/zhcon/metadata.xml
new file mode 100644
index 000000000000..b720aad5796d
--- /dev/null
+++ b/app-i18n/zhcon/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+ <longdescription>zhcon is a Fast double-byte virtual console for
+Chinese/Japanese/Korean (CJK) running under GNU/Linux and FreeBSD.
+It adds the ability of displaying and inputting CJK double-byte
+characters on console device. Currently Japanese display and input
+function seems to be broken.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">zhcon</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-i18n/zhcon/zhcon-0.2.6-r2.ebuild b/app-i18n/zhcon/zhcon-0.2.6-r2.ebuild
new file mode 100644
index 000000000000..65f87490e84a
--- /dev/null
+++ b/app-i18n/zhcon/zhcon-0.2.6-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="3"
+WANT_AUTOMAKE="1.9"
+
+inherit autotools eutils
+
+MY_P="${P/6/5}"
+
+DESCRIPTION="A Fast CJK (Chinese/Japanese/Korean) Console Environment"
+HOMEPAGE="http://zhcon.sourceforge.net/"
+SRC_URI="mirror://sourceforge/zhcon/${MY_P}.tar.gz
+ mirror://sourceforge/zhcon/zhcon-0.2.5-to-0.2.6.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ggi gpm"
+
+DEPEND="ggi? ( media-libs/libggi[X] )
+ gpm? ( sys-libs/gpm )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${DISTDIR}"/zhcon-0.2.5-to-0.2.6.diff.gz
+ epatch "${FILESDIR}"/${P}.sysconfdir.patch
+ epatch "${FILESDIR}"/${P}.configure.in.patch
+ epatch "${FILESDIR}"/${P}+gcc-4.3.patch
+ epatch "${FILESDIR}"/${P}+linux-headers-2.6.26.patch
+ epatch "${FILESDIR}"/${P}-curses.patch
+ epatch "${FILESDIR}"/${P}-amd64.patch
+ epatch "${FILESDIR}"/${P}-automagic-fix.patch
+ epatch "${FILESDIR}"/${P}.make-fix.patch
+ for f in $(grep -lir HAVE_GGI_LIB *); do
+ sed -i -e "s/HAVE_GGI_LIB/HAVE_LIBGGI/" "${f}" || die "sed failed"
+ done
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_with ggi) \
+ $(use_with gpm) || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ dodoc AUTHORS ChangeLog README NEWS TODO THANKS || die
+ dodoc README.BSD README.gpm README.utf8 || die
+}