Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations) (download)
Sun Jan 11 00:59:57 2009 UTC (15 years, 4 months ago) by niro
File size: 4898 byte(s)
-moved several base packages to 'core'
1 # $Header: /alx-cvs/smage-eglibc/include/xorg.sminc,v 1.1.1.1 2008/02/27 09:26:22 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 SRC_URI=(
93 http://ftp.x.org/pub/individual/app/${SRCFILE}
94 http://ftp.x.org/pub/individual/data/${SRCFILE}
95 http://ftp.x.org/pub/individual/doc/${SRCFILE}
96 http://ftp.x.org/pub/individual/driver/${SRCFILE}
97 http://ftp.x.org/pub/individual/font/${SRCFILE}
98 http://ftp.x.org/pub/individual/lib/${SRCFILE}
99 http://ftp.x.org/pub/individual/proto/${SRCFILE}
100 http://ftp.x.org/pub/individual/testdir/${SRCFILE}
101 http://ftp.x.org/pub/individual/util/${SRCFILE}
102 http://ftp.x.org/pub/individual/xserver/${SRCFILE}
103 mirror://${PNAME}/${SRCFILE}
104 )
105
106 # add default deps
107 #DEPEND=">= sys-apps/man-1.6"
108
109 SDEPEND="${SDEPEND}
110 >= dev-util/pkgconfig-0.19
111 >= x11-misc/util-macros-1"
112
113 # font dependencies
114 if is_xorg_font
115 then
116 DEPEND="${DEPEND}
117 >= x11-apps/mkfontscale-1
118 >= x11-apps/mkfontdir-1
119 >= media-fonts/font-alias-1"
120
121 # encodings are run-time needed to rebuild the font.dirs files !!
122 # so don't use SDEPEND but DEPEND here!
123 DEPEND="${DEPEND}
124 >= media-fonts/encodings-1"
125
126 XORG_FONT_PKG=yes
127 SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG"
128 #INHERITS="${INHERITS} xorg"
129 fi
130
131 # default input driver dependencies
132 if is_xorg_input_driver
133 then
134 DEPEND="${DEPEND}
135 >= x11-base/xorg-server-1"
136
137 SDEPEND="${SDEPEND}
138 >= x11-proto/inputproto-1
139 >= x11-proto/randrproto-1
140 >= x11-proto/xproto-1"
141 fi
142
143 # default video driver dependencies
144 if is_xorg_video_driver
145 then
146 DEPEND="${DEPEND}
147 >= x11-base/xorg-server-1"
148
149 SDEPEND="${SDEPEND}
150 >= x11-proto/fontsproto-1
151 >= x11-proto/randrproto-1
152 >= x11-proto/renderproto-1
153 >= x11-proto/xextproto-1
154 >= x11-proto/xproto-1
155 >= x11-proto/videoproto-1"
156 fi
157
158 xorg_src_prepare()
159 {
160 # check for old xorg installations
161 is_old_xorg_installed
162
163 munpack ${SRCFILE} || die
164 }
165
166 xorg_src_configure()
167 {
168 cd ${SRCDIR}
169
170 # abort if configure script is not found
171 [ ! -x ./configure ] && return
172
173 local conf_opts="$@"
174
175 # setup fonts
176 if is_xorg_font
177 then
178 # setup default font dir
179 : ${XORG_FONT_DIR=${PNAME##*-}}
180
181 # fix case of font directories
182 XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF}
183 XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF}
184 XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1}
185 XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo}
186
187 conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}"
188 fi
189
190 # setup drivers
191 if is_xorg_driver
192 then
193 # don't build static driver modules
194 conf_opts="${conf_opts} --disable-static"
195 fi
196
197 mconfigure \
198 --prefix=${X11_DIR} \
199 ${conf_opts} \
200 || die
201 }
202
203 xorg_src_compile()
204 {
205 cd ${SRCDIR}
206 xorg_src_configure || die
207 mmake || die
208 }
209
210 xorg_src_install()
211 {
212 cd ${SRCDIR}
213 make DESTDIR=${BINDIR} install || die
214
215 # remove libtool files for server modules
216 if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ]
217 then
218 find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f
219 fi
220 }
221
222 xorg_preinstall()
223 {
224 # check for old xorg installations
225 is_old_xorg_installed
226
227 # run this in postinstall to cover --src-install builds
228 # ( the is now package-dir at this moment, cause its not already builded :)
229 # if [[ -n ${XORG_FONT_PKG} ]]
230 # then
231 # xorg_discover_font_dirs
232 # fi
233 }
234
235 export_inherits xorg src_prepare src_compile src_install preinstall