Jelajahi Sumber

buildscript: Fetch python3 path during buildLibVLC

Soomin Lee 6 tahun lalu
induk
melakukan
2c5e091121
1 mengubah file dengan 10 tambahan dan 9 penghapusan
  1. 10 9
      compileAndBuildVLCKit.sh

+ 10 - 9
compileAndBuildVLCKit.sh

@@ -253,6 +253,10 @@ buildLibVLC() {
     export OBJCFLAGS="${OBJCFLAGS}"
     export LDFLAGS="${LDFLAGS}"
 
+    fetch_python3_path
+
+    export PATH="${PYTHON3_PATH}:${VLCROOT}/extras/tools/build/bin:${VLCROOT}/contrib/${TARGET}/bin:${VLC_PATH}:/usr/bin:/bin:/usr/sbin:/sbin"
+
     spushd ${VLCROOT}/contrib
 
     info "Compiling third-party libraries"
@@ -1069,15 +1073,12 @@ if [ "$VLCROOT" = "" ]; then
     spopd
 fi
 
-# get python installation
-python3Path=$(echo /Library/Frameworks/Python.framework/Versions/3.*/bin | awk '{print $1;}')
-if [ ! -d "$python3Path" ]; then
-    python3Path=""
-fi
-
-export PATH="$python3Path:${VLCROOT}/extras/tools/build/bin:${VLCROOT}/contrib/${TARGET}/bin:${VLC_PATH}:/usr/bin:/bin:/usr/sbin:/sbin"
-
-echo `pwd`
+fetch_python3_path() {
+    PYTHON3_PATH=$(echo /Library/Frameworks/Python.framework/Versions/3.*/bin | awk '{print $1;}')
+    if [ ! -d "${PYTHON3_PATH}" ]; then
+        PYTHON3_PATH=""
+    fi
+}
 
 #
 # Build time