Bladeren bron

Merge pull request #8 from CrocoDuckoDucks/master

Submodule and few changes to help packaging
Luciano Dato 7 jaren geleden
bovenliggende
commit
2cfee03fdd
6 gewijzigde bestanden met toevoegingen van 26 en 17 verwijderingen
  1. 3 0
      .gitmodules
  2. 2 2
      README.md
  3. 10 9
      install.sh
  4. 3 3
      meson.build
  5. 1 0
      rnnoise
  6. 7 3
      static_rnnoise.sh

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "rnnoise"]
+	path = rnnoise
+	url = https://github.com/xiph/rnnoise

+ 2 - 2
README.md

@@ -17,8 +17,8 @@ To compile and install this plug-in you will need the LV2 SDK, Meson build syste
 Installation 
 -----
 ```bash
-  git clone https://github.com/lucianodato/speech-denoiser.git
-  cd speech-denoiser 
+  git clone --recursive https://github.com/CrocoDuckoDucks/speech-denoiser.git
+  cd speech-denoiser
   chmod +x install.sh && ./install.sh
 ```
 

+ 10 - 9
install.sh

@@ -13,21 +13,24 @@ case $OS in
 esac
 
 #Remove static rnnoise build
-if [ -d rnnoise-master ]; then
+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-master && echo "Previous rnnoise build removed";;
+    y|Y ) rm -rf rnnoise && echo "Previous rnnoise build removed";;
     n|N ) echo "Previous rnnoise build was not removed";;
     * ) echo "invalid";;
     esac
 fi
 
 #only rebuild rnnoise if the user prefers to
-if [ ! -d rnnoise-master ]; then
+if [ ! -d rnnoise ]; then
     #build rrnoise statically
     wget https://github.com/xiph/rnnoise/archive/master.zip
-    unzip -o master.zip && rm master.zip
-    cd rnnoise-master && ./autogen.sh
+    # 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
@@ -38,7 +41,8 @@ if [ ! -d rnnoise-master ]; then
         ./configure --disable-examples --disable-doc --disable-shared --enable-static
     fi
 
-    make -j2
+    # Perhaps best to remove j? Or do:
+    make -j$(nproc)
     cd ..
 fi
 
@@ -54,6 +58,3 @@ fi
 
 cd build
 ninja -v
-
-#install the plugin in the system
-sudo ninja install

+ 3 - 3
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-master/.libs/',required : true)
-inc_rnnoise = include_directories('rnnoise-master/include')
+lib_rnnoise = cc.find_library('rnnoise',dirs: meson.current_source_dir() + '/rnnoise/.libs/',required : true)
+inc_rnnoise = include_directories('rnnoise/include')
 
 #dependencies for speech denoise
 m_dep = cc.find_library('m', required : true)
@@ -47,4 +47,4 @@ manifest_conf.set('LIB_EXT',extension)
 configure_file(input : 'lv2ttl/manifest.ttl.in',output : 'manifest.ttl',configuration : manifest_conf)
 
 #add manifest.ttl and nrepel.ttl to be installed with the shared object
-install_data(['build/manifest.ttl', 'lv2ttl/sdenoise.ttl'],install_dir : install_folder)
+install_data(['build/manifest.ttl', 'lv2ttl/sdenoise.ttl'],install_dir : install_folder)

+ 1 - 0
rnnoise

@@ -0,0 +1 @@
+Subproject commit 91ef401f4c3536c6de999ac609262691ec888c4c

+ 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