Contents of /trunk/include/xorg.sminc
Parent Directory | Revision Log
Revision 18715 -
(show annotations)
(download)
Wed Aug 14 10:14:47 2013 UTC (11 years, 1 month ago) by niro
File size: 4826 byte(s)
Wed Aug 14 10:14:47 2013 UTC (11 years, 1 month ago) by niro
File size: 4826 byte(s)
-added src_check
1 | # $Id$ |
2 | # xorg global smage2 functions |
3 | |
4 | # must: X11_dir (defaults to /usr in sminc) |
5 | # optional: |
6 | # X11_FONT_DIR |
7 | # SRCFILE |
8 | # SRCDIR |
9 | # SRC_URI |
10 | # DEPEND |
11 | # SDEPEND |
12 | |
13 | # global xorg functions needed in the sminc |
14 | |
15 | # checks if ${PNAME} is a font package |
16 | is_xorg_font() |
17 | { |
18 | if [[ ${PNAME/#font-/} != ${PNAME} ]] && |
19 | [[ ${PNAME} != font-alias ]] && |
20 | [[ ${PNAME} != font-util ]] |
21 | then |
22 | return 0 |
23 | fi |
24 | |
25 | return 1 |
26 | } |
27 | |
28 | # checks if ${PNAME} is a video driver package |
29 | is_xorg_video_driver() |
30 | { |
31 | [[ ${PNAME/#xf86-video/} != ${PNAME} ]] && return 0 |
32 | return 1 |
33 | |
34 | } |
35 | |
36 | # checks if ${PNAME} is a input driver package |
37 | is_xorg_input_driver() |
38 | { |
39 | [[ ${PNAME/#xf86-input/} != ${PNAME} ]] && return 0 |
40 | return 1 |
41 | } |
42 | |
43 | # checks for general driver packages |
44 | is_xorg_driver() |
45 | { |
46 | if is_xorg_video_driver || |
47 | is_xorg_input_driver |
48 | then |
49 | return 0 |
50 | fi |
51 | |
52 | return 1 |
53 | } |
54 | |
55 | # default vars |
56 | X11_DIR="/usr" |
57 | |
58 | # satisfy mage with preinstall |
59 | INHERITS="${INHERITS} xorg" |
60 | |
61 | # pkg setup |
62 | : ${SRCFILE="${PNAME}-${PVER}.tar.bz2"} |
63 | : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"} |
64 | |
65 | #XORG_MIRROR="http://ftp.x.org/pub" |
66 | XORG_MIRROR="http://xorg.freedesktop.org/archive" |
67 | |
68 | if [[ -n ${PCATEGORIE} ]] && [[ -z ${PCAT} ]] |
69 | then |
70 | PCAT="${PCATEGORIE}" |
71 | fi |
72 | |
73 | # get the right subdir |
74 | case ${PCAT} in |
75 | app-doc) URISUBDIR="doc" ;; |
76 | media-fonts) URISUBDIR="font" ;; |
77 | x11-apps) URISUBDIR="app" ;; |
78 | x11-base) URISUBDIR="xserver" ;; |
79 | x11-drivers) URISUBDIR="driver" ;; |
80 | x11-libs) URISUBDIR="lib" ;; |
81 | x11-misc) case ${PNAME} in |
82 | xbitmaps|xkbdata) URISUBDIR="data" ;; |
83 | xkeyboard-config) URISUBDIR="data/xkeyboard-config" ;; |
84 | *) URISUBDIR="util" ;; |
85 | esac |
86 | ;; |
87 | x11-proto) URISUBDIR="proto" ;; |
88 | x11-themes) URISUBDIR="data" ;; |
89 | x11-wm) URISUBDIR="app" ;; |
90 | esac |
91 | |
92 | SRC_URI=( |
93 | ${SRC_URI[*]} |
94 | # ${XORG_MIRROR}/individual/app/${SRCFILE} |
95 | # ${XORG_MIRROR}/individual/data/${SRCFILE} |
96 | # ${XORG_MIRROR}/individual/doc/${SRCFILE} |
97 | # ${XORG_MIRROR}/individual/driver/${SRCFILE} |
98 | # ${XORG_MIRROR}/individual/font/${SRCFILE} |
99 | # ${XORG_MIRROR}/individual/lib/${SRCFILE} |
100 | # ${XORG_MIRROR}/individual/proto/${SRCFILE} |
101 | # ${XORG_MIRROR}/individual/testdir/${SRCFILE} |
102 | # ${XORG_MIRROR}/individual/util/${SRCFILE} |
103 | # ${XORG_MIRROR}/individual/xserver/${SRCFILE} |
104 | ${XORG_MIRROR}/individual/${URISUBDIR}/${SRCFILE} |
105 | mirror://${PNAME}/${SRCFILE} |
106 | ) |
107 | |
108 | # add default deps |
109 | DEPEND="${DEPEND} |
110 | >= virtual/man" |
111 | |
112 | SDEPEND="${SDEPEND} |
113 | >= dev-util/pkgconfig-0.20 |
114 | >= x11-misc/util-macros-1" |
115 | |
116 | # font dependencies |
117 | if is_xorg_font |
118 | then |
119 | DEPEND="${DEPEND} |
120 | >= x11-apps/mkfontscale-1 |
121 | >= x11-apps/mkfontdir-1 |
122 | >= media-fonts/font-alias-1" |
123 | |
124 | # encodings are run-time needed to rebuild the font.dirs files !! |
125 | # so don't use SDEPEND but DEPEND here! |
126 | DEPEND="${DEPEND} |
127 | >= media-fonts/encodings-1" |
128 | |
129 | XORG_FONT_PKG=yes |
130 | SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG" |
131 | #INHERITS="${INHERITS} xorg" |
132 | fi |
133 | |
134 | # default input driver dependencies |
135 | if is_xorg_input_driver |
136 | then |
137 | DEPEND="${DEPEND} |
138 | >= x11-base/xorg-server-1" |
139 | |
140 | SDEPEND="${SDEPEND} |
141 | >= x11-proto/inputproto-1 |
142 | >= x11-proto/randrproto-1 |
143 | >= x11-proto/xproto-7" |
144 | fi |
145 | |
146 | # default video driver dependencies |
147 | if is_xorg_video_driver |
148 | then |
149 | DEPEND="${DEPEND} |
150 | >= x11-base/xorg-server-1" |
151 | |
152 | SDEPEND="${SDEPEND} |
153 | >= x11-proto/fontsproto-2 |
154 | >= x11-proto/randrproto-1 |
155 | >= x11-proto/renderproto-0.9 |
156 | >= x11-proto/xextproto-7 |
157 | >= x11-proto/xproto-7 |
158 | >= x11-proto/videoproto-2" |
159 | fi |
160 | |
161 | xorg_src_prepare() |
162 | { |
163 | # check for old xorg installations |
164 | is_old_xorg_installed |
165 | |
166 | munpack ${SRCFILE} || die |
167 | } |
168 | |
169 | xorg_src_configure() |
170 | { |
171 | cd ${SRCDIR} |
172 | |
173 | # abort if configure script is not found |
174 | [ ! -x ./configure ] && return |
175 | |
176 | local conf_opts="$@" |
177 | |
178 | # setup fonts |
179 | if is_xorg_font |
180 | then |
181 | # setup default font dir |
182 | : ${XORG_FONT_DIR=${PNAME##*-}} |
183 | |
184 | # fix case of font directories |
185 | XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF} |
186 | XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF} |
187 | XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1} |
188 | XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo} |
189 | |
190 | conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}" |
191 | fi |
192 | |
193 | # setup drivers |
194 | if is_xorg_driver |
195 | then |
196 | # don't build static driver modules |
197 | conf_opts="${conf_opts} --disable-static" |
198 | fi |
199 | |
200 | mconfigure \ |
201 | --prefix=${X11_DIR} \ |
202 | ${conf_opts} \ |
203 | || die |
204 | } |
205 | |
206 | xorg_src_compile() |
207 | { |
208 | cd ${SRCDIR} |
209 | xorg_src_configure || die |
210 | mmake || die |
211 | } |
212 | |
213 | xorg_src_check() |
214 | { |
215 | cd ${SRCDIR} |
216 | mmake -k check || die |
217 | } |
218 | |
219 | xorg_src_install() |
220 | { |
221 | cd ${SRCDIR} |
222 | make DESTDIR=${BINDIR} install || die |
223 | |
224 | # remove libtool files for server modules |
225 | if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ] |
226 | then |
227 | find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f |
228 | fi |
229 | } |
230 | |
231 | xorg_preinstall() |
232 | { |
233 | # run this in postinstall to cover --src-install builds |
234 | # ( the is now package-dir at this moment, cause its not already builded :) |
235 | # if [[ -n ${XORG_FONT_PKG} ]] |
236 | # then |
237 | # xorg_discover_font_dirs |
238 | # fi |
239 | return 0 |
240 | } |
241 | |
242 | export_inherits xorg src_prepare src_compile src_check src_install preinstall |