File: SConscript.cocoa

package info (click to toggle)
rlvm 0.12-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 16,348 kB
  • sloc: cpp: 92,030; ansic: 39,532; perl: 768; python: 181; sh: 171; makefile: 7
file content (73 lines) | stat: -rw-r--r-- 2,723 bytes parent folder | download
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
73
# Builds the rlvm.app with all binaries and files.

import re
import string

Import('env')

static_env = env.Clone()

def MergeEverythingButSDLMain(env, cmd):
  """
  Filters out the libSDLmain.a argument from the return value of sdl-config.
  """
  p = re.compile('libSDLmain')
  def isSDLMain(x):
    return not p.search(x)
  filtered_args = filter(isSDLMain, cmd.split(' '))
  filtered_string = " ".join(filtered_args)
  return env.MergeFlags(filtered_args, 0)

static_env.ParseConfig("sdl-config --static-libs", MergeEverythingButSDLMain)

cocoarlvm_files = [
  # Technically cross platform, but put here for SDL dependency.
  "src/MachineBase/RLVMInstance.cpp",

  "src/Platforms/osx/CocoaRLVMInstance.mm",
  "src/Platforms/osx/SDLMain.mm"
]

# Builds a fullstatic version of rlvm and then builds a bundle
static_env.RlvmProgram('rlvm-static', cocoarlvm_files,
                       use_lib_set = ["SDL"],
                       full_static_build = True,
                       rlvm_libs = ["guichan_platform", "system_sdl", "rlvm"])

static_env.InstallAs(target='$OUTPUT_DIR/rlvm.app/Contents/Info.plist',
                     source='src/Platforms/osx/Info.plist.in')
static_env.Install(target='$OUTPUT_DIR/rlvm.app/Contents/Resources/',
                   source=["COPYING.TXT", "GPL.TXT", "README.TXT",
                           'resources/rlvm.icns', '$OUTPUT_DIR/locale/'])
static_env.InstallAs(
  target='$OUTPUT_DIR/rlvm.app/Contents/Resources/'
         'Japanese.lproj/InfoPlist.strings',
  source='src/Platforms/osx/StubInfoPlist.strings')
static_env.InstallAs(
  target='$OUTPUT_DIR/rlvm.app/Contents/Resources/'
         'English.lproj/InfoPlist.strings',
  source='src/Platforms/osx/StubInfoPlist.strings')
static_env.InstallAs(target='$OUTPUT_DIR/rlvm.app/Contents/MacOS/rlvm',
                     source='rlvm-static')

AddOption('--dmgname', action='store',
          help='Builds a release package with the attached name. '
               '(Example: "rlvm 0.12" -> "rlvm_0.12.dmg"')

if GetOption('dmgname'):
  dmgname = GetOption('dmgname')
  filename = string.replace(dmgname, ' ', '_') + ".dmg"
  if not GetOption('fullstatic'):
    print "**** WARNING: RELEASE BUILDS MUST HAVE --fullstatic ****"
    exit

  static_env.Command('$OUTPUT_DIR/' + filename,
                     '$OUTPUT_DIR/rlvm.app/',
                     "scripts/pkg-dmg "
                     "  --tempdir build/"
                     "  --source build/rlvm.app"
                     "  --target build/" + filename +
                     "  --sourcefile"
                     "  --volname \"" + dmgname + "\""
                     "  --copy src/Platforms/osx/dmg-ds-store:/.DS_Store"
                     "  --format UDBZ")