~dlh/armagetronad/os-x-toolkit

« back to all changes in this revision

Viewing changes to os-x-toolkit.rb

  • Committer: Daniel Lee Harple
  • Date: 2019-11-02 05:13:04 UTC
  • Revision ID: leeharple@gmail.com-20191102051304-dja2hf43mli1jjt3
Update libraries

* Use 10.3 SDK
* Add SDL 1.2 libraries. Only one of SDL1 or SDL2 can be installed in the
  toolkit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
  libs = {}
8
8
 
9
9
  libs["SDL"] = Builder.new { |config, arch|
10
 
    archive = fetch("http://www.libsdl.org/release/SDL2-2.0.3.dmg")
 
10
    archive = fetch("http://www.libsdl.org/release/SDL-1.2.15.dmg")
 
11
    source = open_dmg(archive)
 
12
    copy_framework(source, "SDL", arch)
 
13
    close_dmg(source)
 
14
  }
 
15
 
 
16
  libs["SDL_image"] = Builder.new { |config, arch|
 
17
    archive = fetch("http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.dmg")
 
18
    source = open_dmg(archive)
 
19
    copy_framework(source, "SDL_image", arch)
 
20
    close_dmg(source)
 
21
  }
 
22
 
 
23
  libs["SDL_mixer"] = Builder.new { |config, arch|
 
24
    archive = fetch("http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.dmg")
 
25
    source = open_dmg(archive)
 
26
    framework = copy_framework(source, "SDL_mixer", arch)
 
27
    close_dmg(source)
 
28
  }
 
29
 
 
30
  libs["zthread"] = Builder.new("lib/libzthread.a") { |config, arch|
 
31
    archive = fetch("http://prdownloads.sourceforge.net/zthread/ZThread-2.3.2.tar.gz")
 
32
    source = expand_tgz(archive)
 
33
    Dir.chdir(source) do
 
34
      apply_patch(path("patches/ZThread.patch"))
 
35
      config.env_variables(arch)
 
36
      system("./configure", "--prefix", install_path(arch), "--disable-shared")
 
37
      system("make install")
 
38
    end
 
39
  }
 
40
 
 
41
  libs["SDL2"] = Builder.new { |config, arch|
 
42
    archive = fetch("http://www.libsdl.org/release/SDL2-2.0.10.dmg")
11
43
    source = open_dmg(archive)
12
44
    copy_framework(source, "SDL2", arch)
13
45
    close_dmg(source)
14
46
  }
15
47
 
16
 
  libs["SDL_image"] = Builder.new { |config, arch|
17
 
    archive = fetch("http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.dmg")
 
48
  libs["SDL2_image"] = Builder.new { |config, arch|
 
49
    archive = fetch("http://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.5.dmg")
18
50
    source = open_dmg(archive)
19
51
    copy_framework(source, "SDL2_image", arch)
20
52
    close_dmg(source)
21
53
  }
22
54
 
23
 
  libs["SDL_mixer"] = Builder.new { |config, arch|
24
 
    archive = fetch("http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.0.dmg")
 
55
  libs["SDL2_mixer"] = Builder.new { |config, arch|
 
56
    archive = fetch("http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.dmg")
25
57
    source = open_dmg(archive)
26
58
    framework = copy_framework(source, "SDL2_mixer", arch)
27
59
    close_dmg(source)
37
69
  }
38
70
 
39
71
  libs["libpng"] = Builder.new("lib/libpng.a") { |config, arch|
40
 
    archive = fetch("http://prdownloads.sourceforge.net/libpng/libpng-1.6.18.tar.gz?download")
 
72
    archive = fetch("http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.gz?download")
41
73
    source = expand_tgz(archive)
42
74
    Dir.chdir(source) do
43
75
      config.env_variables(arch)
68
100
  }
69
101
 
70
102
  libs["protobuf"] = Builder.new("lib/libprotobuf.a") { |config, arch|
71
 
    archive = fetch("https://github.com/google/protobuf/releases/download/2.6.1/protobuf-2.6.1.tar.gz")
 
103
    archive = fetch("https://github.com/protocolbuffers/protobuf/archive/v2.6.1.tar.gz")
72
104
    source = expand_tgz(archive)
73
105
    Dir.chdir(source) do
 
106
      system("PATH=/usr/local/bin:$PATH autoreconf -f -i")
74
107
      config.env_variables(arch)
75
108
      system("./configure", "--prefix", install_path(arch), "--disable-shared")
76
109
      system("make install")
90
123
      "ppc" => "32"
91
124
    }[arch]
92
125
 
93
 
    archive = fetch("http://prdownloads.sourceforge.net/boost/boost_1_58_0.tar.gz?download")
 
126
    archive = fetch("https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz")
94
127
    source = expand_tgz(archive)
95
128
    Dir.chdir(source) do
96
129
      config.env_variables(arch)
97
130
      system("./bootstrap.sh", "--prefix=#{install_path(arch)}")
98
 
      system("./b2 -d0 --with-thread architecture=#{architecture_option} address-model=#{address_model_option} link=static cxxflags=#{escape_sh(ENV["CXXFLAGS"])} cflags=#{escape_sh(ENV["CFLAGS"])} linkflags=#{escape_sh(ENV["LDFLAGS"])} install")
 
131
      system("./b2 -d0 --with-system --with-thread architecture=#{architecture_option} address-model=#{address_model_option} link=static cxxflags=#{escape_sh(ENV["CXXFLAGS"])} cflags=#{escape_sh(ENV["CFLAGS"])} linkflags=#{escape_sh(ENV["LDFLAGS"])} install")
99
132
    end
100
133
  }
101
134
 
234
267
    end
235
268
  end
236
269
 
237
 
  def apply_patch(patch_file, base_directory)
238
 
    Dir.chdir(base_directory) do
239
 
      IO.popen("patch -p0", "w") do |io|
240
 
        io.puts(File.read(patch_file))
241
 
        io.close_write
242
 
      end
 
270
  def apply_patch(patch_file)
 
271
    IO.popen("patch -p1", "w") do |io|
 
272
      io.puts(File.read(patch_file))
 
273
      io.close_write
243
274
    end
244
275
  end
245
276
end