build script: add samplerate target

This commit is contained in:
alexey.lysiuk 2020-12-16 10:56:05 +02:00
parent aa2344dff2
commit 2e64033100
3 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View file

@ -42,6 +42,7 @@
/deps/pcre/lib/libpcreposix.a /deps/pcre/lib/libpcreposix.a
/deps/png/bin/png-fix-itxt /deps/png/bin/png-fix-itxt
/deps/png/bin/pngfix /deps/png/bin/pngfix
/deps/samplerate/bin/
/deps/sndfile/bin/ /deps/sndfile/bin/
/deps/sndfile/include/sndfile.hh /deps/sndfile/include/sndfile.hh
/deps/sndfile/lib/cmake/ /deps/sndfile/lib/cmake/

View file

@ -1181,6 +1181,19 @@ class PngTarget(ConfigureMakeStaticDependencyTarget):
Target.update_prefix_shell_script(builder.prefix_path + '/bin/libpng16-config') 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): class SndFileTarget(CMakeStaticDependencyTarget):
def __init__(self, name='sndfile'): def __init__(self, name='sndfile'):
super().__init__(name) super().__init__(name)
@ -1549,6 +1562,7 @@ class Builder(object):
PcreTarget(), PcreTarget(),
PkgConfigTarget(), PkgConfigTarget(),
PngTarget(), PngTarget(),
SamplerateTarget(),
SndFileTarget(), SndFileTarget(),
VorbisTarget(), VorbisTarget(),
VpxTarget(), VpxTarget(),

11
patch/samplerate.patch Normal file
View file

@ -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 <Carbon.h>
+#include <Carbon/Carbon.h>
#include <CoreAudio/AudioHardware.h>
#define MACOSX_MAGIC MAKE_MAGIC ('M', 'a', 'c', ' ', 'O', 'S', ' ', 'X')