Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 282904 - app-i18n/xjdic - Electronic Japanese-English Dictionary Program
Summary: app-i18n/xjdic - Electronic Japanese-English Dictionary Program
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Default Assignee for New Packages
URL: http://www.csse.monash.edu.au/~jwb/xj...
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2009-08-27 13:21 UTC by Dirk Gouders
Modified: 2014-03-03 14:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xjdic-24.ebuild (xjdic-24.ebuild,844 bytes, text/plain)
2009-08-28 18:53 UTC, Justin Lecher (RETIRED)
Details
xjdic-24.patch (xjdic-24.patch,14.84 KB, patch)
2011-08-16 11:54 UTC, Dirk Gouders
Details | Diff
build.log (build.log,2.69 KB, text/plain)
2011-08-16 12:23 UTC, Michal Hájek
Details
environment (environment,82.36 KB, text/plain)
2011-08-16 12:27 UTC, Michal Hájek
Details
New patch correcting errno usage. (xjdic-24.patch,972 bytes, patch)
2011-08-17 20:11 UTC, Dirk Gouders
Details | Diff
Patch with path to dictianories and without warnings. (xjdic-24.patch,125.14 KB, patch)
2011-08-18 10:39 UTC, Dirk Gouders
Details | Diff
Added dependency kterm. (xjdic-24.ebuild,890 bytes, text/plain)
2011-08-18 10:41 UTC, Dirk Gouders
Details
emerge output (xjdic.log,3.51 KB, text/plain)
2011-08-18 10:53 UTC, Michal Hájek
Details
build.log (build.log,4.64 KB, text/plain)
2011-08-18 10:57 UTC, Michal Hájek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Gouders 2009-08-27 13:21:53 UTC
I present an initial ebuild file that creates a standalone version of the
Electronic English-Japanese Dictionary Program by Jim Breen.

Suggestions for improvements are very welcome.
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2009-08-28 18:53:54 UTC
Created attachment 202538 [details]
xjdic-24.ebuild
Comment 2 Michal Hájek 2010-03-13 09:20:55 UTC
> xjdic-24.ebuild

I have tried this ebuild and it fails to emerge due to lack of .patch
Here is the error: 

* Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 * 
 *   /usr/local/portage/app-dicts/xjdic/files/xjdic-24.patch
 *   ( xjdic-24.patch )
 * ERROR: app-dicts/xjdic-24 failed:
 *   Cannot find $EPATCH_SOURCE!
 * 
 * Call stack:
 *     ebuild.sh, line   54:  Called src_unpack
 *   environment, line 2337:  Called epatch '/usr/local/portage/app-dicts/xjdic/files/xjdic-24.patch'
 *   environment, line 1049:  Called die
 * The specific snippet of code:
 *               die "Cannot find \$EPATCH_SOURCE!";
 * 


