aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/vice.rb
blob: 5928871de58d99cb7cac5250449ed8d1228d35c3 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require 'formula'

class Vice <Formula
  @url='http://www.zimmers.net/anonftp/pub/cbm/crossplatform/emulators/VICE/vice-2.1.tar.gz'
  @homepage='http://www.viceteam.org/'
  @md5='a4cca1aad12e12ac7f37d6c85310ade8'

  def patches
    DATA
  end

  def install
    ENV.libpng
    
    if MACOS_VERSION == 10.6
      # Cannot build this version under 10.6 with LLVM
      ENV.gcc_4_2
    end

    # Update the audio driver for 64 bit, backported from trunk
    inreplace 'src/sounddrv/soundcoreaudio.c',
      "#ifdef __i386__",
      "#if defined(__x86_64__) || defined(__i386__)"
      
    # Disable the zlibtest, we know we have it.
    # Use Cocoa instead of X
    system "./configure", "--prefix=#{prefix}", 
                          "--disable-debug", 
                          "--disable-dependency-tracking",
                          "--with-cocoa",
                          "--without-x",
                          "--disable-zlibtest"
    system "make"
    system "make bindist"
    
    libexec.install Dir['vice-macosx-*/*']
    
    # We could trim down the .app sizes a bit more if we only kept
    # the proper .icns files in the proper .app bundles...
    Pathname.glob libexec+'*.app' do |d|
      appname = File.basename(d, '.app')
  
      Pathname.glob d+'Contents/Resources/x*.icns' do |g|
        if File.basename(g, '.icns') != appname
          File.unlink g
        end
      end
    end
    
    # A better approach to the above would be to modify the
    # make-bindist.sh script to not copy extraneous icons
    # in the first place.
  end
  
  def caveats
    "Cocoa apps for these emulators have been installed to #{libexec}."
  end
end


__END__
--- vice/src/arch/unix/macosx/make-bindist.sh	2009/04/13 09:31:24	20670
+++ vice/src/arch/unix/macosx/make-bindist.sh	2009/09/09 19:44:00	21480
@@ -34,6 +34,8 @@
   BIN_FORMAT=ub
 elif [ x"$BIN_TYPE" = "xexecutable i386" ]; then
   BIN_FORMAT=i386
+elif [ x"$BIN_TYPE" = "x64-bit executable" ]; then
+  BIN_FORMAT=x86_64
 elif [ x"$BIN_TYPE" = "xexecutable ppc" ]; then
   BIN_FORMAT=ppc
 else