Magellan Linux

Contents of /branches/R11-unstable/include/xorg.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21408 - (show annotations) (download)
Fri Jun 20 08:50:14 2014 UTC (9 years, 10 months ago) by niro
Original Path: trunk/include/xorg.sminc
File size: 4274 byte(s)
-added default input-driver deps, added default homepage adn up2date uri
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 : ${HOMEPAGE="http://xorg.freedesktop.org"}
63 : ${SRCFILE="${PNAME}-${PVER}.tar.bz2"}
64 : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"}
65
66 #XORG_MIRROR="http://ftp.x.org/pub"
67 XORG_MIRROR="http://xorg.freedesktop.org/archive"
68
69 if [[ -n ${PCATEGORIE} ]] && [[ -z ${PCAT} ]]
70 then
71 PCAT="${PCATEGORIE}"
72 fi
73
74 # get the right subdir
75 case ${PCAT} in
76 app-doc) URISUBDIR="doc" ;;
77 media-fonts) URISUBDIR="font" ;;
78 x11-apps) URISUBDIR="app" ;;
79 x11-base) URISUBDIR="xserver" ;;
80 x11-drivers) URISUBDIR="driver" ;;
81 x11-libs)
82 case ${PNAME} in
83 glamor-egl) URISUBDIR="driver" ;;
84 *) URISUBDIR="lib" ;;
85 esac
86 ;;
87 x11-misc)
88 case ${PNAME} in
89 xbitmaps|xkbdata) URISUBDIR="data" ;;
90 xkeyboard-config) URISUBDIR="data/xkeyboard-config" ;;
91 *) URISUBDIR="util" ;;
92 esac
93 ;;
94 x11-proto) URISUBDIR="proto" ;;
95 x11-themes) URISUBDIR="data" ;;
96 x11-wm) URISUBDIR="app" ;;
97 esac
98
99 SRC_URI=(
100 ${SRC_URI[*]}
101 ${XORG_MIRROR}/individual/${URISUBDIR}/${SRCFILE}
102 mirror://${PNAME}/${SRCFILE}
103 )
104
105 UP2DATE="updatecmd_xorg ${PNAME}"
106
107 # add default deps
108 DEPEND="${DEPEND}
109 >= virtual/man"
110
111 SDEPEND="${SDEPEND}
112 >= dev-util/pkgconfig-0.20
113 >= x11-misc/util-macros-1"
114
115 # font dependencies
116 if is_xorg_font
117 then
118 DEPEND="${DEPEND}
119 >= x11-apps/mkfontscale-1
120 >= x11-apps/mkfontdir-1
121 >= media-fonts/font-alias-1"
122
123 # encodings are run-time needed to rebuild the font.dirs files !!
124 # so don't use SDEPEND but DEPEND here!
125 DEPEND="${DEPEND}
126 >= media-fonts/encodings-1"
127
128 XORG_FONT_PKG=yes
129 SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG"
130 #INHERITS="${INHERITS} xorg"
131 fi
132
133 # default input driver dependencies
134 if is_xorg_input_driver
135 then
136 DEPEND="${DEPEND}
137 >= x11-libs/libXi-1.7
138 >= x11-libs/libXtst-1.1
139 >= x11-base/xorg-server-1"
140
141 SDEPEND="${SDEPEND}
142 >= x11-proto/inputproto-1
143 >= x11-proto/randrproto-1
144 >= x11-proto/xproto-7"
145 fi
146
147 # default video driver dependencies
148 if is_xorg_video_driver
149 then
150 DEPEND="${DEPEND}
151 >= x11-base/xorg-server-1"
152
153 SDEPEND="${SDEPEND}
154 >= x11-proto/fontsproto-2
155 >= x11-proto/randrproto-1
156 >= x11-proto/renderproto-0.9
157 >= x11-proto/xextproto-7
158 >= x11-proto/xproto-7
159 >= x11-proto/videoproto-2"
160 fi
161
162 xorg_src_prepare()
163 {
164 munpack ${SRCFILE} || die
165 }
166
167 xorg_src_configure()
168 {
169 cd ${SRCDIR}
170
171 # abort if configure script is not found
172 [ ! -x ./configure ] && return
173
174 local conf_opts="$@"
175
176 # setup fonts
177 if is_xorg_font
178 then
179 # setup default font dir
180 : ${XORG_FONT_DIR=${PNAME##*-}}
181
182 # fix case of font directories
183 XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF}
184 XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF}
185 XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1}
186 XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo}
187
188 conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}"
189 fi
190
191 # setup drivers
192 if is_xorg_driver
193 then
194 # don't build static driver modules
195 conf_opts="${conf_opts} --disable-static"
196 fi
197
198 mconfigure \
199 --prefix=${X11_DIR} \
200 ${conf_opts} \
201 || die
202 }
203
204 xorg_src_compile()
205 {
206 cd ${SRCDIR}
207 xorg_src_configure || die
208 mmake || die
209 }
210
211 xorg_src_check()
212 {
213 cd ${SRCDIR}
214 mmake -k check || die
215 }
216
217 xorg_src_install()
218 {
219 cd ${SRCDIR}
220 make DESTDIR=${BINDIR} install || die
221
222 # remove libtool files for server modules
223 if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ]
224 then
225 find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f
226 fi
227 }
228
229 export_inherits xorg src_prepare src_compile src_check src_install