From 6ac6e869e2bfce290f86bde5e0de5fadbc6e4ce5 Mon Sep 17 00:00:00 2001 From: noriah Date: Wed, 6 Apr 2022 10:36:06 -0700 Subject: [PATCH] CGO deps disabled by default. see README.md for instructions on enabling. --- README.md | 30 +++++++++++------------------- catnip.go | 1 - fft/fftw.go | 2 +- fft/gonum.go | 2 +- portaudio.go | 2 +- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 55240ee..4c51d6e 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,11 @@

## it supports audio backends -- PortAudio (linux/macOS/*windblows**) -- PulseAudio (parec/FFmpeg) -- AVFoundation (macOS FFmpeg) - ALSA (linux FFmpeg) +- AVFoundation (macOS FFmpeg) - DirectShow (windblows FFmpeg) - -*portaudio is difficult on windows. by default it is disabled on windows. +- PortAudio (linux/macOS/windblows) +- PulseAudio (parec/FFmpeg) ## it depends on @@ -30,14 +28,14 @@ - github.com/lawl/pulseaudio - gonum.org/v1/gonum -- c libraries (optional, disable all with `CGO_ENABLED=0`) - - fftw (fftw3) (disable with `-tags nofftw`) - - portaudio (portaudio-2.0) (disable with `-tags noportaudio`) - - binaries - ffmpeg (required for FFmpeg backends) - parec (required for PulseAudio backend with parec) +- c libraries (optional, requires CGO - `CGO_ENABLED=1`) + - fftw (fftw3) (enable with `-tags withfftw`) + - portaudio (portaudio-2.0) (enable with `-tags withportaudio`) + ## get it ```sh @@ -50,17 +48,11 @@ cd catnip # build and install catnip go install -# without cgo -CGO_ENABLED=0 go install - -# without portaudio on linux/unix/macOS -go install -tags noportaudio - -# with portaudio on windows -go install -tags portonwin +# with portaudio +go install -tags withportaudio -# with fftw3 on windows -go install -tags fftwonwin +# with fftw3 +go install -tags withfftw ``` ## run it diff --git a/catnip.go b/catnip.go index 57a452d..67ce9c7 100644 --- a/catnip.go +++ b/catnip.go @@ -181,7 +181,6 @@ func catnip(cfg *config) error { // - super smooth detail view func newZeroConfig() config { return config{ - backend: "portaudio", sampleRate: 44100, sampleSize: 1024, smoothFactor: 80.15, diff --git a/fft/fftw.go b/fft/fftw.go index 49e6898..f064d70 100644 --- a/fft/fftw.go +++ b/fft/fftw.go @@ -1,4 +1,4 @@ -//go:build cgo && ((!windows && !nofftw) || (windows && fftwonwin)) +//go:build cgo && withfftw package fft diff --git a/fft/gonum.go b/fft/gonum.go index 02fc5c5..5a4a83b 100644 --- a/fft/gonum.go +++ b/fft/gonum.go @@ -1,4 +1,4 @@ -//go:build !cgo || nofftw || (windows && !fftwonwin) +//go:build !cgo || !withfftw package fft diff --git a/portaudio.go b/portaudio.go index 9542f92..ce5ebac 100644 --- a/portaudio.go +++ b/portaudio.go @@ -1,4 +1,4 @@ -//go:build cgo && ((!windows && !noportaudio) || (windows && portonwin)) +//go:build cgo && withportaudio package main