add alsa_plugins (#70)

* add alsa_plugins

* avoid get!
This commit is contained in:
bramtayl 2021-05-21 08:27:33 -04:00 committed by GitHub
parent e8c1e6a8f4
commit 5bdd8975a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -4,12 +4,14 @@ repo = "https://github.com/JuliaAudio/PortAudio.jl.git"
version = "1.1.1"
[deps]
alsa_plugins_jll = "5ac2f6bb-493e-5871-9171-112d4c21a6e7"
libportaudio_jll = "2d7b7beb-0762-5160-978e-1ab83a1e8a31"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
SampledSignals = "bd7594eb-a658-542f-9e75-4c4d8908c167"
[compat]
julia = "1.3"
alsa_plugins_jll = "1.2.2"
libportaudio_jll = "19.6.0"
SampledSignals = "2.1.1"

View file

@ -1,5 +1,6 @@
module PortAudio
using alsa_plugins_jll: alsa_plugins_jll
using libportaudio_jll, SampledSignals
import Base: eltype, show
@ -402,6 +403,11 @@ function __init__()
confdir = searchdirs[confdir_idx]
ENV[envkey] = confdir
end
plugin_key = "ALSA_PLUGIN_DIR"
if plugin_key keys(ENV) && alsa_plugins_jll.is_available()
ENV[plugin_key] = joinpath(alsa_plugins_jll.artifact_dir, "lib", "alsa-lib")
end
end
# initialize PortAudio on module load. libportaudio prints a bunch of
# junk to STDOUT on initialization, so we swallow it.