sylware / charfbuzz (public) (License: LGPLv3) (since 2019-09-09) (hash sha1)
partial C implementation of harfbuzz C API for roman scripts
List of commits:
Subject Hash Author Date (UTC)
make cleanup and some bash-ism removal c3c7c886bca4c42f3c55169dbba1234f4889431d Sylvain BERTRAND 2015-03-27 01:23:07
compatible with busybox ab23689d96ea773aef950ac6876deb23c98edf54 MihailZenkov 2014-02-05 22:05:22
build system fixes 3ab23b119cbf12638ba80c5c1fb74dfdcc0db4b5 Sylvain BERTRAND 2013-12-01 23:31:59
Initial commit 6b51dc44275fcd132e0cbeec5a9eb79ca532b201 Sylvain BERTRAND 2013-10-16 01:42:30
Commit c3c7c886bca4c42f3c55169dbba1234f4889431d - make cleanup and some bash-ism removal
Author: Sylvain BERTRAND
Author date (UTC): 2015-03-27 01:23
Committer name: Sylvain BERTRAND
Committer date (UTC): 2015-03-27 01:23
Parent(s): ab23689d96ea773aef950ac6876deb23c98edf54
Signing key:
Tree: af8e887626a0011e4b3fb6a31d48bd526b73314c
File Lines added Lines deleted
make 71 76
File make changed (mode: 100755) (index fedeb11..01bff5e)
... ... export LC_ALL
9 9 major=0 major=0
10 10 minor=9 minor=9
11 11 micro=20 micro=20
12 slib_file_name=libharfbuzz.so.${major}.${minor}.${micro}
13 slib_soname=libharfbuzz.so.${major}
12 slib_file_name=libharfbuzz.so.$major.$minor.$micro
13 slib_soname=libharfbuzz.so.$major
14 14
15 15 api_hdrs=' api_hdrs='
16 16 hb.h hb.h
 
... ... hb-gobject-structs.h
35 35 hb-ot.h hb-ot.h
36 36 hb-ot-layout.h hb-ot-layout.h
37 37 hb-ot-tag.h hb-ot-tag.h
38 hb-version.h
39 38 ' '
40 39
41 40 srcs=' srcs='
 
... ... hb-utf-private.c
58 57 ' '
59 58
60 59 clean_do(){ clean_do(){
61 rm -f ${slib_file_name}
62 for src_file in ${srcs}
60 rm -Rf fake_root
61 for src_file in $srcs
63 62 do do
64 rm -f ${src_file/\.c/.o}
63 o_file=${src_file%.c}
64 o_file=${o_file}.o
65 rm -f "$o_file"
65 66 done done
66 67 rm -f harfbuzz.pc hb-version.h rm -f harfbuzz.pc hb-version.h
67 68 exit 0 exit 0
68 69 } }
69 70
70 install_do(){
71 eval prefix=${prefix}
72 eval libdir=${libdir}
73 eval incdir=${incdir}
74
75 ${slib_install} ${slib_file_name} ${destdir}${sysroot}${libdir}/${slib_file_name}
76 ${ln_s} ${slib_file_name} ${destdir}${sysroot}${libdir}/${slib_soname}
77 ${ln_s} ${slib_file_name} ${destdir}${sysroot}${libdir}/libharfbuzz.so
78 ${file_install} harfbuzz.pc ${destdir}${sysroot}${libdir}/pkgconfig/harfbuzz.pc
79 for hdr in ${api_hdrs}
80 do
81 ${file_install} ${source_path}/${hdr} ${destdir}${sysroot}${incdir}/harfbuzz/${hdr}
82 done
83 exit 0
84 }
85
86 71 ################################################################################ ################################################################################
87 72
88 73 # find source path # find source path
89 74 if test -f make; then if test -f make; then
90 source_path=.
75 src_path=.
91 76 else else
92 source_path=$(cd $(dirname "$0"); pwd)
93 echo "$source_path" | grep -q '[[:blank:]]' &&
77 src_path=$(cd $(dirname "$0"); pwd)
78 echo "$src_path" | grep -q '[[:blank:]]' &&
94 79 die "Out of tree builds are impossible with whitespace in source path." die "Out of tree builds are impossible with whitespace in source path."
95 test -e "$source_path/config.h" &&
80 test -e "$src_path/config.h" &&
96 81 die "Out of tree builds are impossible with config.h in source dir." die "Out of tree builds are impossible with config.h in source dir."
97 82 fi fi
98 83
 