I suppose there should not be any .patch..? 
Comment 3 Michal Hájek 2010-03-13 09:36:31 UTC
After removing the corresponding line from .ebuild, the xjdic24 still does not emerge. I somehow cannot attach build.log, so I will put it here: 
http://material.karlov.mff.cuni.cz/people/hajek/gentoo/xjdic/
Comment 4 Dirk Gouders 2011-08-16 11:45:20 UTC
(In reply to comment #2)
> > xjdic-24.ebuild
> 
> I have tried this ebuild and it fails to emerge due to lack of .patch
> Here is the error: 
> 
> * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
>  * 
>  *   /usr/local/portage/app-dicts/xjdic/files/xjdic-24.patch
>  *   ( xjdic-24.patch )
>  * ERROR: app-dicts/xjdic-24 failed:
>  *   Cannot find $EPATCH_SOURCE!
>  * 
>  * Call stack:
>  *     ebuild.sh, line   54:  Called src_unpack
>  *   environment, line 2337:  Called epatch
> '/usr/local/portage/app-dicts/xjdic/files/xjdic-24.patch'
>  *   environment, line 1049:  Called die
>  * The specific snippet of code:
>  *               die "Cannot find \$EPATCH_SOURCE!";
>  * 
> 
> 
> I suppose there should not be any .patch..? 

Sorry, I missed to also add the patch as an attachment.
Comment 5 Dirk Gouders 2011-08-16 11:54:30 UTC
Created attachment 283547 [details, diff]
xjdic-24.patch

The patch is at least influenced by the FreeBSD port japanese/edict.
Comment 6 Michal Hájek 2011-08-16 12:23:25 UTC
Created attachment 283549 [details]
build.log
Comment 7 Michal Hájek 2011-08-16 12:24:16 UTC
(In reply to comment #5)

hm, does not work here. See attachment.
Comment 8 Michal Hájek 2011-08-16 12:27:35 UTC
Created attachment 283551 [details]
environment

my environment (for the build.log)
Comment 9 Michal Hájek 2011-08-17 07:59:31 UTC
Aha, it looks like one needs to add 
#include <errno.h> into xjdsa.c file.
Comment 10 Michal Hájek 2011-08-17 08:38:51 UTC
(In reply to comment #9)
> Aha, it looks like one needs to add 
> #include <errno.h> into xjdsa.c file.

unfortunately, this is not the case. I tried to add "include <errno.h>" to every .c file which originaly does not have it. But no use. Still the same error.
Comment 11 Dirk Gouders 2011-08-17 14:53:23 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > Aha, it looks like one needs to add 
> > #include <errno.h> into xjdsa.c file.
> 
> unfortunately, this is not the case. I tried to add "include <errno.h>" to
> every .c file which originaly does not have it. But no use. Still the same
> error.

My guess is that a change in xjdservcomm.c is needed:

-unsigned long jindex(unsigned long it)
+unsigned long jindex(__thread unsigned long it)

But I am currently trying to find out why your gcc reports an error
while mine doesn't...  After I found the reason I am able to verify my guess.
Comment 12 Michal Hájek 2011-08-17 17:17:44 UTC
(In reply to comment #11)

> My guess is that a change in xjdservcomm.c is needed:
> 
> -unsigned long jindex(unsigned long it)
> +unsigned long jindex(__thread unsigned long it)

I have tried this suggestion, unfortunately, here is the result: 

>>> Compiling source in /var/tmp/portage/app-dicts/xjdic-24/work ...
make -j1 
gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdsa.c
gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdcomm.c -o xjdcomm_sa.o
gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdservcomm.c -o xjdservcomm_sa.o
xjdservcomm.c:58:45: error: storage class specified for parameter ‘xit’
make: *** [xjdservcomm_sa.o] Error 1
emake failed
Comment 13 Dirk Gouders 2011-08-17 20:10:38 UTC
(In reply to comment #12)
> (In reply to comment #11)
> 
> > My guess is that a change in xjdservcomm.c is needed:
> > 
> > -unsigned long jindex(unsigned long it)
> > +unsigned long jindex(__thread unsigned long it)
> 
> I have tried this suggestion, unfortunately, here is the result: 
> 
> >>> Compiling source in /var/tmp/portage/app-dicts/xjdic-24/work ...
> make -j1 
> gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdsa.c
> gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdcomm.c -o xjdcomm_sa.o
> gcc -c -DXJDFRONTEND -DXJDDIC -DMMAP xjdservcomm.c -o xjdservcomm_sa.o
> xjdservcomm.c:58:45: error: storage class specified for parameter ‘xit’
> make: *** [xjdservcomm_sa.o] Error 1
> emake failed

Michal, could you please try the new patch?
It read that the non-TLS problem reported by gcc can be solved by
including errno.h instead of defining errno.
Comment 14 Dirk Gouders 2011-08-17 20:11:43 UTC
Created attachment 283683 [details, diff]
New patch correcting errno usage.
Comment 15 Michal Hájek 2011-08-18 07:04:29 UTC
great, thank you very much. This time I was able to install xjdic smoothly. 
Now I only need to try using it :) If you need the build log, please let me know.
Comment 16 Michal Hájek 2011-08-18 07:06:09 UTC
oh,... when running it I get: 

 $ xjdic 
XJDIC Version 2.4 (Japanese Dictionary) Copyright J.W.Breen 2003.
   Stand-alone mode
No control file detected!
Loading Dictionary and Index files.  Please wait...
Unable to open: vconj
Comment 17 Michal Hájek 2011-08-18 08:17:49 UTC
Aha, one needs to do "make xjdxgen" and than download edict.gz and kanjidic.gz from 
http://ftp.monash.edu.au/pub/nihongo/00INDEX.html#dic_fil ,

unpack it, run 
xjdxgen /path/to/edict
xjdxgen /path/to/kanjidict

optionaly create $HOME/.xjdicrc  and only than one can use xjdic :D

Anyway, please note, that japanese EUC or Shift-JIS encoding anabled terminal (e.g. kterm) is necessary. That is, UTF-8 xterm will _not_ work out of the box.

Unfortunately, I have never written any .ebuild file, but I suggest it would be a good idea to add the above mentioned steps.
Comment 18 Dirk Gouders 2011-08-18 09:52:15 UTC
(In reply to comment #15)
> great, thank you very much. This time I was able to install xjdic smoothly. 
> Now I only need to try using it :) If you need the build log, please let me
> know.

OK, thanks for your problem report.
With my initial patch I have been on a completely wrong track to
solve the non-TLS problem.
Comment 19 Dirk Gouders 2011-08-18 09:56:50 UTC
(In reply to comment #17)
> Aha, one needs to do "make xjdxgen" and than download edict.gz and kanjidic.gz
> from 
> http://ftp.monash.edu.au/pub/nihongo/00INDEX.html#dic_fil ,
> 
> unpack it, run 
> xjdxgen /path/to/edict
> xjdxgen /path/to/kanjidict
> 
> optionaly create $HOME/.xjdicrc  and only than one can use xjdic :D
> 
> Anyway, please note, that japanese EUC or Shift-JIS encoding anabled terminal
> (e.g. kterm) is necessary. That is, UTF-8 xterm will _not_ work out of the box.
> 
> Unfortunately, I have never written any .ebuild file, but I suggest it would be
> a good idea to add the above mentioned steps.

Hmm, could you please send the output of `equery files xjdic'?
Mine looks as follows, i.e. eveything needed is installed.

 * Searching for xjdic ...
 * Contents of x11-apps/xjdic-24:
/usr
/usr/bin
/usr/bin/xjdic
/usr/share
/usr/share/xjdic
/usr/share/xjdic/edict
/usr/share/xjdic/edict.xjdx
/usr/share/xjdic/kanjidic
/usr/share/xjdic/kanjidic.xjdx
/usr/share/xjdic/kanjstroke
/usr/share/xjdic/radicals.tm
/usr/share/xjdic/radkfile
/usr/share/xjdic/romkana.cnv
/usr/share/xjdic/vconj

Yes, I realize that kterm is needed for xjdic.  Will add a dependency shortly.
I will also provide an updated patch that deals with the mass of
warnings during compilation.

One thing that I also dislike is that xjdic does not know UTF...
Comment 20 Dirk Gouders 2011-08-18 10:04:22 UTC
(In reply to comment #19)

> One thing that I also dislike is that xjdic does not know UTF...

...which means that you cannot just cut-and-paste a kanji to get its
reading/meaning if you are using an UTF-8 environment.
Comment 21 Michal Hájek 2011-08-18 10:23:00 UTC
(In reply to comment #19) (EDITED by Michal)
> Hmm, could you please send the output of `equery files xjdic'?
>  * Searching for xjdic ...
>  * Contents of x11-apps/xjdic-24:
> /usr
> /usr/bin
> /usr/bin/xjdic
> /usr/share
> /usr/share/xjdic
> /usr/share/xjdic/edict
> /usr/share/xjdic/edict.xjdx
> /usr/share/xjdic/kanjidic
> /usr/share/xjdic/kanjidic.xjdx
> /usr/share/xjdic/kanjstroke
> /usr/share/xjdic/radicals.tm
> /usr/share/xjdic/radkfile
> /usr/share/xjdic/romkana.cnv
> /usr/share/xjdic/vconj

# equery files xjdic
 * Searching for xjdic ...
 * Contents of app-dicts/xjdic-24:
/usr
/usr/bin
/usr/bin/xjdic
/usr/share
/usr/share/xjdic
/usr/share/xjdic/edict
/usr/share/xjdic/edict.xjdx
/usr/share/xjdic/kanjidic
/usr/share/xjdic/kanjidic.xjdx
/usr/share/xjdic/kanjstroke
/usr/share/xjdic/radicals.tm
/usr/share/xjdic/radkfile
/usr/share/xjdic/romkana.cnv
/usr/share/xjdic/vconj
# 

hm, this is identical, so the problem was my .xjdicrc file (or the initial absense of it). Now I have included 'dicdir /usr/share/xjdic/' directive and all is fine.
Comment 22 Michal Hájek 2011-08-18 10:25:17 UTC
(In reply to comment #20)
> (In reply to comment #19)
> 
> > One thing that I also dislike is that xjdic does not know UTF...
> 
> ...which means that you cannot just cut-and-paste a kanji to get its
> reading/meaning if you are using an UTF-8 environment.


exactly! It would be wonderfull to have utf aware xjdic. (xjdic is the only reason for kterm on my machine).
Comment 23 Dirk Gouders 2011-08-18 10:39:52 UTC
Created attachment 283745 [details, diff]
Patch with path to dictianories and without warnings.

My fault, I forgot the default search path for the dictionaries in the patch.

The new one also deals with the mass of warnings, so it would be nice if you
could show me your build log.
Comment 24 Michal Hájek 2011-08-18 10:41:05 UTC
regarding utf support, there seems to be a patch of some sort - see here for a reference: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230695
Comment 25 Dirk Gouders 2011-08-18 10:41:05 UTC
Created attachment 283747 [details]
Added dependency kterm.

This ebuild also installs kterm as a dependency.
Comment 26 Michal Hájek 2011-08-18 10:41:19 UTC
regarding utf support, there seems to be a patch of some sort - see here for a reference: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230695
Comment 27 Michal Hájek 2011-08-18 10:53:02 UTC
Created attachment 283749 [details]
emerge output

After successfull installation, I do not know where I can find the build.log. However, in the attachment is what I see in the terminal after "emerge..."
Comment 28 Michal Hájek 2011-08-18 10:57:04 UTC
Created attachment 283751 [details]
build.log

aha, I just found a way to preserve my build.log - so here it is.
Comment 29 Dirk Gouders 2011-08-18 12:11:16 UTC
(In reply to comment #28)
> Created attachment 283751 [details]
> build.log
> 
> aha, I just found a way to preserve my build.log - so here it is.

Thanks, the build-log looks good.  No warnings or other uncool stuff ;-)

And thanks for the link concerning the UTF-8 question.  I will see if I
can find useful additions for the ebuild.