[vlc-devel] [PATCH 3.0 34/41] contrib: qt: Fix AddStaticLink.sh script for macOS

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 7 15:11:33 CEST 2020


From: Marvin Scholz <epirat07 at gmail.com>

The macOS sed does not support -i without an argument,
additionally it does not support the spaces in the
command string so multiple uses of -e are needed.

(cherry picked from commit 685e5482669b21804e78b6064426a93803e62994)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
---
 contrib/src/qt/AddStaticLink.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/src/qt/AddStaticLink.sh b/contrib/src/qt/AddStaticLink.sh
index ec6be88771..6833fa992b 100755
--- a/contrib/src/qt/AddStaticLink.sh
+++ b/contrib/src/qt/AddStaticLink.sh
@@ -6,7 +6,7 @@
 #
 # This could also be done in configure.ac to detect what plugins are available and where to add them
 
-PREFIX=$(realpath "$1")
+PREFIX=$(python -c "import os; print(os.path.realpath('$1'))")
 PLUGIN_PATH="$3"
 PLUGIN_NAME="$4"
 
@@ -28,10 +28,10 @@ fi
 LIBS=$(sed -e "/QMAKE_PRL_LIBS/ { \
              s/QMAKE_PRL_LIBS =//; \
              s@$PREFIX/lib@\${libdir}@g; \
-             s@\$\$\[QT_INSTALL_LIBS\]@\${libdir}@g; p \
-         }; d"  $PRL_SOURCE )
+             s@\$\$\[QT_INSTALL_LIBS\]@\${libdir}@g;" -e "p" \
+         -e "};" -e "d"  $PRL_SOURCE )
 
 # prepend the plugin that uses the module
-sed -i -e "s# -l${2}# -l${PLUGIN_NAME} -l${2}#" $PC_DEST
+sed -i.bak -e "s# -l${2}# -l${PLUGIN_NAME} -l${2}#" $PC_DEST
 # add the plugin static dependencies to the ones of the module
-sed -i -e "s#Libs.private: #Libs.private: $LIBS -L\${prefix}/${PLUGIN_PATH} #" $PC_DEST
+sed -i.bak -e "s#Libs.private: #Libs.private: $LIBS -L\${prefix}/${PLUGIN_PATH} #" $PC_DEST
-- 
2.26.2



More information about the vlc-devel mailing list