瀏覽代碼

Change build system to meson done.

Luciano 7 年之前
父節點
當前提交
3e0d023fb9
共有 6 個文件被更改,包括 6 次插入226 次删除
  1. 0 119
      Makefile
  2. 2 2
      README.md
  3. 0 43
      git2lv2.mk
  4. 0 59
      lv2ttl/sdenoise.ttl.in
  5. 3 2
      meson.build
  6. 1 1
      static_rnnoise.sh

+ 0 - 119
Makefile

@@ -1,119 +0,0 @@
-#!/usr/bin/make -f
-OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only
-PREFIX ?= /usr/local
-CFLAGS ?= $(OPTIMIZATIONS) -Wall
-
-STRIP?=strip
-STRIPFLAGS?=-s
-DEBUG?=0
-
-sdenoise_VERSION?=$(shell git describe --tags HEAD 2>/dev/null | sed 's/-g.*$$//;s/^v//' || echo "LV2")
-###############################################################################
-LIB_EXT=.so
-
-LV2DIR?=$(PREFIX)/lib/lv2
-LDFLAGS= -lm
-LV2NAME=sdenoise
-BUNDLE=sdenoise.lv2
-BUILDDIR=build/
-SRCDIR=src/
-TTLDIR=lv2ttl/
-targets=
-
-UNAME=$(shell uname)
-ifeq ($(UNAME),Darwin)
-  LV2LDFLAGS=-dynamiclib
-  LIB_EXT=.dylib
-  EXTENDED_RE=-E
-  STRIPFLAGS=-u -r -arch all -s lv2syms
-  targets+=lv2syms
-else
-  LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic
-  LIB_EXT=.so
-  EXTENDED_RE=-r
-endif
-
-ifneq ($(XWIN),)
-  CC=$(XWIN)-gcc
-  STRIP=$(XWIN)-strip
-  LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic -Wl,--as-needed
-  LIB_EXT=.dll
-  override LDFLAGS += -static-libgcc -static-libstdc++
-endif
-
-targets+=$(BUILDDIR)$(LV2NAME)$(LIB_EXT)
-
-###############################################################################
-# extract versions
-LV2VERSION=$(snrepel_VERSION)
-include git2lv2.mk
-
-# check for build-dependencies
-ifeq ($(shell pkg-config --exists lv2 || echo no), no)
-  $(error "LV2 SDK was not found")
-endif
-
-override CFLAGS += -fPIC -std=c99
-override CFLAGS += `pkg-config --cflags lv2`
-
-#compiling against a static build of rnnoise
-ifneq ($(shell test -f ./rnnoise/.libs/librnnoise.a || echo no), no)
-  LV2CFLAGS= -I./rnnoise/include
-  LOADLIBES=./rnnoise/.libs/librnnoise.a
-else
-	$(error "RNNoise library was not found")
-endif
-
-#for debug building
-ifeq ($(DEBUG), 1)
-  override CFLAGS += -g3 -DDEBUG
-else
-  override CFLAGS += -DNDEBUG
-endif
-
-# build target definitions
-default: all
-
-all: $(BUILDDIR)manifest.ttl $(BUILDDIR)$(LV2NAME).ttl $(targets)
-
-lv2syms:
-	echo "_lv2_descriptor" > lv2syms
-
-$(BUILDDIR)manifest.ttl: $(TTLDIR)manifest.ttl.in
-	@mkdir -p $(BUILDDIR)
-	sed "s/@LV2NAME@/$(LV2NAME)/;s/@LIB_EXT@/$(LIB_EXT)/" \
-	  $(TTLDIR)manifest.ttl.in > $(BUILDDIR)manifest.ttl
-
-$(BUILDDIR)$(LV2NAME).ttl: $(TTLDIR)$(LV2NAME).ttl.in
-	@mkdir -p $(BUILDDIR)
-	sed "s/@VERSION@/lv2:microVersion $(LV2MIC) ;lv2:minorVersion $(LV2MIN) ;/g" \
-		$(TTLDIR)$(LV2NAME).ttl.in > $(BUILDDIR)$(LV2NAME).ttl
-
-$(BUILDDIR)$(LV2NAME)$(LIB_EXT): $(SRCDIR)$(LV2NAME).c
-	@mkdir -p $(BUILDDIR)
-	$(CC) $(CFLAGS) $(LV2CFLAGS) \
-		-o $(BUILDDIR)$(LV2NAME)$(LIB_EXT) $(SRCDIR)$(LV2NAME).c \
-	  -shared $(LV2LDFLAGS) $(LDFLAGS) $(LOADLIBES)
-
-
-ifeq ($(DEBUG), 0)
-	$(STRIP) $(STRIPFLAGS) $(BUILDDIR)$(LV2NAME)$(LIB_EXT)
-endif
-
-# install/uninstall/clean target definitions
-install: all
-	install -d $(DESTDIR)$(LV2DIR)/$(BUNDLE)
-	install -m644 $(BUILDDIR)$(LV2NAME)$(LIB_EXT) $(DESTDIR)$(LV2DIR)/$(BUNDLE)
-	install -m644 $(BUILDDIR)manifest.ttl $(BUILDDIR)$(LV2NAME).ttl $(DESTDIR)$(LV2DIR)/$(BUNDLE)
-
-uninstall:
-	rm -f $(DESTDIR)$(LV2DIR)/$(BUNDLE)/manifest.ttl
-	rm -f $(DESTDIR)$(LV2DIR)/$(BUNDLE)/$(LV2NAME).ttl
-	rm -f $(DESTDIR)$(LV2DIR)/$(BUNDLE)/$(LV2NAME)$(LIB_EXT)
-	-rmdir $(DESTDIR)$(LV2DIR)/$(BUNDLE)
-
-clean:
-	rm -f $(BUILDDIR)manifest.ttl $(BUILDDIR)$(LV2NAME).ttl $(BUILDDIR)$(LV2NAME)$(LIB_EXT) lv2syms
-	-test -d $(BUILDDIR) && rmdir $(BUILDDIR) || true
-
-.PHONY: clean all install uninstall

