aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libmikmod.rb
blob: c0fd7bc51417f0a29f61ef47076c55cfc0ba8f1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'formula'

class Libmikmod < Formula
  homepage 'http://mikmod.shlomifish.org'
  url 'http://mikmod.shlomifish.org/files/libmikmod-3.2.0.tar.gz'
  sha256 '734c8490bbf9b0c587920b92414dcfa3c2267838a0cdf698d5f1fb6bba8f661e'

  option 'with-debug', 'Enable debugging symbols'

  def install
    if build.with? 'debug'
      ENV.compiler == :clang ? ENV.Og : ENV.O2
    end

    # OSX has CoreAudio, but ALSA is not for this OS nor is SAM9407 nor ULTRA.
    args = %W[
      --prefix=#{prefix}
      --disable-alsa
      --disable-sam9407
      --disable-ultra
    ]
    args << '--with-debug' if build.with? 'debug'
    mkdir 'macbuild' do
      system "../configure", *args
      system "make install"
    end
  end

  def test
    system "#{bin}/libmikmod-config", "--version"
  end
end