5 class IronLanguagesPackage(GitHubTarballPackage
):
8 GitHubTarballPackage
.__init
__(self
,
9 'IronLanguages', 'iron-languages',
11 'de63773744ccf9873c1826470730ae0446fd64d7',
14 # override: avoid naming the package 'main' because of the repo name
16 'https://github.com/%{organization}/main/tarball/%{revision}']
17 self
.source_dir_name
= '%s-%s-%s' % (
18 self
.organization
, 'main', self
.revision
[:7])
21 self
.ironruby
= os
.path
.join(
22 self
.workspace
, 'ironruby', 'bin') + os
.sep
23 self
.ironpython
= os
.path
.join(
24 self
.workspace
, 'ironpython', 'bin') + os
.sep
26 'msbuild /p:DelaySign=true /p:Configuration=Release /p:OutDir="%{ironruby}" Solutions/Ruby.sln')
28 'msbuild /p:DelaySign=true /p:Configuration=Release /p:OutDir="%{ironpython}" Solutions/IronPython.Mono.sln')
30 def install_ruby_scripts(self
, path
, installdir
):
31 for cmd
, ext
in map(os
.path
.splitext
, os
.listdir(path
)):
34 wrapper
= os
.path
.join(self
.staged_prefix
, "bin", cmd
)
35 with
open(wrapper
, "w") as output
:
36 output
.write("#!/bin/sh\n")
38 "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format(
39 self
.staged_prefix
, installdir
, cmd
))
40 os
.chmod(wrapper
, 0o755)
42 def install_python_scripts(self
, path
, installdir
):
43 for cmd
, ext
in map(os
.path
.splitext
, os
.listdir(path
)):
46 wrapper
= os
.path
.join(self
.staged_prefix
, "bin", cmd
)
47 with
open(wrapper
, "w") as output
:
48 output
.write("#!/bin/sh\n")
50 'export IRONPYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/\n')
52 "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format(
53 self
.staged_prefix
, installdir
, cmd
))
54 os
.chmod(wrapper
, 0o755)
57 self
.sh("mkdir -p %{staged_prefix}/lib/ironruby/")
58 self
.sh("mkdir -p %{staged_prefix}/bin/")
59 self
.sh("cp -R %{ironruby} %{staged_prefix}/lib/ironruby/")
60 self
.install_ruby_scripts(self
.ironruby
, 'ironruby')
62 self
.sh("mkdir -p %{staged_prefix}/lib/ironpython/")
63 self
.sh("cp -R %{ironpython} %{staged_prefix}/lib/ironpython/")
64 self
.install_python_scripts(self
.ironpython
, 'ironpython')
66 IronLanguagesPackage()