+ 2 - 2
README.md

@@ -10,6 +10,6 @@ Commands to compile everything needed
 ```bash
   chmod +x static_rnnoise.sh
   ./static_rnnoise.sh
-  make
-  sudo make install
+  meson build --buildtype release && cd build
+  ninja && sudo ninja install
 ```

+ 0 - 43
git2lv2.mk

@@ -1,43 +0,0 @@
-
-###############################################################################
-# extract versions
-GIT_REV_REGEXP="([0-9][0-9]*)\.([0-9][0-9]*)(\.([0-9][0-9]*))?(-([0-9][0-9]*))?(-g([a-f0-9]+))?"
-
-override MAJOR=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\1/)
-override MINOR=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\2/)
-override MICRO=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\4/)
-override GITREV=$(shell echo $(LV2VERSION) | sed $(EXTENDED_RE) -e s/$(GIT_REV_REGEXP)/\\6/)
-
-ifeq ($(MAJOR),)
-  override MAJOR=0
-endif
-ifeq ($(MINOR),)
-  override MINOR=0
-endif
-ifeq ($(MICRO),)
-  override MICRO=0
-endif
-
-$(info Version: $(LV2VERSION) -> $(MAJOR) $(MINOR) $(MICRO) $(GITREV))
-
-# version requirements, see
-# http://lv2plug.in/ns/lv2core/#minorVersion
-# http://lv2plug.in/ns/lv2core/#microVersion
-ifeq ($(GITREV),)
-# even numbers for tagged releases
-  override LV2MIN = $(shell expr $(MAJOR) \* 65536 + $(MINOR) \* 256 + $(MICRO) \* 2 )
-  override LV2MIC = 0
-else
-# odd-numbers for all non tagged git versions
-  override LV2MIN = $(shell expr $(MAJOR) \* 65536 + $(MINOR) \* 256 + $(MICRO) \* 2 + 1 )
-  override LV2MIC = $(shell expr $(GITREV) \* 2 + 1)
-endif
-
-ifeq ($(LV2MIN),)
-  $(error "Cannot extract required LV2 minor-version parameter")
-endif
-ifeq ($(LV2MIC),)
-  $(error "Cannot extract required LV2 micro-version parameter")
-endif
-
-$(info LV2 Version: $(LV2MIN) $(LV2MIC))

