src_prepare
Function | src_prepare |
---|---|
Purpose | Prepare source packages and do any necessary patching or fixes. |
Sandbox | Enabled |
Privilege | user |
Called for | ebuild |
Default src_prepare
Before EAPI 6, the default implementation did nothing:
src_prepare() {
true
}
Beginning with EAPI 6, the src_prepare function gained a new default implementation:
src_prepare() {
if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
[[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
else
[[ -n ${PATCHES} ]] && eapply ${PATCHES}
fi
eapply_user
}
Note:
With EAPI 6, you must call
eapply_user
or default
if you define
src_prepare
!
Sample src_prepare
src_prepare() {
eapply "${FILESDIR}/${PV}/${P}-fix-bogosity.patch"
eapply "${FILESDIR}/${PV}/${P}-pam.patch"
eapply_user
sed -i -e 's/"ispell"/"aspell"/' src/defaults.h || die "Sed failed!"
}