mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
Ports: Make sed
work on macOS
The ports `libvorbis`, `readline` and `timidity` would not install on macOS as a result of using `sed -i` without an extension provided. GNU sed is available through Homebrew, but it does not replace `sed` by default. Instead, provide a new `sed_in_place` function that calls `sed` with the right arguments.
This commit is contained in:
parent
3110f5b328
commit
7c2976e006
4 changed files with 11 additions and 3 deletions
|
@ -142,6 +142,14 @@ run_replace_in_file() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sed_in_place() {
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
sed -i '' "${@}"
|
||||||
|
else
|
||||||
|
sed -i "${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_new_config_sub() {
|
get_new_config_sub() {
|
||||||
config_sub="${1:-config.sub}"
|
config_sub="${1:-config.sub}"
|
||||||
if [ ! -f "$workdir/$config_sub" ]; then
|
if [ ! -f "$workdir/$config_sub" ]; then
|
||||||
|
|
|
@ -11,5 +11,5 @@ depends=("libogg")
|
||||||
post_install() {
|
post_install() {
|
||||||
# Fix up broken libtool paths
|
# Fix up broken libtool paths
|
||||||
# FIXME: apply a proper libtool fix
|
# FIXME: apply a proper libtool fix
|
||||||
sed -i "s# /usr/local# ${SERENITY_INSTALL_ROOT}/usr/local#g" "${SERENITY_INSTALL_ROOT}"/usr/local/lib/libvorbis*.la
|
sed_in_place "s# /usr/local# ${SERENITY_INSTALL_ROOT}/usr/local#g" "${SERENITY_INSTALL_ROOT}"/usr/local/lib/libvorbis*.la
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ configopts=(
|
||||||
post_install() {
|
post_install() {
|
||||||
# readline specifies termcap as a dependency in its pkgconfig file, without checking if it exists.
|
# readline specifies termcap as a dependency in its pkgconfig file, without checking if it exists.
|
||||||
# Remove it manually to keep other ports from discarding readline because termcap is supposedly missing.
|
# Remove it manually to keep other ports from discarding readline because termcap is supposedly missing.
|
||||||
sed -i -e '/^Requires.private:/s/termcap//' "${SERENITY_INSTALL_ROOT}/usr/local/lib/pkgconfig/readline.pc"
|
sed_in_place '/^Requires.private:/s/termcap//' "${SERENITY_INSTALL_ROOT}/usr/local/lib/pkgconfig/readline.pc"
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,5 +32,5 @@ post_install() {
|
||||||
timidity_cfg_path="${SERENITY_INSTALL_ROOT}/etc/timidity.cfg"
|
timidity_cfg_path="${SERENITY_INSTALL_ROOT}/etc/timidity.cfg"
|
||||||
mkdir -p "$(dirname ${timidity_cfg_path})"
|
mkdir -p "$(dirname ${timidity_cfg_path})"
|
||||||
cp "${eaw_pats_host_dir}/timidity.cfg" "${timidity_cfg_path}"
|
cp "${eaw_pats_host_dir}/timidity.cfg" "${timidity_cfg_path}"
|
||||||
sed -i "s#^dir .*#dir ${eaw_pats_dir}#g" "${timidity_cfg_path}"
|
sed_in_place "s#^dir .*#dir ${eaw_pats_dir}#g" "${timidity_cfg_path}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue