From 2e64033100e8b0a426d8abc286a2851a2c83aa03 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 16 Dec 2020 10:56:05 +0200 Subject: [PATCH] build script: add samplerate target --- .gitignore | 1 + build.py | 14 ++++++++++++++ patch/samplerate.patch | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 patch/samplerate.patch diff --git a/.gitignore b/.gitignore index 6b71d2b1..728646f6 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ /deps/pcre/lib/libpcreposix.a /deps/png/bin/png-fix-itxt /deps/png/bin/pngfix +/deps/samplerate/bin/ /deps/sndfile/bin/ /deps/sndfile/include/sndfile.hh /deps/sndfile/lib/cmake/ diff --git a/build.py b/build.py index bd062192..92bfc72e 100755 --- a/build.py +++ b/build.py @@ -1181,6 +1181,19 @@ class PngTarget(ConfigureMakeStaticDependencyTarget): Target.update_prefix_shell_script(builder.prefix_path + '/bin/libpng16-config') +class SamplerateTarget(ConfigureMakeStaticDependencyTarget): + def __init__(self, name='samplerate'): + super().__init__(name) + + def prepare_source(self, builder: 'Builder'): + builder.download_source( + 'http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz', + '0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1') + + def detect(self, builder: 'Builder') -> bool: + return os.path.exists(builder.source_path + 'samplerate.pc.in') + + class SndFileTarget(CMakeStaticDependencyTarget): def __init__(self, name='sndfile'): super().__init__(name) @@ -1549,6 +1562,7 @@ class Builder(object): PcreTarget(), PkgConfigTarget(), PngTarget(), + SamplerateTarget(), SndFileTarget(), VorbisTarget(), VpxTarget(), diff --git a/patch/samplerate.patch b/patch/samplerate.patch new file mode 100644 index 00000000..b2060e13 --- /dev/null +++ b/patch/samplerate.patch @@ -0,0 +1,11 @@ +--- a/examples/audio_out.c ++++ b/examples/audio_out.c +@@ -432,7 +432,7 @@ + + #if (defined (__MACH__) && defined (__APPLE__)) /* MacOSX */ + +-#include ++#include + #include + + #define MACOSX_MAGIC MAKE_MAGIC ('M', 'a', 'c', ' ', 'O', 'S', ' ', 'X')