summaryrefslogtreecommitdiffhomepage
path: root/vars/pkgconf_host.vars
blob: 54497bb89a625fe406ea7bb7ad2248d10133b5be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_pkgconf_host_install_make_post() {
	if [ -e "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config" ]; then
		if ! rtl_fileop rm "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config"; then
			return 1;
		fi;
	fi;
	if ! cat > "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config" <<EOF
#!/bin/sh
if [ -z "\${PREFIX_NATIVE}" ]; then
	PREFIX_NATIVE="${PREFIX_NATIVE}";
fi;
if [ "\${#}" -eq 1 ]\
&& [ "x\${1}" = "x--version" ]; then
	"\$(dirname "\${0}")"/pkgconf --version;
else
	"\$(dirname "\${0}")"/pkgconf --define-variable=prefix="\${PREFIX_NATIVE%/}/" --keep-system-cflags "\${@}";
fi;
EOF
	then
		return 1;
	elif ! rtl_fileop chmod +x "${PKG_DESTDIR}/bin/${PKG_TARGET}-pkg-config"\
	||   ! rtl_fileop rm "${PKG_DESTDIR}/bin/pkg-config"; then
		return 1;
	fi;
};

pkg_pkgconf_install_make_pre() {
	if [ -e "${PKG_DESTDIR}/bin/pkg-config" ]; then
		if ! rtl_fileop rm "${PKG_DESTDIR}/bin/pkg-config"; then
			return 1;
		fi;
	fi;
	rtl_fileop ln_symbolic pkgconf "${PKG_DESTDIR}/bin/pkg-config";
};

# vim:filetype=sh textwidth=0