Explorar o código

Rebasing after upstream changes

CrocoDuck %!s(int64=7) %!d(string=hai) anos
pai
achega
7b14b510e9
Modificáronse 2 ficheiros con 38 adicións e 18 borrados
  1. 31 15
      install.sh
  2. 7 3
      static_rnnoise.sh

+ 31 - 15
install.sh

@@ -12,20 +12,39 @@ case $OS in
   *) ;;
 esac
 
-#build rrnoise statically
-cd rnnoise && ./autogen.sh
-mv ../ltmain.sh ./ && ./autogen.sh #This is weird but otherwise it won't work
-
-if [ $OS = "Mac" ]; then
-    CFLAGS="-fvisibility=hidden -fPIC " \ 
-    ./configure --disable-examples --disable-doc --disable-shared --enable-static        
-elif [ $OS = "Linux" ]; then
-    CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
-    ./configure --disable-examples --disable-doc --disable-shared --enable-static
+#Remove static rnnoise build
+if [ -d rnnoise ]; then
+    read -p "Do you want to remove previous rnnoise build? (y/n)?" choice
+    case "$choice" in 
+    y|Y ) rm -rf rnnoise && echo "Previous rnnoise build removed";;
+    n|N ) echo "Previous rnnoise build was not removed";;
+    * ) echo "invalid";;
+    esac
 fi
 
-make -j2
-cd ..
+#only rebuild rnnoise if the user prefers to
+if [ ! -d rnnoise ]; then
+    #build rrnoise statically
+    wget https://github.com/xiph/rnnoise/archive/master.zip
+    # When using git or submodule to get rnnoise, the directory will be called
+    # rnnoise, but when using the zip it will be rnnoise-master. Renaming to
+    # rnnoise to keep unity.
+    unzip -o master.zip && mv rnnoise-master rnnoise && rm master.zip
+    cd rnnoise && ./autogen.sh
+    mv ../ltmain.sh ./ && ./autogen.sh #This is weird but otherwise it won't work
+
+    if [ $OS = "Mac" ]; then
+        CFLAGS="-fvisibility=hidden -fPIC " \ 
+        ./configure --disable-examples --disable-doc --disable-shared --enable-static        
+    elif [ $OS = "Linux" ]; then
+        CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
+        ./configure --disable-examples --disable-doc --disable-shared --enable-static
+    fi
+
+    # Perhaps best to remove j? Or do:
+    make -j$(nproc)
+    cd ..
+fi
 
 #remove previous builds
 rm -rf build || true
@@ -39,6 +58,3 @@ fi
 
 cd build
 ninja -v
-
-#install the plugin in the system
-sudo ninja install

+ 7 - 3
static_rnnoise.sh

@@ -1,9 +1,11 @@
 #!/usr/bin/env bash
 
-rm -rf rnnoise || true
-git clone https://github.com/xiph/rnnoise.git
+# No need for these with submodule
+# rm -rf rnnoise || true
+# git clone https://github.com/xiph/rnnoise.git
 cd rnnoise/
 ./autogen.sh
+mv ../ltmain.sh ./ && ./autogen.sh # Dang, what with this thing
 
 if [ "$(uname)" == "Darwin" ]; then
   CFLAGS="-fvisibility=hidden -fPIC " \ 
@@ -27,4 +29,6 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
 #   --disable-shared --enable-static
 fi
 
-make -j2
+# Got to remove the -j, as Arch's makepkg uses the user configured one, and that
+# should not be overidden.
+make