1 # This hook creates wrappers for foo-config scripts in cross builds.
3 # Wrappers are created in ${wrksrc}/.xbps/bin and this path is appended
4 # to make configure scripts find them.
8 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
9 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
11 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
13 exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr "\$@"
16 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
22 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
23 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
25 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
27 if [ "\$1" = "--prefix" ]; then
28 echo "${XBPS_CROSS_BASE}/usr"
29 elif [ "\$1" = "--cflags" ]; then
30 ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --cflags | sed -e "s,-I/usr/include,-I${XBPS_CROSS_BASE}/usr/include,g"
31 elif [ "\$1" = "--libs" ]; then
32 ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --libs | sed -e "s,-L/usr/lib,-L${XBPS_CROSS_BASE}/usr/lib,g"
34 exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@"
38 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
43 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
44 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
46 cp ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ${XBPS_WRAPPERDIR}
47 sed -e "s,^libdir=.*,libdir=${XBPS_CROSS_BASE}/usr/lib,g" -i ${XBPS_WRAPPERDIR}/${wrapper}
48 sed -e "s
,^prefix
=.
*,prefix
=${XBPS_CROSS_BASE}/usr," -i ${XBPS_WRAPPERDIR}/${wrapper}
50 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
55 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
56 [ -x ${XBPS_WRAPPERDIR}/${wrapper}-qemu ] && return 0
58 cat >>${XBPS_WRAPPERDIR}/${wrapper}-qemu<<_EOF
60 export QEMU_LD_PREFIX=${XBPS_CROSS_BASE}
61 exec qemu-${XBPS_TARGET_QEMU_MACHINE} ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@"
63 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}-qemu
69 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
70 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
72 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
74 ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@" | sed -e "s,/usr/,${XBPS_CROSS_BASE}/usr/,g"
77 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
81 local wrapper
="$1" version
="$2"
83 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
84 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
88 echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}" ;;
92 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
96 if [ ! -x /usr
/bin
/pkg-config
]; then
99 [ -x ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0
100 cat >>${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF
103 export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
104 export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
105 export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
106 exec /usr/bin/pkg-config "\$@"
108 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
109 if [ -z "$no_generic_pkgconfig_link" ]; then
110 ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
115 local _vala_version _file
116 if [ ! -x /usr
/bin
/vapigen
]; then
119 [ -x ${XBPS_WRAPPERDIR}/vapigen
] && return 0
120 for _file
in /usr
/bin
/vapigen-
*; do
121 if [ -x "${_file}" ]; then
122 _vala_version
=${_file#*-}
125 cat >>${XBPS_WRAPPERDIR}/vapigen
<<_EOF
127 exec /usr/bin/vapigen \\
129 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
130 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
131 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0
133 chmod 755 ${XBPS_WRAPPERDIR}/vapigen
134 ln -sf vapigen
${XBPS_WRAPPERDIR}/vapigen-
${_vala_version}
138 local _vala_version _file
139 if [ ! -x /usr
/bin
/valac
]; then
142 [ -x ${XBPS_WRAPPERDIR}/valac
] && return 0
143 for _file
in /usr
/bin
/valac-
*; do
144 if [ -x "${_file}" ]; then
145 _vala_version
=${_file#*-}
148 cat >>${XBPS_WRAPPERDIR}/valac
<<_EOF
150 exec /usr/bin/valac \\
152 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
153 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
154 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0
156 chmod 755 ${XBPS_WRAPPERDIR}/valac
157 ln -sf valac
${XBPS_WRAPPERDIR}/valac-
${_vala_version}
163 for f
in ${XBPS_COMMONDIR}/wrappers
/*.sh
; do
166 install -p -m0755 ${f} ${XBPS_WRAPPERDIR}/${fname}
170 install_cross_wrappers
() {
173 if [ -n "$XBPS_CCACHE" ]; then
174 [ -x "/usr/bin/ccache" ] && prefix
="/usr/bin/ccache "
175 elif [ -n "$XBPS_DISTCC" ]; then
176 [ -x "/usr/bin/distcc" ] && prefix
="/usr/bin/distcc "
179 for fname
in cc gcc
; do
180 sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-gcc,g" \
181 ${XBPS_COMMONDIR}/wrappers
/cross-cc
> \
182 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
183 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
185 for fname
in c
++ g
++; do
186 sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-g++,g" \
187 ${XBPS_COMMONDIR}/wrappers
/cross-cc
> \
188 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
189 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
195 [ ! -x "${XBPS_CROSS_BASE}/usr/bin/${wrapper}" ] && return 0
196 [ -L "${XBPS_WRAPPERDIR}/${wrapper}" ] && return 0
197 ln -sf "${XBPS_CROSS_BASE}/usr/bin/${wrapper}" "${XBPS_WRAPPERDIR}"
201 export PATH
="$XBPS_WRAPPERDIR:$PATH"
205 [ -z "$CROSS_BUILD" ] && return 0
207 install_cross_wrappers
212 if [ -x /usr
/bin
/pkg-config
]; then
213 link_wrapper freetype-config
215 generic_wrapper freetype-config
218 generic_wrapper icu-config
219 generic_wrapper libgcrypt-config
220 generic_wrapper sdl-config
221 generic_wrapper sdl2-config
222 generic_wrapper gpgme-config
223 generic_wrapper gphoto2-config
224 generic_wrapper gphoto2-port-config
225 generic_wrapper imlib2-config
226 generic_wrapper libmikmod-config
227 generic_wrapper pcre-config
228 generic_wrapper net-snmp-config
229 generic_wrapper wx-config
230 generic_wrapper wx-config-3.0
231 generic_wrapper wx-config-gtk3
232 generic_wrapper2 curl-config
233 generic_wrapper2 gpg-error-config
234 generic_wrapper2 libassuan-config
235 generic_wrapper2 mysql_config
236 generic_wrapper2 taglib-config
237 generic_wrapper2 nspr-config
238 generic_wrapper2 gdal-config
239 generic_wrapper3 libpng-config
240 generic_wrapper3 xmlrpc-c-config
241 generic_wrapper3 krb5-config
242 generic_wrapper3 cups-config
243 generic_wrapper3 Magick-config
244 generic_wrapper3 fltk-config
245 generic_wrapper3 xslt-config
246 generic_wrapper3 xml2-config
247 generic_wrapper3 fox-config
248 generic_wrapper3 xapian-config
249 generic_wrapper3 ncurses5-config
250 generic_wrapper3 ncursesw5-config
251 generic_wrapper3 libetpan-config
252 generic_wrapper3 giblib-config
253 python_wrapper python-config
2.7
254 python_wrapper python3-config
3.13
255 apr_apu_wrapper apu-1-config
256 qemu_wrapper llvm-config