Magellan Linux

Contents of /smage/trunk/core/include/xorg.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 642 - (show annotations) (download)
Fri Mar 6 17:13:06 2009 UTC (15 years, 2 months ago) by niro
File size: 4923 byte(s)
-variable xorg mirrors

1 # $Header: /magellan-cvs/smage/include/xorg.sminc,v 1.18 2008/02/16 11:26:47 niro Exp $
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 # check if old <=Xorg-6.9 is installed; aborts installation
56 is_old_xorg_installed()
57 {
58 local RED="\033[1;6m\033[31m"
59 local DEF="\033[0m"
60
61 if [ -e /usr/X11R6 ] && [[ $(readlink /usr/X11R6) != ../usr ]]
62 then
63 echo
64 echo -e ${RED}" !!! Remove all old <=xorg-6.9 installations first."${DEF}
65 echo -e ${RED}" !!! You also need to check all packages which are installed to /usr/X11R6"${DEF}
66 echo
67
68 # print a pkg list if magequery supports this
69 if [[ -n $(/sbin/magequery -h | grep -- -f) ]]
70 then
71 echo "Please check following packages:"
72 /sbin/magequery -f /usr/X11R6 | while read pkg
73 do
74 echo -e " ${RED}*${DEF} ${pkg}"
75 done
76 echo
77 fi
78
79 die "/usr/X11R6 directory exists ..."
80 fi
81 }
82
83 # default vars
84 X11_DIR="/usr"
85
86 # satisfy mage with preinstall
87 INHERITS="${INHERITS} xorg"
88
89 # pkg setup
90 SRCFILE="${PNAME}-${PVER}.tar.bz2"
91 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
92
93 #XORG_MIRROR="http://ftp.x.org/pub"
94 XORG_MIRROR="http://xorg.freedesktop.org/archive"
95
96 SRC_URI=(
97 ${XORG_MIRROR}/individual/app/${SRCFILE}
98 ${XORG_MIRROR}/individual/data/${SRCFILE}
99 ${XORG_MIRROR}/individual/doc/${SRCFILE}
100 ${XORG_MIRROR}/individual/driver/${SRCFILE}
101 ${XORG_MIRROR}/individual/font/${SRCFILE}
102 ${XORG_MIRROR}/individual/lib/${SRCFILE}
103 ${XORG_MIRROR}/individual/proto/${SRCFILE}
104 ${XORG_MIRROR}/individual/testdir/${SRCFILE}
105 ${XORG_MIRROR}/individual/util/${SRCFILE}
106 ${XORG_MIRROR}/individual/xserver/${SRCFILE}
107 mirror://${PNAME}/${SRCFILE}
108 )
109
110 # add default deps
111 #DEPEND=">= sys-apps/man-1.6"
112
113 SDEPEND="${SDEPEND}
114 >= dev-util/pkgconfig-0.20
115 >= x11-misc/util-macros-1"
116
117 # font dependencies
118 if is_xorg_font
119 then
120 DEPEND="${DEPEND}
121 >= x11-apps/mkfontscale-1
122 >= x11-apps/mkfontdir-1
123 >= media-fonts/font-alias-1"
124
125 # encodings are run-time needed to rebuild the font.dirs files !!
126 # so don't use SDEPEND but DEPEND here!
127 DEPEND="${DEPEND}
128 >= media-fonts/encodings-1"
129
130 XORG_FONT_PKG=yes
131 SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG"
132 #INHERITS="${INHERITS} xorg"
133 fi
134
135 # default input driver dependencies
136 if is_xorg_input_driver
137 then
138 DEPEND="${DEPEND}
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 # check for old xorg installations
165 is_old_xorg_installed
166
167 munpack ${SRCFILE} || die
168 }
169
170 xorg_src_configure()
171 {
172 cd ${SRCDIR}
173
174 # abort if configure script is not found
175 [ ! -x ./configure ] && return
176
177 local conf_opts="$@"
178
179 # setup fonts
180 if is_xorg_font
181 then
182 # setup default font dir
183 : ${XORG_FONT_DIR=${PNAME##*-}}
184
185 # fix case of font directories
186 XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF}
187 XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF}
188 XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1}
189 XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo}
190
191 conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}"
192 fi
193
194 # setup drivers
195 if is_xorg_driver
196 then
197 # don't build static driver modules
198 conf_opts="${conf_opts} --disable-static"
199 fi
200
201 mconfigure \
202 --prefix=${X11_DIR} \
203 ${conf_opts} \
204 || die
205 }
206
207 xorg_src_compile()
208 {
209 cd ${SRCDIR}
210 xorg_src_configure || die
211 mmake || die
212 }
213
214 xorg_src_install()
215 {
216 cd ${SRCDIR}
217 make DESTDIR=${BINDIR} install || die
218
219 # remove libtool files for server modules
220 if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ]
221 then
222 find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f
223 fi
224 }
225
226 xorg_preinstall()
227 {
228 # check for old xorg installations
229 is_old_xorg_installed
230
231 # run this in postinstall to cover --src-install builds
232 # ( the is now package-dir at this moment, cause its not already builded :)
233 # if [[ -n ${XORG_FONT_PKG} ]]
234 # then
235 # xorg_discover_font_dirs
236 # fi
237 }
238
239 export_inherits xorg src_prepare src_compile src_install preinstall