Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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