+ 0 - 59
lv2ttl/sdenoise.ttl.in

@@ -1,59 +0,0 @@
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix param: <http://lv2plug.in/ns/ext/parameters#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
-@prefix pprop: <http://lv2plug.in/ns/ext/port-props#> .
-@prefix units: <http://lv2plug.in/ns/extensions/units#> .
-
-
-<http://example.com/lucianodato#me>
-  a foaf:Person ;
-  foaf:name "Luciano Dato" ;
-  foaf:homepage <https://github.com/lucianodato> ;
-  foaf:mbox <mailto:lucianodato@gmail.com> .
-
-<https://github.com/lucianodato/speech-denoiser>
-  a lv2:Plugin, lv2:SpectralPlugin, lv2:UtilityPlugin, doap:Project ;
-  doap:maintainer <http://example.com/lucianodato#me> ;
-  doap:license <https://opensource.org/licenses/LGPL-3.0> ;
-  doap:name "Speech Denoiser";
-  @VERSION@
-  lv2:optionalFeature lv2:hardRTCapable ;
-
-  lv2:port [
-    a lv2:InputPort, lv2:ControlPort ;
-    lv2:index 0 ;
-    lv2:name "Enable" ;
-    lv2:symbol "enable" ;
-    lv2:default 1.0 ;
-    lv2:minimum 0.0 ;
-    lv2:maximum 1.0 ;
-    lv2:portProperty lv2:toggled, pprop:notOnGUI;
-    lv2:designation <http://ardour.org/lv2/processing#enable>;
-  ], [
-    a lv2:OutputPort,
-      lv2:ControlPort ;
-    lv2:name "latency" ;
-    lv2:index 1 ;
-    lv2:symbol "latency" ;
-    lv2:minimum 0 ;
-    lv2:maximum 8192 ;
-    lv2:portProperty lv2:reportsLatency, lv2:integer, pprop:notOnGUI ;
-    units:unit units:samples ;
-  ], [
-    a lv2:AudioPort,
-      lv2:InputPort ;
-    lv2:index 2 ;
-    lv2:symbol "input" ;
-    lv2:name "Input" ;
-  ], [
-    a lv2:AudioPort,
-      lv2:OutputPort ;
-    lv2:index 3 ;
-    lv2:symbol "output" ;
-    lv2:name "Output" ;
-  ];
-.

+ 3 - 2
meson.build

@@ -10,7 +10,8 @@ src = 'src/sdenoise.c'
 cc = meson.get_compiler('c')
 
 #handling rnnoise static library
-lib_rnnoise = cc.find_library('rnnoise',required : true)
+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)
@@ -38,7 +39,7 @@ if current_os == 'windows'
 endif
 
 #build of the shared object
-shared_library(lv2_name,src,name_prefix: '',dependencies: nr_dep,c_args: cflags,install: true,install_dir : i_path)
+shared_library(lv2_name,src,name_prefix: '',include_directories: inc_rnnoise,dependencies: nr_dep,c_args: cflags,install: true,install_dir : i_path)
 
 #Configure manifest ttl in order to replace the correct shared object extension
 manifest_conf = configuration_data()

+ 1 - 1
static_rnnoise.sh

@@ -9,4 +9,4 @@ CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
 	./configure \
   --disable-examples --disable-doc \
 	--disable-shared --enable-static
-make -j2
+make -j2