Bug 1144 - The module scim-chinese failed to be loaded when installed in places other than /usr
Summary: The module scim-chinese failed to be loaded when installed in places other th...
Status: RESOLVED FIXED
Alias: None
Product: scim
Classification: Unclassified
Component: IMEngine: Smart Pinyin (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: LiuCougar
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-20 14:20 UTC by Ming Hua
Modified: 2004-08-21 07:09 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ming Hua 2004-08-20 14:20:02 UTC
If scim-chinese is installed with ${prefix} other than /usr, say, the default
/usr/local if compiled from source, scim will fail to load scim-chinese module
when installed.

This has been reported quite a few times in different environments.  I don't
have time to investigate further, but the following lines in
scim-chinese/src/scim_pinyin_imengine.cpp line 119-121 looks very suspicious (in
scim-chinese 0.4.0, but I confirmed it exists in CVS)

#ifndef SCIM_PINYIN_DATA_DIR
    #define SCIM_PINYIN_DATA_DIR "/usr/share/scim-chinese"
#endif

This should be "${datadir}/scim-chinese", shouldn't it?
Comment 1 LiuCougar 2004-08-20 16:26:46 UTC
No, that's not the case

SCIM_PINYIN_DATA_DIR has been define as ${prefix}/share/scim/chinese

I think it should be ${datadir}/scim/chinese

and 

#ifndef SCIM_PINYIN_DATA_DIR
    #define SCIM_PINYIN_DATA_DIR "/usr/share/scim/chinese"
#endif

However it seems to me these are not the really cause of this bug either...
Comment 2 Ming Hua 2004-08-20 16:53:41 UTC
(In reply to comment #1)
> No, that's not the case

Yeah, you are right, I somehow missed the #ifdef part.

> SCIM_PINYIN_DATA_DIR has been define as ${prefix}/share/scim/chinese
> 
> I think it should be ${datadir}/scim/chinese

It's not critical, and I am sure it's not the culprit since I observed this bug
when ${datadir} = ${prefix}/share.  However it's still a bug.  Maybe we should
file a new one?

> #ifndef SCIM_PINYIN_DATA_DIR
>     #define SCIM_PINYIN_DATA_DIR "/usr/share/scim/chinese"
> #endif
> 
> However it seems to me these are not the really cause of this bug either...

I agree.  So I am digging further and found the following in scim-chinese 0.4.0
(sorry don't have time to check 0.4.1, or bootstrap CVS):

scim-chinese-0.4.0/src/Makefile.in, line 294-299:
INCLUDES = -I$(top_builddir) \
                          -I$(top_srcdir) \
                          -I$(top_srcdir)/src \
                          -DSCIM_ICONDIR=\"$(datadir)/scim/icons\" \
                          -DSCIM_CHINESE_LOCALEDIR=\"$(datadir)/locale\" \
                          -DSCIM_PINYIN_DATA_DIR=\"@SCIM_CHINESE_DATA_DIR@\"

However, scim-chinese-0.4.0/src/Makefile (generated by configure, I suppose),
line 294-299:
INCLUDES = -I$(top_builddir) \
                          -I$(top_srcdir) \
                          -I$(top_srcdir)/src \
                          -DSCIM_ICONDIR=\"$(datadir)/scim/icons\" \
                          -DSCIM_CHINESE_LOCALEDIR=\"$(datadir)/locale\" \
                          -DSCIM_PINYIN_DATA_DIR=\"/usr/share/scim/chinese\"

Something must be wrong here.  I hope it's not my configure environment.  For
the record, my configure command is:
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure \
        --host=$(DEB_HOST_GNU_TYPE) \
        --build=$(DEB_BUILD_GNU_TYPE) \
        --prefix=/usr \
        --mandir=\$${prefix}/share/man \
        --infodir=\$${prefix}/share/info \
        --sysconfdir=/etc \
        --disable-static \
        --disable-schemas-install
Comment 3 LiuCougar 2004-08-21 16:55:11 UTC
Ok, I think I've found the problem.

Compiling it to verify.
Comment 4 LiuCougar 2004-08-21 18:35:17 UTC
The first bug is that the AC_SUBST(SCIM_PINYIN_DATA_DIR
) in configure.ac should be put near the end of the file.

second, scim-chinese have to be installed into the same prefix as scim-lib

A m4 macro is defined in scim-lib which can be used to verify this

If you want to try cvs, you must update scim-lib first, then update scim-chinese

I also pump the version of scim-lib to 0.99.8, and scim-chinese CVS head 
requires scim-lib >= 0.99.8
Comment 5 James Su 2004-08-22 00:09:23 UTC
Hi,
  I removed scim.m4 and use scim.pc to resolve this issue. You may have a try.
scim, scim-chinese, scim-hangul, scim-uim, scim-m17n are all updated.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.