2009-10-21 03:11:35 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Libmikmod < Formula
|
2012-04-10 23:22:08 +00:00
|
|
|
homepage 'http://mikmod.shlomifish.org'
|
|
|
|
url 'http://mikmod.shlomifish.org/files/libmikmod-3.2.0b3.tar.gz'
|
|
|
|
sha256 '3e2e04caff8726d5ceca0d8a5a1a43528cc627f935e92291aded1d87603ade4f'
|
2011-10-24 09:02:15 +00:00
|
|
|
|
|
|
|
def options
|
2012-04-10 23:22:08 +00:00
|
|
|
[[ '--with-debug', 'Enable debugging symbols']]
|
2012-03-17 19:27:45 +00:00
|
|
|
end
|
|
|
|
|
2009-10-21 03:11:35 +00:00
|
|
|
def install
|
2012-04-10 23:22:08 +00:00
|
|
|
ENV.x11
|
|
|
|
if ARGV.include? '--with-debug' then
|
|
|
|
(ENV.compiler == :clang) ? ENV.Og : ENV.O2
|
|
|
|
end
|
2011-10-24 09:02:15 +00:00
|
|
|
|
2012-04-10 23:22:08 +00:00
|
|
|
# The following four patches have been merged upstream by Shlomi.
|
|
|
|
# Remove them at 3.2.0b4 or 3.2.0 stable. The explanation for these is
|
|
|
|
# recorded here: https://gist.github.com/2355354
|
2011-10-24 09:02:15 +00:00
|
|
|
inreplace 'playercode/virtch_common.c', '(handle<MAXSAMPLEHANDLES)',
|
|
|
|
'(Samples && handle<MAXSAMPLEHANDLES)'
|
|
|
|
|
|
|
|
inreplace 'playercode/mdriver.c', 'extern MikMod_callback_t vc_callback',
|
|
|
|
'MikMod_callback_t vc_callback'
|
|
|
|
inreplace 'playercode/virtch_common.c', 'MikMod_callback_t vc_callback',
|
|
|
|
'extern MikMod_callback_t vc_callback'
|
|
|
|
|
|
|
|
inreplace 'playercode/virtch2.c', 'vc_callback((char*)vc_tickbuf, portion)',
|
|
|
|
'vc_callback((unsigned char*)vc_tickbuf, portion)'
|
|
|
|
|
|
|
|
|
|
|
|
# OSX has CoreAudio, but ALSA is not for this OS nor is SAM9407 nor ULTRA.
|
2012-04-10 23:22:08 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--disable-alsa
|
|
|
|
--disable-sam9407
|
|
|
|
--disable-ultra
|
|
|
|
]
|
|
|
|
args << '--with-debug' if ARGV.include? '--with-debug'
|
2012-02-22 04:48:36 +00:00
|
|
|
mkdir 'macbuild' do
|
2011-10-24 09:02:15 +00:00
|
|
|
system "../configure", *args
|
|
|
|
system "make install"
|
|
|
|
end
|
2009-10-21 03:11:35 +00:00
|
|
|
end
|
|
|
|
end
|