diff --git a/contrib/src/sndfile/SHA512SUMS b/contrib/src/sndfile/SHA512SUMS
new file mode 100644
index 0000000000000000000000000000000000000000..ad45e4bd6dd04fbcac5a980ad97ff1163bbf3224
--- /dev/null
+++ b/contrib/src/sndfile/SHA512SUMS
@@ -0,0 +1 @@
+4ca9780ed0a915aca8a10ef91bf4bf48b05ecb85285c2c3fe7eef1d46d3e0747e61416b6bddbef369bd69adf4b796ff5f61380e0bc998906b170a93341ba6f78  libsndfile-1.0.25.tar.gz
diff --git a/contrib/src/sndfile/carbon.patch b/contrib/src/sndfile/carbon.patch
new file mode 100644
index 0000000000000000000000000000000000000000..22d89bae541c95afc8feb79da094804b8eed8cab
--- /dev/null
+++ b/contrib/src/sndfile/carbon.patch
@@ -0,0 +1,10 @@
+--- a/programs/sndfile-play.c.orig	2014-06-26 18:33:49.000000000 -0400
++++ b/programs/sndfile-play.c	2014-06-26 18:33:52.000000000 -0400
+@@ -63,7 +63,6 @@
+ 	#include 	<sys/soundcard.h>
+ 
+ #elif (defined (__MACH__) && defined (__APPLE__))
+-	#include <Carbon.h>
+ 	#include <CoreAudio/AudioHardware.h>
+ 
+ #elif defined (HAVE_SNDIO_H)
diff --git a/contrib/src/sndfile/rules.mak b/contrib/src/sndfile/rules.mak
new file mode 100644
index 0000000000000000000000000000000000000000..5f5ff9c6e8deb2e5939bd2025b5e984acb2b1d69
--- /dev/null
+++ b/contrib/src/sndfile/rules.mak
@@ -0,0 +1,27 @@
+# SNDFILE
+SNDFILE_VERSION := 1.0.25
+SNDFILE_URL := http://www.mega-nerd.com/libsndfile/files/libsndfile-$(SNDFILE_VERSION).tar.gz
+
+PKGS += sndfile
+ifeq ($(call need_pkg,"sndfile"),)
+PKGS_FOUND += sndfile
+endif
+
+DEPS_sndfile = ogg vorbis flac
+
+$(TARBALLS)/libsndfile-$(SNDFILE_VERSION).tar.gz:
+	$(call download,$(SNDFILE_URL))
+
+.sum-sndfile: libsndfile-$(SNDFILE_VERSION).tar.gz
+
+sndfile: libsndfile-$(SNDFILE_VERSION).tar.gz .sum-sndfile
+	$(UNPACK)
+	$(APPLY) $(SRC)/sndfile/soundcard.patch
+	$(APPLY) $(SRC)/sndfile/carbon.patch
+	$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && mv config.guess config.sub Cfg
+	$(MOVE)
+
+.sndfile: sndfile
+	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
+	cd $< && $(MAKE) install
+	touch $@
diff --git a/contrib/src/sndfile/soundcard.patch b/contrib/src/sndfile/soundcard.patch
new file mode 100644
index 0000000000000000000000000000000000000000..298d0e12bb94e29ce812d0e50265ccff04a73edb
--- /dev/null
+++ b/contrib/src/sndfile/soundcard.patch
@@ -0,0 +1,16 @@
+--- a/programs/sndfile-play.c.orig	2014-06-12 16:00:39.348060215 -0400
++++ b/programs/sndfile-play.c	2014-06-12 16:01:05.660059438 -0400
+@@ -52,7 +52,12 @@
+ 	#include <sys/time.h>
+ #endif
+ 
+-#if defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__)
++#if defined(__ANDROID__)
++	#include 	<fcntl.h>
++	#include 	<sys/ioctl.h>
++	#include 	<linux/soundcard.h>
++
++#elif defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__)
+ 	#include 	<fcntl.h>
+ 	#include 	<sys/ioctl.h>
+ 	#include 	<sys/soundcard.h>