darkice: revision for berkeley-db

4 files in darkice call 'src_short_to_float_array' like so:

> src_short_to_float_array ( ... , converterData.data_in, ...);

This function is defined in 'samplerate.h' of 'libsamplerate' as:

> void src_short_to_float_array (const short *in, float *out, int len) ;

What causes the problem is that converterData is of type SRC_DATA
(also defined in 'samplerate.h') and its 'data_in' member is of type 'const float'

By calling 'src_short_to_float_array', `darkice` wants to
modify constant member 'data_in' of 'converterData'.

We allow this by casting away 'const' modifier of 'data_in' for this call.
This commit is contained in:
Maxim Belkin 2016-12-09 10:01:35 -06:00 committed by ilovezfs
parent 84d1cab7db
commit 62c97d5267

View file

@ -3,6 +3,7 @@ class Darkice < Formula
homepage "http://www.darkice.org/"
url "https://downloads.sourceforge.net/project/darkice/darkice/1.3/darkice-1.3.tar.gz"
sha256 "2c0d0faaa627c0273b2ce8b38775a73ef97e34ef866862a398f660ad8f6e9de6"
revision 1
bottle do
cellar :any
@ -21,6 +22,12 @@ class Darkice < Formula
depends_on "jack"
def install
# Fixes "invalid conversion from 'const float*' to 'float*' [-fpermissive]"
# Upstream issue Oct 25, 2016 https://github.com/rafael2k/darkice/issues/119
# Suggested fix Oct 25, 2016 https://github.com/rafael2k/darkice/pull/120
["aacPlusEncoder.cpp", "FaacEncoder.cpp", "OpusLibEncoder.cpp", "VorbisLibEncoder.cpp"].each do |f|
inreplace "src/#{f}", ", converterData.data_in", ", const_cast<float*>( converterData.data_in )"
end
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--sysconfdir=#{etc}",