adds linux build of pa_shim, removes Suppressor dependency
This commit is contained in:
parent
c58143404f
commit
acaa305dfa
9 changed files with 34 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
|||
*.swp
|
||||
*.so
|
||||
*.o
|
||||
deps/deps.jl
|
||||
*.wav
|
||||
|
|
6
LICENSE
6
LICENSE
|
@ -19,3 +19,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
suppressor.jl includes code from the Suppressor.jl package, licensed under the
|
||||
MIT "Expat" License:
|
||||
|
||||
Copyright (c) 2016: Ismael Venegas Castelló.
|
||||
|
|
1
REQUIRE
1
REQUIRE
|
@ -2,6 +2,5 @@ julia 0.6-
|
|||
BinDeps
|
||||
SampledSignals 0.3.0
|
||||
RingBuffers 1.0.0
|
||||
Suppressor
|
||||
@osx Homebrew
|
||||
@windows WinRPM
|
||||
|
|
4
deps/src/Makefile
vendored
4
deps/src/Makefile
vendored
|
@ -17,7 +17,7 @@ endif
|
|||
# file extensions and platform-specific libs
|
||||
ifeq ($(OS), WINNT)
|
||||
LIBS +=
|
||||
LDFLAGS += -L../../../RingBuffers/deps/usr/lib -lpa_ringbuffer
|
||||
LDFLAGS += -shared -L../../../RingBuffers/deps/usr/lib -lpa_ringbuffer
|
||||
INC +=
|
||||
SHACMD = sha256sum
|
||||
SHLIB_EXT = dll
|
||||
|
@ -32,7 +32,7 @@ else ifeq ($(OS), Darwin)
|
|||
else
|
||||
LIBS +=
|
||||
INC +=
|
||||
LDFLAGS += -L../../../RingBuffers/deps/usr/lib -lpa_ringbuffer
|
||||
LDFLAGS += -shared
|
||||
SHLIB_EXT = so
|
||||
SHACMD = sha256sum
|
||||
endif
|
||||
|
|
BIN
deps/usr/lib/pa_shim.so
vendored
Executable file
BIN
deps/usr/lib/pa_shim.so
vendored
Executable file
Binary file not shown.
|
@ -4,7 +4,7 @@ module PortAudio
|
|||
|
||||
using SampledSignals
|
||||
using RingBuffers
|
||||
using Suppressor
|
||||
#using Suppressor
|
||||
|
||||
using Base: AsyncCondition
|
||||
|
||||
|
@ -14,6 +14,7 @@ import Base: read, read!, write, flush
|
|||
|
||||
# Get binary dependencies loaded from BinDeps
|
||||
include("../deps/deps.jl")
|
||||
include("suppressor.jl")
|
||||
include("pa_shim.jl")
|
||||
include("libportaudio.jl")
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
const libpa_shim = Libdl.find_library(
|
||||
["pa_shim"],
|
||||
[joinpath(dirname(@__FILE__), "..", "deps", "usr", "lib")])
|
||||
|
||||
function init_pa_shim()
|
||||
global const libpa_shim = Libdl.find_library(
|
||||
["pa_shim"],
|
||||
[joinpath(dirname(@__FILE__), "..", "deps", "usr", "lib")])
|
||||
shim_dlib = Libdl.dlopen(libpa_shim)
|
||||
# pointer to the shim's process callback
|
||||
global const shim_processcb_c = Libdl.dlsym(shim_dlib, :pa_shim_processcb)
|
||||
|
|
20
src/suppressor.jl
Normal file
20
src/suppressor.jl
Normal file
|
@ -0,0 +1,20 @@
|
|||
# while waiting for this PR to get merged: https://github.com/Ismael-VC/Suppressor.jl/pull/12
|
||||
# we'll just include the relevant code here
|
||||
|
||||
macro suppress_err(block)
|
||||
quote
|
||||
if ccall(:jl_generating_output, Cint, ()) == 0
|
||||
ORIGINAL_STDERR = STDERR
|
||||
err_rd, err_wr = redirect_stderr()
|
||||
err_reader = @async readstring(err_rd)
|
||||
end
|
||||
|
||||
value = $(esc(block))
|
||||
|
||||
if ccall(:jl_generating_output, Cint, ()) == 0
|
||||
redirect_stderr(ORIGINAL_STDERR)
|
||||
close(err_wr)
|
||||
end
|
||||
value
|
||||
end
|
||||
end
|
|
@ -201,8 +201,7 @@ end
|
|||
PortAudio.versioninfo(io)
|
||||
result = split(String(take!((io))), "\n")
|
||||
# make sure this is the same version I tested with
|
||||
@test startswith(result[1], "PortAudio V19-devel")
|
||||
@test result[2] == "Version: 1899"
|
||||
@test startswith(result[1], "PortAudio V19")
|
||||
@test result[3] == "Shim Source Hash: 4ea2a8526b"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue