Magellan Linux

Annotation of /smage/trunk/include/xorg.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17220 - (hide annotations) (download)
Wed Nov 22 09:34:40 2023 UTC (6 months, 2 weeks ago) by niro
File size: 4375 byte(s)
-use xz tarballs as default and honor moved bdftopcf utility
1 niro 3574 # $Id$
2 niro 1665 # 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 5712 : ${HOMEPAGE="http://xorg.freedesktop.org"}
63 niro 16193 : ${SRCFILE="${PNAME}-${PVER}.tar.xz"}
64 niro 3321 : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"}
65 niro 1665
66     #XORG_MIRROR="http://ftp.x.org/pub"
67     XORG_MIRROR="http://xorg.freedesktop.org/archive"
68    
69 niro 5113 if [[ -n ${PCATEGORIE} ]] && [[ -z ${PCAT} ]]
70     then
71     PCAT="${PCATEGORIE}"
72     fi
73    
74 niro 1665 # get the right subdir
75 niro 3574 case ${PCAT} in
76 niro 5460 app-doc) URISUBDIR="doc" ;;
77     media-fonts) URISUBDIR="font" ;;
78 niro 17220 x11-apps)
79     case ${PNAME} in
80     # moved from app to util dir
81     bdftopcf)
82     URISUBDIR="util"
83     UP2SUBDIR="${URISUBDIR}"
84     ;;
85     *) URISUBDIR="app" ;;
86     esac
87     ;;
88 niro 5460 x11-base) URISUBDIR="xserver" ;;
89     x11-drivers) URISUBDIR="driver" ;;
90     x11-libs)
91     case ${PNAME} in
92     glamor-egl) URISUBDIR="driver" ;;
93     *) URISUBDIR="lib" ;;
94     esac
95     ;;
96     x11-misc)
97     case ${PNAME} in
98     xbitmaps|xkbdata) URISUBDIR="data" ;;
99     xkeyboard-config) URISUBDIR="data/xkeyboard-config" ;;
100     *) URISUBDIR="util" ;;
101     esac
102 niro 1665 ;;
103 niro 5460 x11-proto) URISUBDIR="proto" ;;
104     x11-themes) URISUBDIR="data" ;;
105     x11-wm) URISUBDIR="app" ;;
106 niro 1665 esac
107    
108     SRC_URI=(
109 niro 3321 ${SRC_URI[*]}
110 niro 1665 ${XORG_MIRROR}/individual/${URISUBDIR}/${SRCFILE}
111     mirror://${PNAME}/${SRCFILE}
112     )
113    
114 niro 17220 UP2DATE="updatecmd_xorg ${PNAME} xz"
115 niro 5712
116 niro 1665 # add default deps
117     SDEPEND="${SDEPEND}
118 niro 16193 >= virtual/pkgconfig
119 niro 1665 >= x11-misc/util-macros-1"
120    
121     # font dependencies
122     if is_xorg_font
123     then
124 niro 3574 DEPEND="${DEPEND}
125 niro 1665 >= x11-apps/mkfontscale-1
126     >= media-fonts/font-alias-1"
127    
128     # encodings are run-time needed to rebuild the font.dirs files !!
129     # so don't use SDEPEND but DEPEND here!
130 niro 3574 DEPEND="${DEPEND}
131 niro 1665 >= media-fonts/encodings-1"
132    
133     XORG_FONT_PKG=yes
134     SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG"
135     #INHERITS="${INHERITS} xorg"
136     fi
137    
138     # default input driver dependencies
139     if is_xorg_input_driver
140     then
141 niro 5712 : ${DESCRIPTION="Xorg input driver for ${PNAME/xf86-input-/} devices."}
142    
143 niro 1665 DEPEND="${DEPEND}
144 niro 5712 >= x11-libs/libXi-1.7
145     >= x11-libs/libXtst-1.1
146 niro 1665 >= x11-base/xorg-server-1"
147    
148     SDEPEND="${SDEPEND}
149 niro 6708 >= x11-base/xorg-server-dev-1
150 niro 5984 == x11-proto/xorg-protos-7.7"
151 niro 1665 fi
152    
153     # default video driver dependencies
154     if is_xorg_video_driver
155     then
156 niro 5712 : ${DESCRIPTION="Xorg video driver for ${PNAME/xf86-video-/} devices."}
157    
158 niro 1665 DEPEND="${DEPEND}
159     >= x11-base/xorg-server-1"
160    
161     SDEPEND="${SDEPEND}
162 niro 6708 >= x11-base/xorg-server-dev-1
163 niro 5984 == x11-proto/xorg-protos-7.7"
164 niro 1665 fi
165    
166     xorg_src_prepare()
167     {
168     munpack ${SRCFILE} || die
169     }
170    
171     xorg_src_configure()
172     {
173     cd ${SRCDIR}
174    
175     # abort if configure script is not found
176     [ ! -x ./configure ] && return
177    
178     local conf_opts="$@"
179    
180     # setup fonts
181     if is_xorg_font
182     then
183     # setup default font dir
184     : ${XORG_FONT_DIR=${PNAME##*-}}
185    
186     # fix case of font directories
187     XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF}
188     XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF}
189     XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1}
190     XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo}
191    
192     conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}"
193     fi
194    
195     # setup drivers
196     if is_xorg_driver
197     then
198     # don't build static driver modules
199     conf_opts="${conf_opts} --disable-static"
200     fi
201    
202     mconfigure \
203     --prefix=${X11_DIR} \
204     ${conf_opts} \
205     || die
206     }
207    
208     xorg_src_compile()
209     {
210     cd ${SRCDIR}
211     xorg_src_configure || die
212     mmake || die
213     }
214    
215 niro 3574 xorg_src_check()
216     {
217     cd ${SRCDIR}
218     mmake -k check || die
219     }
220    
221 niro 1665 xorg_src_install()
222     {
223     cd ${SRCDIR}
224     make DESTDIR=${BINDIR} install || die
225    
226     # remove libtool files for server modules
227     if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ]
228     then
229     find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f
230     fi
231     }
232    
233 niro 5113 export_inherits xorg src_prepare src_compile src_check src_install