星期日 七月 16, 2006
星期日 七月 16, 2006
测试字体颜色。
列表
列表
星期四 五月 11, 2006
星期四 三月 23, 2006
This document is written when i build gnome cvs using jhbuild, and i write it just for reference by myself, there maybe many information which are not correct. Welcome any suggestion and comments!
First copy below contents as your ~/.jhbuildrc
# -*- mode: python -*-
# information about cvs server
cvsroots['gnome.org'] = ':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
cvsroots['fontconfig.freedesktop.org'] = ':pserver:anoncvs@cvs.freedesktop.org:/cvs/fontconfig'
# modules to build (deps are also built)
moduleset = 'gnome-2.16'
modules = ['gtk+', 'meta-gnome-desktop', 'meta-gnome-devel-tools' ]
skip = [ 'hal', 'mozilla' ]
skip.append('evolution-exchange')
# the prefix to install things to (user must have write access)
prefix = '/export/home/gnome/install/gnome-cvs'
# where the sources are checked out to
checkoutroot = '/export/home/gnome/src/cvsroot'
# where to put downloaded tarballs.
tarballdir = '/export/home/gnome/src/tarballs'
# arguments to pass to autogen script
autogenargs='--enable-maintainer-mode --disable-static --disable-gtk-doc'
# set CFLAGS:
os.environ['CFLAGS'] = '-g'
os.environ['PYTHON'] = os.path.join(prefix, 'bin/python')
os.environ['PYTHONPATH'] = os.path.join(prefix, 'lib/python2.4/site-packages')
# On SMP systems you may use something like this to improve compilation time:
# be aware that not all modules compile correctly with make -j2
os.environ['MAKE'] = 'make'
os.environ['INSTALL'] = os.path.expanduser('~/bin/install-check')
module_autogenargs['libgcrypt'] = autogenargs + ' --disable-asm'
module_autogenargs['howl'] = autogenargs.replace('--disable-static', '')
module_autogenargs['fontconfig'] = autogenargs + ' --with-expat=/export/home/gnome/install/gnome-cvs/'
module_autogenargs['gtk+'] = autogenargs + ' --with-included-loaders=png'
module_autogenargs['ekiga'] = autogenargs + ' --with-pwlib-dir=/export/home/gnome/install/gnome-cvs/ --with-opal-dir=/export/home/gnome/install/gnome-cvs/ --with-sdl-prefix=/export/home/gnome/install/gnome-cvs/'
module_makeargs['libIDL']= makeargs + ' CPP="/usr/lib/cpp"'
module_makeargs['ORBit2']= makeargs + ' CPP="/usr/lib/cpp"'
module_makeargs['libbonobo']= makeargs + ' CPP="/usr/lib/cpp"'
module_makeargs['dbus']= makeargs + ' CFLAGS="-I/export/home/gnome/install/gnome-cvs/include" LDFLAGS="-lexpat -lintl"'
module_makeargs['cairo']= makeargs + ' LDFLAGS="-lc"'
module_makeargs['gtk+']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['libgnome']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['libgnomeprint']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['bug-buddy']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['eog']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['zenity']= makeargs + ' LDFLAGS="-lintl"'
module_makeargs['evolution-webcal']= makeargs + ' LDFLAGS="-lintl"'
addpath('XDG_DATA_DIRS', '/export/home/gnome/src/gnome-cvs/share')
addpath('XDG_CONFIG_DIRS', '/export/home/gnome/src/gnome-cvs/share')
export LC_ALL=C first
look at opensolaris.org
- need expat: http://nchc.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz
- need freetype: www.freetype.org
- module_autogenargs['fontconfig'] = autogenargs + ' --with-expat=/export/home/gnome/install/gnome-cvs/', exit jhbuild and rerun jhbuild build.
ps: build freetype and expat under jhbuild enviroment, otherwise freetype will link
expat.so.0 under /usr/sfw/lib instead of $prefix/lib
cairo will be compiled with the following surface backends:
image: yes (always builtin)
Xlib: yes
Quartz: no
XCB: no
Win32: no
PostScript: yes
PDF: yes
SVG: no
glitz: no
BeOS: no
DirectFB: no
the following font backends:
FreeType: yes
Win32: no
ATSUI: no
the following features:
PNG functions: yes
and the following debug options:
gcov support: no
test surfaces: no
using CFLAGS:
-DXTHREADS -I/export/home/gnome/install/gnome-cvs/include -I/usr/local/include/libpng12 -I/export/home/gnome/install/gnome-cvs/include -I/export/home/gnome/install/gnome-cvs/include/freetype2
- libpng: http://prdownloads.sourceforge.net/libpng/
cp scripts/makefile.solaris makefile
change prefix
make && make install
- cairo:
module_makeargs['cairo']= makeargs + ' LDFLAGS="-lc"'
- failed to load "./stock_about_16.png": Couldn't recognize the image file format for file './stock_about_16.png'
===> --with-included-loaders=png
It is true that lt-gdk-pixbuf-csource doesn't seem to have png/tiff/jpeg built
into it, so that's why I believe this seems to be the corrent line of solution.
I'm trying to impliment a similar solution... I'm pretty sure the SHLIB stuff is
hp-ux specific. So I went into gdk-pixbuf/Makefile and added the -L./.libs to
the LINK= line and did a 'gmake clean; gmake' and now I get:
g_module_open() failed for
/auto/src-01/common/usc/gnu/gtk+/gtk+-2.2.3/gdk-pixbuf/libpixbufloader-png.la:
ld.so.1:
/auto/src-01/common/usc/gnu/gtk+/gtk+-2.2.3/gdk-pixbuf/.libs/lt-gdk-pixbuf-query-loaders:
fatal: relocation error: file /usr/usc/png/1.2.5/lib/libpng.so.3: symbol
inflateReset: referenced symbol not found
Which I'm confused about. png 1.2.5 is the latest, and it was compiled with the
same compiler.
I've been playing with this for 3 weeks. I actually had to hard code the
'-L/usr/usc/png/1.2.5/lib' into the configure.in file because the configure
script couldn't find it with --with-libpng= even if I set LDFLAGS... This is the
last of *many* problems I've had trying to get gtk+2 to compile...
Phil
- Undefined first referenced
symbol in file
libintl_dgettext /export/home/gnome/src/cvsroot/gtk+/gdk/.libs/libgdk-x11-2.0.so
ld: fatal: Symbol referencing errors. No output written to .libs/gtk-query-immodules-2.0
==> -lintl
Use /usr/lib/cpp as c preprocessor, otherwise orbit-idl-2 will cause many problems.
- CFLAGS="-Werror-implicit-function-declaration -std=gnu89 $CFLAGS"
-> comment out this line in configure.in
- test/inhibit: unknow Foo_..._EPV, this is caused by lack definition.
add foo.h into baa.h.
see: http://mail.gnome.org/archives/orbit-list/2001-May/msg00074.html
***: if we use /usr/lib/cpp for libIDL, then no such problem.
need libIDL, ORBit2 use /usr/lib/cpp on solaris as CPP(c preprocessor)
module_makeargs['libIDL']= makeargs + ' CPP="/usr/lib/cpp"'
module_makeargs['ORBit2']= makeargs + ' CPP="/usr/lib/cpp"'
module_makeargs['libbonobo']= makeargs + ' CPP="/usr/lib/cpp"'
cpp under solaris:
/usr/lib/cpp
/usr/sfw/bin/cpp
/opt/SUNWspro/bin/cc -E
module_autogenargs['howl'] = autogenargs.replace('--disable-static', '')
- can't find expat.h
module_makeargs['dbus']= makeargs + ' CFLAGS="-I/export/home/gnome/install/gnome-cvs/include LDFLAGS="-lexpat -lintl"'
- ImportError: ld.so.1: python2.4: fatal: relocation error: file /usr/lib/python2.4/lib-dynload/array.so: symbol _PyArg_NoKeywords: referenced symbol not found
export PYTHON and PYTHONPATH
can't find pci.ids
Patch hal for solaris: http://lists.freedesktop.org/archives/hal/2006-February/004630.html
1) Can't find definition for __FUNCTION__, use __func__
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pciids login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/pciids co -P pciids
can't find 'endian.h', 'byteswap.h'
skip this module and delete all dependency on this.
- __PRETTY_FUNCTION__ undefined: As noted in the previous subsection, the g++ compiler defines two standard built-in preprocessor macros: __FILE__ and __LINE__. The g++ compiler also defines two non-C standard preprocessor macros called __FUNCTION__ and __PRETTY_FUNCTION__ that return the name of the current function. We can use any of these special pre-defined macros to build our own debug utilities.
GNU CC predefines two string variables to be the name of the current
function. The variable `__FUNCTION__' is the name of the function as
it appears in the source. The variable `__PRETTY_FUNCTION__' is the
name of the function pretty printed in a language specific fashion.
These names are always the same in a C function, but in a C++
function they may be different. For example, this program:
extern "C" {
extern int printf (char *, ...);
}
class a {
public:
sub (int i)
{
printf ("__FUNCTION__ = %s\n", __FUNCTION__);
printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__);
}
};
int
main (void)
{
a ax;
ax.sub (0);
return 0;
}
gives this output:
__FUNCTION__ = sub
__PRETTY_FUNCTION__ = int a::sub (int)
These names are not macros: they are predefined string variables.
For example, `#ifdef __FUNCTION__' does not have any special meaning
inside a function, since the preprocessor does not do anything special
with the identifier `__FUNCTION__'.
This symbol are gcc/g++ only, fortunately it is mostly used by debug.
We can disable debug, so that we don't compile it.
Sulotion:
rm $(topdir)/CVSVERSION
AC_ARG_ENABLE(http-debug,
[ --enable-http-debug Enable HTTP method debugging],
set_http_debug="$enableval",[
if test -f $srcdir/CVSVERSION; then
set_http_debug=yes
else
set_http_debug=no
fi
])
#ifdef HAVE_UTMP_H
/* This sets stdin, stdout, stderr to the socket */
/*if (login && login_tty (fd) == -1) {
g_printerr ("mount child process login_tty failed: %s\n", strerror (errno));
return -1;
}*/
#endif
- Undefined symbol: __FUNCTION__
add one patch: use __func__ for Sun CC compiler instead of __FUNCTION__
- ../../intltool-merge: No such file or directory
copy from other modules
- doc/ can't build
Run under command line manually.
- "mpih-add1.S", line 44 : Syntax error
--disable-asm
- No rules to make 'help/bg'
ignore it: need evaluate on this problem.
-
"shm_limits.c", line 62: incomplete struct/union/enum shminfo: sinfo
"shm_limits.c", line 73: improper member use: shmmax
"shm_limits.c", line 74: improper member use: shmmni
"shm_limits.c", line 76: improper member use: shmmin
"shm_limits.c", line 77: improper member use: shmseg
- using libgtop-2.8.3 and one patch from http://www.whacked.net/2005/07/25/libgtop-on-solaris-10/
- no doxygen
modify autogen.sh to don't --enable-doxygen
- illegal option -Wall
patch $(topdir)/libxklavier to remove them
- exmaple/Makefile: cantain '-O2' which can't be recognized by Sun cc.
- need install cups
--need openldap: need berkely DB install to /usr/ diretory
--berkely DB: http://www.sleepycat.com/
cd build_unix
../dist/configure default prefix
make
make clean
- When build example: can't found symbol definiton for libintl_dgettext
- need libexif: http://kent.dl.sourceforge.net/sourceforge/dropline-gnome/libexif-0.5.12.tar.bz2
- "/export/home/gnome/install/gnome-cvs/include/libxklavier/xklavier_config.h", : _XklConfigItem
cc:/opt/SUNWspro/prod/bin/acomp
- fno-rtti can't be recognized by compile
- liconv
- Wall illegal option
- -lc -lintl
=
Undefined first referenced
symbol in file
void __Crun::ex_rethrow_q() .libs/dvd_plus_rw_utils.o
void*operator new[](unsigned) .libs/dvd_plus_rw_utils.o
void operator delete(void*) .libs/dvd_plus_rw_utils.o
ld: fatal: Symbol referencing errors. No output written to .libs/libnautilus-burn.so.3.0.0
add -lCstd -lCrun at proper position
- ./examples/: ld: fatal: library -lstdc++: not found
-cpp_example_LDADD = $(top_builddir)/lib/libmusicbrainz.la -lstdc++ -lm
+cpp_example_LDADD = $(top_builddir)/lib/libmusicbrainz.la -lm -lCstd -lCrun
- cannot find include file: <linux/cdrom.h>
use patch from laca's spec file.
- no kill func:
include <signal.h>
- Replace '__FUNCTION__' with __func__
- CDROM_GET_CAPABILITY undefined: #define CDROM... 0x42432
- can't found lib Xdamage:
ld: fatal: library -lXdamage: not found
ld: fatal: library -lXfixes: not found
ld: fatal: File processing errors. No output written to .libs/magnifier
-R/usr/X/sfw/lib -L/usr/X/sfw/lib -lXdamage -lXfixes
- need xpcom, skip this
undefined symbol: NETSTAT_PROTOCOL_FORMAT
skip because of hal
-Wall
-lstdc++:
Package requirements (libsoup-2.2 evolution-shell-2.6 libedataserverui-1.2 libexchange-storage-1.2 libbonobo-2.0 libxml-2.0 gconf-2.0)
- need SDL
- need PWlib: http://sourceforge.net/projects/openh323 or cvs
--with-pwlib-dir
- need opal: cvs -z9 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/openh323 co opal
PWLIBDIR=/path/to/pwlib
- modify configure file manually
--with-pwlib-dir=/export/home/gnome/install/gnome-cvs/ --with-opal-dir=/export/home/gnome/install/gnome-cvs/ --with-sdl-prefix=/export/home/gnome/install/gnome-cvs/
skip
Xnest binary not found.
--freetype: add include file
#!/sbin/sh
exec jhbuild --file=/.jhbuildrc run dbus-launch gnome-session
copy gnome.session jhbuild-gnome.session
SDT_ALT_SESSION="/usr/dt/config/Xsession2.jhbuild"
jhbuild-session
then execute fc-cache to handle with font issues.
update-desktop-database -v
bonobo-activation-sysconf --display-directories
bonobo-activation-sysconf --config-file-path
$prefix/etc/bonobo-activation/bonobo-activation-config.xml
add below: <item>$prefix/lib/bonobo/servers</item>
we need make bonobo-activation-server be able to find your .sever file, it can be done in three ways:
1) copy the server file to /usr/lib/bonobo/servers
2) export BONOBO_ACTIVATION_PATH
3) activation-client --add-path $(pwd)
gtk-update-icon
$prefix/libexec/gconfd-2: how to run it?
- Jhbuild issues: http://www.gnomebangalore.org/wiki/index.php/Jhbuild_issues
http://live.gnome.org/JhbuildIssues_2fpango
- Build gnome on Ubuntu: http://live.gnome.org/JhbuildOnUbuntu
- sample jhbuildrc: http://ftp.gnome.org/pub/gnome/teams/releng/2.13.1/sample-tarball.jhbuildrc
- Python issue: http://mail.gnome.org/archives/garnome-list/2005-July/msg00199.html
星期六 二月 18, 2006
星期三 一月 18, 2006
星期六 一月 14, 2006
po file are handled by gettext/dgettext/dcgettext.
char * gettext(const char *msgid);
char * dgettext(const char *domainname, const char * msgid);
char * dcgettext(const char *domainname, const char *msgid, int category);
星期三 一月 04, 2006
if (g_utf8_validate (item->filename, \-1, NULL)) {
gconf_client_set_string (capplet->client, WP_FILE_KEY,
item->filename, NULL);
} else {
utf8_filename = g_locale_to_utf8 (item->filename, \-1, NULL, NULL, NULL);
gconf_client_set_string (capplet->client, WP_FILE_KEY,
utf8_filename, NULL);
g_free (utf8_filename);
}
if (g_utf8_validate (item->fileinfo->name, \-1, NULL))
item->name = g_strdup (item->fileinfo->name);
else
item->name = g_locale_to_utf8 (item->fileinfo->name, \-1, NULL, NULL, NULL);
item->options = gconf_client_get_string (capplet->client,
WP_OPTIONS_KEY,
NULL);
星期六 十二月 31, 2005
Glib use utf8 as internal encoding and thus all gtk+/gnome application use utf8 to represent text, so all text you got from widgets are utf8. In order to use legacy encoding, you need do some converstion.
Before converstion between two encoding, you should know what is encoding it is first. Of course we can guess the encoding of text, but unfortunately there is not perfect way to determine the encoding of one segment of text throught program. So many applications provide one encoding list to user and let user make the decision.
Filename handling is especially hard, because there is no indication whatsoever what character encoding a filename is in (it might have been created when the user was using a different locale, so filename encoding is basically unreliable and broken).
Glib has no idea to get the filename encoding either, so it let user to config filename encoding through enviroment: G_FILENAME_ENCODING and G_BROKEN_FILENAME. By default, Glib assumes that filenames on disk are in UTF-8 encoding, and through these enviroment variables, user can instruct Glib to use that particular encoding for filenames raterh than UTF-8.
g_get_charset will get the character set from the C runtime on the current locale, that is to say g_get_charset will get the current locale encoding if you call setlocale (LC_ALL, "") in your applications; if you call setlocale (LC_ALL, "zh_CN.GB18030") in apps, then the later encoding of C runtime will be GB18030, thus g_get_charset will got GB18030.
g_get_filename_charsets determine the prefered character sets(encoding maybe more accurate) used for filenames. The firest character set from the character sets is treated as filename encoding by Glib, the subsequent character sets are used when trying to generate a displayable respresentation of a filename, see g_filename_display_name().
On Unix, the character sets are determined by consulting the environment variables G_FILENAME_ENCODING and G_BROKEN_FILENAMES. On Windows, the character set used in the GLib API is always UTF-8 and said environment variables have no effect.
G_FILENAME_ENCODING may be set to a comma-separated list of character set names. The special token "@locale" is taken to mean the character set for the current locale. If G_FILENAME_ENCODING is not set, but G_BROKEN_FILENAMES is, the character set of the current locale is taken as the filename encoding. If neither environment variable is set, UTF-8 is taken as the filename encoding, but the character set of the current locale is also put in the list of encodings.
Notes:
The string parameter of g_locale_to_utf8 is a string in the encoding of the current locale of applications(C Runtime locale). On Windows this means the system codepage.
Converts a string which is in the encoding used for strings by the C runtime (usually the same as that used by the operating system, cause most of applications use setlocale (LC_ALL, "") to set it locale) in the current locale into a UTF-8 string.
eg: If the current locale is gb18030, while you set your applications using setlocale (LC_ALL, "zh_TW.BIG5), then the C runtime encoding is BIG5, while the OS encoding is gb18030.
If the current C runtime encoding is UTF-8, then duplicate simply.
Converts a string from UTF-8 to the encoding used for strings by the C runtime (usually the same as that used by the operating system) in the current locale.
Converts a string which is in the encoding used by GLib for filenames into a UTF-8 string. Filename encoding is the first encoding of list returned by g_get_filename_charset().
Converts a string from UTF-8 to the encoding used for filenames. Filename encoding is the first encoding of list returned by g_get_filename_charset().
Converts an escaped ASCII-encoded URI to a local filename in the encoding used for filenames.
Converts an absolute filename to an escaped ASCII-encoded URI.
Converts a filename into a valid UTF-8 string. The conversion is not necessarily reversible, so you should keep the original around and use the return value of this function only for display purposes. Unlike g_filename_to_utf8(), the result is guaranteed to be non-NULL even if the filename actually isn't in the GLib file name encoding(always return one name for display purpose).
If you know the whole pathname of the file you should use g_filename_display_basename(), since that allows location-based translation of filenames.
Parameters:
Returns the display basename for the particular filename, guaranteed to be valid UTF-8. The display name might not be identical to the filename, for instance there might be problems converting it to UTF-8, and some files can be translated in the display
You must pass the whole absolute pathname to this functions so that translation of well known locations can be done.
This function is preferred over g_filename_display_name() if you know the whole path, as it allows translation.
Parameters:
Notes:
glib use native iconv routines or libiconv if has no native iconv implementation to do encoding converstion
g_iconv_open (to_codeset, from_codeset) will try codeset alias, so that provide more powerful conversion. (will learn g_charset_get_aliases() later)
Please got simple example from http://blogs.sun.com/roller/resources/yydzero/main.c