Pārlūkot izejas kodu

add NONFREE_AND_GPL

gemer 4 gadi atpakaļ
vecāks
revīzija
37a97ba3d7
1 mainītis faili ar 20 papildinājumiem un 13 dzēšanām
  1. 20 13
      install-ffmpeg

+ 20 - 13
install-ffmpeg

@@ -15,6 +15,7 @@ CONFIGURE_OPTIONS=()
 useGitLib=""
 packageURL=http://face3d.4dage.com:7005/zhangyupeng/4dage-ffmpeg/raw/master/packages.tar.gz
 speakerURL=http://face3d.4dage.com:7005/zhangyupeng/speech-denoiser.git
+NONFREE_AND_GPL=false
 # Check for Apple Silicon
 if [[ ("$(uname -m)" == "arm64") && ("$OSTYPE" == "darwin"*) ]]; then
   # If arm64 AND darwin (macOS)
@@ -203,6 +204,11 @@ while (($# > 0)); do
     if [[ "$1" == "--build" || "$1" =~ 'b' ]]; then
       bflag='-b'
     fi
+      if [[ "$1" == "--enable-gpl-and-non-free" ]]; then
+      CONFIGURE_OPTIONS+=("--enable-nonfree")
+      CONFIGURE_OPTIONS+=("--enable-gpl")
+      NONFREE_AND_GPL=true
+    fi
     if [[ "$1" == "--cleanup" || "$1" =~ 'c' && ! "$1" =~ '--' ]]; then
       cflag='-c'
       cleanup
@@ -500,22 +506,23 @@ if build "xvidcore"; then
 fi
 CONFIGURE_OPTIONS+=("--enable-libxvid")
 
-if build "vid_stab"; then
-  download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz"
-
-  if $MACOS_M1; then
+if $NONFREE_AND_GPL; then
+  if build "vid_stab"; then
+    download "https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz" "vid.stab-1.1.0.tar.gz"
 
-    curl -s -o "$PACKAGES/vid.stab-1.1.0/fix_cmake_quoting.patch" https://raw.githubusercontent.com/Homebrew/formula-patches/5bf1a0e0cfe666ee410305cece9c9c755641bfdf/libvidstab/fix_cmake_quoting.patch
-    patch -p1 <fix_cmake_quoting.patch
-  fi
+    if $MACOS_M1; then
+      curl -s -o "$PACKAGES/vid.stab-1.1.0/fix_cmake_quoting.patch" https://raw.githubusercontent.com/Homebrew/formula-patches/5bf1a0e0cfe666ee410305cece9c9c755641bfdf/libvidstab/fix_cmake_quoting.patch
+      patch -p1 <fix_cmake_quoting.patch
+    fi
 
-  execute cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=off .
-  execute make
-  execute make install
+    execute cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DUSE_OMP=OFF -DENABLE_SHARED=off .
+    execute make
+    execute make install
 
-  build_done "vid_stab"
+    build_done "vid_stab"
+  fi
+  CONFIGURE_OPTIONS+=("--enable-libvidstab")
 fi
-CONFIGURE_OPTIONS+=("--enable-libvidstab")
 
 if build "av1"; then
   # download "https://aomedia.googlesource.com/aom/+archive/b52ee6d44adaef8a08f6984390de050d64df9faa.tar.gz" "av1.tar.gz" "av1"
@@ -736,7 +743,7 @@ download "https://www.ffmpeg.org/releases/ffmpeg-4.4.tar.gz"
   --pkg-config-flags="--static" \
   --prefix="${WORKSPACE}"
 
-  
+
 execute make -j $MJOBS
 execute make install