add pocketfft

This commit is contained in:
Sebastien Bourdeauducq 2023-08-23 19:57:01 +08:00
parent b184b71169
commit f28c0965ec
3 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,7 @@ SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends
CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I$(POCKETFFT_DIR)
CXXFLAGS += -g -Wall -Wformat -O2
LIBS = -L$(TINYALSA_DIR)/lib

View File

@ -7,6 +7,11 @@
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
imgui_dir = "${pkgs.imgui}/include/imgui";
pocketfft = pkgs.fetchgit {
url = "https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git";
rev = "ecd78caa1c862e18fb1a55bcd4e30a05430b01f6";
hash = "sha256-xl7Tr1A1cqXhAL1Bljfk68R3AB1xOgkH15LHKxjYoSc=";
};
in rec {
packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation {
name = "microsa";
@ -15,6 +20,7 @@
propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.alsa-lib ];
preBuild = ''
export IMGUI_DIR=${imgui_dir}
export POCKETFFT_DIR=${pocketfft}
'';
installPhase = ''
mkdir -p $out/bin

View File

@ -14,6 +14,9 @@
#include <alsa/asoundlib.h>
#include <pocketfft_hdronly.h>
static std::atomic<bool> terminate_dsp;
static snd_pcm_t* pcm;