Magellan Linux

Annotation of /trunk/include/xorg.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22644 - (hide annotations) (download)
Mon Oct 27 14:21:07 2014 UTC (10 years ago) by niro
File size: 4202 byte(s)
-always sdepend on all protos for driver builds
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 21408 : ${HOMEPAGE="http://xorg.freedesktop.org"}
63 niro 9207 : ${SRCFILE="${PNAME}-${PVER}.tar.bz2"}
64     : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"}
65 niro 1186
66     #XORG_MIRROR="http://ftp.x.org/pub"
67     XORG_MIRROR="http://xorg.freedesktop.org/archive"
68    
69 niro 18714 if [[ -n ${PCATEGORIE} ]] && [[ -z ${PCAT} ]]
70     then
71     PCAT="${PCATEGORIE}"
72     fi
73    
74 niro 3227 # get the right subdir
75 niro 9863 case ${PCAT} in
76 niro 20669 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 niro 20668 x11-libs)
82     case ${PNAME} in
83     glamor-egl) URISUBDIR="driver" ;;
84     *) URISUBDIR="lib" ;;
85     esac
86     ;;
87 niro 20669 x11-misc)
88     case ${PNAME} in
89     xbitmaps|xkbdata) URISUBDIR="data" ;;
90     xkeyboard-config) URISUBDIR="data/xkeyboard-config" ;;
91     *) URISUBDIR="util" ;;
92     esac
93 niro 3227 ;;
94 niro 20669 x11-proto) URISUBDIR="proto" ;;
95     x11-themes) URISUBDIR="data" ;;
96     x11-wm) URISUBDIR="app" ;;
97 niro 3227 esac
98    
99 niro 2 SRC_URI=(
100 niro 9207 ${SRC_URI[*]}
101 niro 3227 ${XORG_MIRROR}/individual/${URISUBDIR}/${SRCFILE}
102 niro 2 mirror://${PNAME}/${SRCFILE}
103     )
104    
105 niro 21408 UP2DATE="updatecmd_xorg ${PNAME}"
106    
107 niro 2 # add default deps
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 niro 21410 : ${DESCRIPTION="Xorg input driver for ${PNAME/xf86-input-/} devices."}
134    
135 niro 2 DEPEND="${DEPEND}
136 niro 21408 >= x11-libs/libXi-1.7
137     >= x11-libs/libXtst-1.1
138 niro 2 >= x11-base/xorg-server-1"
139    
140     SDEPEND="${SDEPEND}
141 niro 22644 == x11-proto/xorg-protos-7.7"
142 niro 2 fi
143    
144     # default video driver dependencies
145     if is_xorg_video_driver
146     then
147 niro 21410 : ${DESCRIPTION="Xorg video driver for ${PNAME/xf86-video-/} devices."}
148    
149 niro 2 DEPEND="${DEPEND}
150     >= x11-base/xorg-server-1"
151    
152     SDEPEND="${SDEPEND}
153 niro 22644 == x11-proto/xorg-protos-7.7"
154 niro 2 fi
155    
156     xorg_src_prepare()
157     {
158     munpack ${SRCFILE} || die
159     }
160    
161     xorg_src_configure()
162     {
163     cd ${SRCDIR}
164    
165     # abort if configure script is not found
166     [ ! -x ./configure ] && return
167    
168     local conf_opts="$@"
169    
170     # setup fonts
171     if is_xorg_font
172     then
173     # setup default font dir
174     : ${XORG_FONT_DIR=${PNAME##*-}}
175    
176     # fix case of font directories
177     XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF}
178     XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF}
179     XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1}
180     XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo}
181    
182     conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}"
183     fi
184    
185     # setup drivers
186     if is_xorg_driver
187     then
188     # don't build static driver modules
189     conf_opts="${conf_opts} --disable-static"
190     fi
191    
192     mconfigure \
193     --prefix=${X11_DIR} \
194     ${conf_opts} \
195     || die
196     }
197    
198     xorg_src_compile()
199     {
200     cd ${SRCDIR}
201     xorg_src_configure || die
202     mmake || die
203     }
204    
205 niro 18715 xorg_src_check()
206     {
207     cd ${SRCDIR}
208     mmake -k check || die
209     }
210    
211 niro 2 xorg_src_install()
212     {
213     cd ${SRCDIR}
214     make DESTDIR=${BINDIR} install || die
215    
216     # remove libtool files for server modules
217     if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ]
218     then
219     find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f
220     fi
221     }
222    
223 niro 18716 export_inherits xorg src_prepare src_compile src_check src_install