Magellan Linux

Contents of /trunk/include/xorg.sminc

Parent Directory Parent Directory | Revision Log Revision Log


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