Просмотр исходного кода

Script install working. MacOS test is pending

Luciano Dato 7 лет назад
Родитель
Сommit
af8a6633f8
3 измененных файлов с 21 добавлено и 16 удалено
  1. 1 3
      .travis.yml
  2. 18 11
      install.sh
  3. 2 2
      meson.build

+ 1 - 3
.travis.yml

@@ -20,9 +20,7 @@ before_install:
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo pip3 install meson; fi
 
 script:
-  - chmod +x static_rnnoise.sh && ./static_rnnoise.sh
-  - meson build --buildtype release && cd build 
-  - ninja -v && sudo ninja install
+  - chmod +x install.sh && ./install.sh
   
 # deploy:
 #   provider: releases

+ 18 - 11
install.sh

@@ -7,32 +7,35 @@ INSTALL_DIR_MAC="/Library/Audio/Plug-Ins/LV2"
 # Detect the platform (similar to $OSTYPE)
 OS="`uname`"
 case $OS in
-  'Linux') OS='Linux';;
-  'Darwin') OS='Mac';;
+  'Linux') OS='Linux' && echo "You are on a Linux system. Building for Linux";;
+  'Darwin') OS='Mac' && echo "You are on a Mac system. Building for MacOS";;
   *) ;;
 esac
 
-#remove previous build
-rm -rf build rnnoise || true
+#remove previous builds
+rm -rf build || true
 
 #build rrnoise statically
-git clone https://github.com/xiph/rnnoise.git
-./rnnoise/autogen.sh
+wget https://github.com/xiph/rnnoise/archive/master.zip
+unzip -o master.zip && rm master.zip
+cd rnnoise-master && ./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/rnnoise/ --disable-examples --disable-doc --disable-shared --enable-static        
+    ./configure --disable-examples --disable-doc --disable-shared --enable-static        
 elif [ $OS = "Linux" ]; then
     CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
-    ./configure/rnnoise/ --disable-examples --disable-doc --disable-shared --enable-static
+    ./configure --disable-examples --disable-doc --disable-shared --enable-static
 fi
 
+make -j2
+cd ..
+
 #build the plugin in the new directory
 if [ $OS = "Linux" ]; then
-    echo "You are on a Linux system. Building for Linux"
     meson build --buildtype release --prefix $INSTALL_DIR_LINUX
 elif [ $OS = "Mac" ]; then
-    echo "You are on a Mac system. Building for MacOS"
     meson build --buildtype release --prefix $INSTALL_DIR_MAC
 fi
 
@@ -40,4 +43,8 @@ cd build
 ninja -v
 
 #install the plugin in the system
-sudo ninja install
+sudo ninja install
+
+#Remove static rnnoise build
+cd ..
+rm -rfv rnnoise-master

+ 2 - 2
meson.build

@@ -10,8 +10,8 @@ src = 'src/sdenoise.c'
 cc = meson.get_compiler('c')
 
 #handling rnnoise static library
-lib_rnnoise = cc.find_library('rnnoise',dirs: meson.current_source_dir() + '/rnnoise/.libs/',required : true)
-inc_rnnoise = include_directories('rnnoise/include')
+lib_rnnoise = cc.find_library('rnnoise',dirs: meson.current_source_dir() + '/rnnoise-master/.libs/',required : true)
+inc_rnnoise = include_directories('rnnoise-master/include')
 
 #dependencies for speech denoise
 m_dep = cc.find_library('m', required : true)