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}
56 [ ! -x ${XBPS_CROSS_BASE}/usr
/bin
/${wrapper} ] && return 0
57 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
59 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
61 ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@" | sed -e "s,/usr/,${XBPS_CROSS_BASE}/usr/,g"
64 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
68 local wrapper
="$1" version
="$2"
70 [ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
71 cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
75 echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}" ;;
79 chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
83 if [ ! -x /usr
/bin
/pkg-config
]; then
86 [ -x ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0
87 cat >>${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF
90 export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
91 export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
92 export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
93 exec /usr/bin/pkg-config "\$@"
95 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
96 if [ -z "$no_generic_pkgconfig_link" ]; then
97 ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
102 local _vala_version _file
103 if [ ! -x /usr
/bin
/vapigen
]; then
106 [ -x ${XBPS_WRAPPERDIR}/vapigen
] && return 0
107 for _file
in /usr
/bin
/vapigen-
*; do
108 if [ -x "${_file}" ]; then
109 _vala_version
=${_file#*-}
112 cat >>${XBPS_WRAPPERDIR}/vapigen
<<_EOF
114 exec /usr/bin/vapigen \\
116 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
117 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
118 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0
120 chmod 755 ${XBPS_WRAPPERDIR}/vapigen
121 ln -sf vapigen
${XBPS_WRAPPERDIR}/vapigen-
${_vala_version}
125 local _vala_version _file
126 if [ ! -x /usr
/bin
/valac
]; then
129 [ -x ${XBPS_WRAPPERDIR}/valac
] && return 0
130 for _file
in /usr
/bin
/valac-
*; do
131 if [ -x "${_file}" ]; then
132 _vala_version
=${_file#*-}
135 cat >>${XBPS_WRAPPERDIR}/valac
<<_EOF
137 exec /usr/bin/valac \\
139 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
140 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
141 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0
143 chmod 755 ${XBPS_WRAPPERDIR}/valac
144 ln -sf valac
${XBPS_WRAPPERDIR}/valac-
${_vala_version}
150 for f
in ${XBPS_COMMONDIR}/wrappers
/*.sh
; do
153 install -p -m0755 ${f} ${XBPS_WRAPPERDIR}/${fname}
157 install_cross_wrappers
() {
160 if [ -n "$XBPS_CCACHE" ]; then
161 [ -x "/usr/bin/ccache" ] && prefix
="/usr/bin/ccache "
162 elif [ -n "$XBPS_DISTCC" ]; then
163 [ -x "/usr/bin/distcc" ] && prefix
="/usr/bin/distcc "
166 for fname
in cc gcc
; do
167 sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-gcc,g" \
168 ${XBPS_COMMONDIR}/wrappers
/cross-cc
> \
169 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
170 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
172 for fname
in c
++ g
++; do
173 sed -e "s,@BIN@,${prefix}/usr/bin/$XBPS_CROSS_TRIPLET-g++,g" \
174 ${XBPS_COMMONDIR}/wrappers
/cross-cc
> \
175 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
176 chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${fname}
182 [ ! -x "${XBPS_CROSS_BASE}/usr/bin/${wrapper}" ] && return 0
183 [ -L "${XBPS_WRAPPERDIR}/${wrapper}" ] && return 0
184 ln -sf "${XBPS_CROSS_BASE}/usr/bin/${wrapper}" "${XBPS_WRAPPERDIR}"
188 export PATH
="$XBPS_WRAPPERDIR:$PATH"
192 [ -z "$CROSS_BUILD" ] && return 0
194 install_cross_wrappers
199 if [ -x /usr
/bin
/pkg-config
]; then
200 link_wrapper freetype-config
202 generic_wrapper freetype-config
205 generic_wrapper icu-config
206 generic_wrapper libgcrypt-config
207 generic_wrapper sdl-config
208 generic_wrapper sdl2-config
209 generic_wrapper gpgme-config
210 generic_wrapper gphoto2-config
211 generic_wrapper gphoto2-port-config
212 generic_wrapper imlib2-config
213 generic_wrapper libmikmod-config
214 generic_wrapper pcre-config
215 generic_wrapper net-snmp-config
216 generic_wrapper wx-config
217 generic_wrapper wx-config-3.0
218 generic_wrapper wx-config-gtk3
219 generic_wrapper2 curl-config
220 generic_wrapper2 gpg-error-config
221 generic_wrapper2 libassuan-config
222 generic_wrapper2 mysql_config
223 generic_wrapper2 taglib-config
224 generic_wrapper2 nspr-config
225 generic_wrapper2 gdal-config
226 generic_wrapper3 libpng-config
227 generic_wrapper3 xmlrpc-c-config
228 generic_wrapper3 krb5-config
229 generic_wrapper3 cups-config
230 generic_wrapper3 Magick-config
231 generic_wrapper3 fltk-config
232 generic_wrapper3 xslt-config
233 generic_wrapper3 xml2-config
234 generic_wrapper3 fox-config
235 generic_wrapper3 xapian-config
236 generic_wrapper3 ncurses5-config
237 generic_wrapper3 ncursesw5-config
238 generic_wrapper3 libetpan-config
239 generic_wrapper3 giblib-config
240 python_wrapper python-config
2.7
241 python_wrapper python3-config
3.12
242 apr_apu_wrapper apu-1-config