... ... PATHS_LIST='
127 112 prefix prefix
128 113 incdir incdir
129 114 libdir libdir
130 prefix
131 sysroot
132 destdir
115 pkg-config-sysroot
133 116 ' '
134 117
135 118 CMDLINE_APPEND=" CMDLINE_APPEND="
 
... ... CMDLINE_APPEND="
139 122 " "
140 123
141 124 CMDLINE_SET=" CMDLINE_SET="
142 ${PATHS_LIST}
125 $PATHS_LIST
143 126 slib_cc slib_cc
144 slib_ld
127 slib_ccld
145 128 " "
146 129
147 # path defaults
148 prefix_default="/usr/local"
149 incdir_default='${prefix}/include'
150 libdir_default='${prefix}/lib'
130 #path defaults
131 prefix_default=''
132 incdir_default='$prefix/include'
133 libdir_default='$prefix/lib'
134 pkg_config_sysroot=''
151 135
152 136 #command lin set defaults #command lin set defaults
153 #slib_cc_default='gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -fpic -Ofast -std=c99'
154 slib_cc_default="gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -fpic -g -std=c99"
155 slib_ld_default="gcc -shared -Wl,-soname=${slib_soname}"
156 slib_install_default='install -D -m 755'
157 file_install_default='install -D -m 644'
137 slib_cc_default='gcc -Wall -Wextra -Wno-missing-field-initializers -c -fPIC -fpic -O0 -std=c99'
138 slib_ccld_default="gcc -shared -Wl,-soname=$slib_soname"
158 139 ln_s_default='ln -sf' ln_s_default='ln -sf'
159 140
160 set_default ${PATHS_LIST}
161 set_default slib_cc slib_ld
162 set_default slib_install file_install ln_s
141 set_default $PATHS_LIST
142 set_default slib_cc slib_ccld
163 143
164 144 show_help(){ show_help(){
165 145 cat <<EOF cat <<EOF
 
... ... Usage: make [options] [operations]
167 147
168 148 Operations: [default is to build the shared library]: Operations: [default is to build the shared library]:
169 149 clean clean build products clean clean build products
170 install install build products
171 150
172 151
173 152 Options: [defaults in brackets after descriptions] Options: [defaults in brackets after descriptions]
 
... ... Help options:
176 155 --help print this message --help print this message
177 156
178 157
179 Standard options:
158 Path options for pkg-config file:
180 159 --prefix=PREFIX install in PREFIX [$prefix_default] --prefix=PREFIX install in PREFIX [$prefix_default]
181 --libdir=DIR install libs in DIR [PREFIX/lib]
182 --incdir=DIR install includes in DIR [PREFIX/include]
160 --libdir=DIR install libs in DIR [$incdir_default]
161 --incdir=DIR install includes in DIR [$libdir_default]
183 162
184 163 Advanced options (experts only): Advanced options (experts only):
185 --sysroot=PATH root of cross-build tree
186 --destdir=PATH installation root dir override
187 --slib-cc=CC use C compiler command line CC for shared lib object[$slib_cc_default]
188 --slib-ld=LD use linker command line LD for shared lib [$slib_ld_default]
164 --pkg-config-sysroot=SYSROOT if you need to tell pkg-config that you cross-compile
165 --slib-cc=CC use C compiler command line CC for shared lib object[$slib_cc_default]
166 --slib-ccld=CCLD use linker command line LD for shared lib [$slib_ccld_default]
189 167 EOF EOF
190 168 exit 0 exit 0
191 169 } }
 
... ... for opt do
195 173 case "$opt" in case "$opt" in
196 174 clean) clean_do clean) clean_do
197 175 ;; ;;
198 install) install_do
199 ;;
200 176 --help|-h) show_help --help|-h) show_help
201 177 ;; ;;
202 178 *) *)
 
