-
Notifications
You must be signed in to change notification settings - Fork 0
/
HACKING
139 lines (128 loc) · 4.48 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
URL & REPO
==========
http://ftp.gnu.org/gnu/autoconf/autoconf-2.67.tar.bz2
http://ftp.gnu.org/gnu/automake/automake-1.11.tar.bz2
http://ftp.gnu.org/gnu/libtool/libtool-2.2.10.tar.gz
http://ftp.se.debian.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.bz2
http://ftp.gnu.org/pub/gnu/m4/m4-1.4.14.tar.bz2
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.tar.gz
http://ftp.gnu.org/gnu/texinfo/texinfo-4.9.tar.bz2
http://downloads.sourceforge.net/project/libpng/zlib/1.2.5/zlib-1.2.5.tar.bz2
http://ftp.acc.umu.se/pub/gnome/sources/glib/2.26/glib-2.26.0.tar.bz2
http://cairographics.org/releases/pixman-0.18.4.tar.gz
http://download.savannah.gnu.org/releases/freetype/freetype-2.4.8.tar.bz2
http://sourceforge.net/projects/libpng/files/libpng12/1.2.46/libpng-1.2.46.tar.bz2
http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz
http://www.fontconfig.org/release/fontconfig-2.8.0.tar.gz
http://cairographics.org/releases/cairo-1.8.10.tar.gz
http://ftp.acc.umu.se/pub/gnome/sources/pango/1.28/pango-1.28.3.tar.bz2
http://www.ijg.org/files/jpegsrc.v8b.tar.gz
ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.2.tar.gz
http://ftp.gnome.org/pub/gnome/sources/atk/1.30/atk-1.30.0.tar.bz2
http://ftp.acc.umu.se/pub/gnome/sources/gtk+/2.20/gtk+-2.20.1.tar.bz2
http://ftp.gnome.org/pub/GNOME/sources/glade3/3.6/glade3-3.6.7.tar.bz2
ftp://ftp.gnome.org/pub/GNOME/sources/GConf/2.28/GConf-2.28.1.tar.bz2
COMMON CONFIGURE OPTION
=======================
$ ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared
$ make
$ make DESTDIR=`pwd`/dest install # check the installation
$ find dest
# make install
# cd /usr/share/info
# rm dir
# gzip *
# for f in *
> do
> install-info --info-file=$f --dir-file=dir
> done
$
ENVIRONMENT & SPECIAL CONFIGURATION
===================================
$ cat opt.gtk2.env
export PKG_CONFIG_PATH=/opt/gtk2/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/gtk2/lib
export PATH=/opt/gtk2/bin:$PATH
export MANPATH=/opt/gtk2/man:/opt/gtk2/share/man:/usr/share/man
export INFOPATH=/opt/gtk2/info:/opt/gtk2/share/info:/usr/share/info
export CFLAGS="-I/opt/gtk2/include"
export LDFLAGS="-L/opt/gtk2/lib"
$ . opt.gtk2.env
$ ./configure --prefix=/opt/gtk2 && make && make DESTDIR=`pwd`/dest install && make install
= =b> to build a pure develop enviroment, you need to exam result after every step
$ pkg-config --cflags --libs glib-2.0
$ ldd /opt/gtk2/lib/libgio-2.0.so.0.2600.0
= =b> you can reference http://developer.gnome.org/gtk3/stable/gtk-building.html
AUTOTOOLS
=========
$ info automake-1.11 "Creating amhello"
= =b> compile softwares from source at "URL & REPO" below, then install
$ mkdir m4
$ autoscan
$ mv configure.scan configure.ac
= =b> edit configure.ac
$ autoreconf --install
$ autoheader
$ aclocal
$ autoconf
$ automake --add-missing
$ automake
$ make distcheck
= =b> may be this is better
$ make distcheck DESTDIR=`pwd`/../dest
USING GETTEXT AND INTLTOOL
==========================
Location: http://oriya.sarovar.org/docs/gettext/node6.html
Location: http://www.heiner-eichmann.de/autotools/using_gettext.html
* init
xgettext -d utt -s -k_ -o po/utt.pot src/article.c
msginit -l "zh_CN.utf8" -o utt.po -i utt.pot
msgfmt -c -v -o utt.mo utt.po
cp utt.mo /usr/share/locale/zh_CN/LC_MESSAGES/
* merge
msgmerge -s -U utt.po utt.pot
* cat
msgcat -s -o zh_CN.po zh_CN.po~ ~/git/utt-old/utt-0.2/po/utt.po
* gettextize
$ cat LINGUAS
zh_CN
$ cp utt.po zh_CN.po
* or use intltoolize
$ grep -i macro configure.ac
AC_CONFIG_MACRO_DIR([m4])
$ intltoolize --copy
$ cat po/POTFILES.in
[encoding: UTF-8]
src/article.c
[type: gettext/glade]data/article-ui.xml
$ cat po/POTFILES.skip
data/utt.desktop.in
$ grep translatable data/article-ui.xml | head -n 1
<property name="title" translatable="yes">Artical Typing Traning</property>
$ make -C po utt.pot
$ cd po; msgmerge -s -U zh_CN.po utt.pot; cd ..
= =b> edit zh_CN.po
$ make -C po update-po
= =b> you can install gettext po-mode.el in the gettext tar ball
GitHub SSH
==========
* initialization
$ ssh-keygen -C '[email protected]' -t rsa
$ cat ~/.ssh/id_rsa.pub
$ ssh-agent
$ ssh-add
$ ssh -v [email protected]
$ git remote add origin [email protected]:c-aries/utt.git
$ git push -u origin master
* checkout from network
$ git clone [email protected]:c-aries/utt.git
* update from network
$ git pull
* commit to network
$ git push
* remote branch
$ git remote add wubi [email protected]:c-aries/utt.git
$ git push -u wubi wubi
$ git checkout wubi
$ git pull
$ git fetch origin wubi:wubi