Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 637532 | Differences between
and this patch

Collapse All | Expand All

(-)a/eclass/prefix.eclass (-1 / +22 lines)
Lines 135-138 prefixify_ro() { Link Here
135
		die "$1 does not exist"
135
		die "$1 does not exist"
136
	fi
136
	fi
137
}
137
}
138
139
# @FUNCTION: exprefixify
140
# @USAGE: <directory>
141
# @DESCRIPTION:
142
# For each ELF executable in given directory replaces the path to
143
# program interpreter (i.e. the dynamic loader, for example
144
# '/lib64/ld-linux-x86-64.so.2') with the path where the prefix is
145
# appended the original path.
146
# NOTE: ebuilds that call this must add dev-util/patchelf to DEPENDS
147
exprefixify() {
148
	local dir="$1"
149
	einfo "Prefixifying executables in ${dir}..."
150
	type -P patchelf 1>/dev/null || die "patchelf not found (add dev-util/patchelf to DEPENDS)"
151
152
	# The first -exec is to filter out non-ELF executables
153
	find "${dir}" \
154
		\( -type f -or -type l \) -executable \
155
		-not \( -name '*.la' -or -name '*.a' -or -name '*.so.*' -or -name '*.so' \) \
156
		-exec sh -c 'patchelf --print-interpreter {} 1>/dev/null 2>/dev/null' \; \
157
		-exec sh -c 'patchelf --set-interpreter ${EPREFIX}/$(patchelf --print-interpreter {}) {}' \; \
158
	       || die
159
}
138
# vim: tw=72:
160
# vim: tw=72:
139
- 

Return to bug 637532