... ... for opt do
215 191 done done
216 192
217 193 #for pkgconfig to pickup the right package files #for pkgconfig to pickup the right package files
218 export PKG_CONFIG_SYSROOT_DIR=${sysroot}
194 if test -n "$pkg_config_sysroot"; then
195 export PKG_CONFIG_SYSROOT_DIR=$pkg_config_sysroot
196 fi
219 197
220 #CPPFLAGS=-I./ -I${source_path} -DHAVE_OT -DHAVE_GLIB
221 CPPFLAGS="-I./ -I${source_path} -DHAVE_GLIB \
198 CPPFLAGS="-I./ -I$src_path -DHAVE_GLIB \
222 199 $(pkg-config --cflags freetype2) \ $(pkg-config --cflags freetype2) \
223 200 $(pkg-config --cflags glib-2.0) $(pkg-config --cflags glib-2.0)
224 201 " "
225 202
226 203 #generate the version header file #generate the version header file
227 204 sed -e " sed -e "
228 s/@HB_VERSION_MAJOR@/${major})/
229 s/@HB_VERSION_MINOR@/${minor}/
230 s/@HB_VERSION_MICRO@/${micro}/
231 s/@HB_VERSION@/${major}.${minor}.${micro}/
232 " ${source_path}/hb-version.h.in >hb-version.h
205 s/@HB_VERSION_MAJOR@/$major)/
206 s/@HB_VERSION_MINOR@/$minor/
207 s/@HB_VERSION_MICRO@/$micro/
208 s/@HB_VERSION@/$major.$minor.$micro/
209 " $src_path/hb-version.h.in >hb-version.h
210
211 #evaluate the final paths (depth of one)
212 eval "e_incdir=$incdir"
213 eval "e_libdir=$libdir"
233 214
234 #generate the pkgconfig file
215 #generate the pkg-config file
235 216 sed -e " sed -e "
236 s:%prefix%:${prefix}:
237 s:%exec_prefix%:${prefix}:
238 s:%libdir%:${libdir}:
239 s:%includedir%:${incdir}:
240 s:%VERSION%:${major}.${minor}.${micro}:
241 " ${source_path}/harfbuzz.pc.in >harfbuzz.pc
217 s:%libdir%:$e_libdir:
218 s:%includedir%:$e_incdir:
219 s:%VERSION%:$major.$minor.$micro:
220 " $src_path/harfbuzz.pc.in >harfbuzz.pc
242 221
243 222 #compile source files, build a list of objet files #compile source files, build a list of objet files
244 for src_file in ${srcs}
223 for src_file in $srcs
245 224 do do
246 obj=${src_file/\.c/.o}
247 echo "SLIB_CC ${src_file}"
248 ${slib_cc} ${CPPFLAGS} -o ${obj} ${source_path}/${src_file}
249 objs="${obj} ${objs}"
225 obj=${src_file%.c}
226 obj=${obj}.o
227 echo "SLIB_CC $src_file"
228 $slib_cc $CPPFLAGS -o "$obj" "$src_path/$src_file"
229 objs="$obj $objs"
250 230 done done
251 231
252 232 #link the shared lib #link the shared lib
253 echo "SLIB_LD ${slib_file_name}"
254 echo ${objs}
255 ${slib_ld} -o ${slib_file_name} ${objs}
233 echo "SLIB_CCLD $slib_file_name"
234 echo $objs
235 mkdir -p "fake_root/$e_libdir"
236 $slib_ccld -o "fake_root/$e_libdir/$slib_file_name" $objs
237
238 #install the other files in the fake root
239 ln -sf "$slib_file_name" "fake_root/$e_libdir/$slib_soname"
240 ln -sf "$slib_soname" "fake_root/$e_libdir/libharfbuzz.so"
241
242 mkdir -p "fake_root/$e_libdir/pkgconfig"
243 cp -f harfbuzz.pc fake_root/$e_libdir/pkgconfig/harfbuzz.pc
244
245 mkdir -p "fake_root/$e_incdir/harfbuzz"
246 for hdr in $api_hdrs
247 do
248 cp -f $src_path/$hdr "fake_root/$e_incdir/harfbuzz/$hdr"
249 cp -f hb-version.h "fake_root/$e_incdir/harfbuzz/"
250 done
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/charfbuzz

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/charfbuzz

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/charfbuzz

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main