ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/build_utils/install.py
Revision: 1.5
Committed: Tue Apr 19 21:21:23 2016 UTC (8 years, 1 month ago) by schorsch
Content type: text/x-python
Branch: MAIN
CVS Tags: rad5R1
Changes since 1.4: +7 -0 lines
Log Message:
Build with VC2013 until text pipe bug is fixed; prepare for pyinstaller on scripts

File Contents

# User Rev Content
1 schorsch 1.1
2     import os
3    
4     def install_dir(env, il, sbase, tbase, dir):
5     fulldir = os.path.join(sbase, dir)
6     l = os.listdir(fulldir)
7     instdir = os.path.join(tbase, dir)
8     for item in l:
9     if item[0] == '.' or item[-1] in '%~' or item == 'CVS':
10     continue
11     elif os.path.isdir(os.path.join(fulldir, item)):
12     install_dir(env, il, sbase, tbase, os.path.join(dir, item))
13     else:
14     inst = env.Install(instdir, os.path.join(fulldir, item))
15     il.append(inst)
16    
17     def install_rlibfiles(env):
18     buildrlib = env['RAD_BUILDRLIB']
19     if buildrlib[0] == '#':
20     buildrlib = buildrlib[1:]
21     sbase = os.path.join(os.getcwd(), buildrlib)
22     il = []
23     install_dir(env, il, sbase, env['RAD_RLIBDIR'], '')
24     env.Append(RAD_RLIBINSTALL=il)
25    
26    
27     def install_manfiles(env):
28     buildman = env['RAD_BUILDMAN']
29     if buildman[0] == '#':
30     buildman = buildman[1:]
31     sbase = os.path.join(os.getcwd(), buildman)
32     il = []
33     install_dir(env, il, sbase, env['RAD_MANDIR'], '')
34     env.Append(RAD_MANINSTALL=il)
35    
36    
37 schorsch 1.3 def install_script(target, source, env):
38 schorsch 1.2 for t,s in map(None,target,source):
39     sf = open(str(s), 'r')
40     tf = open(str(t), 'w')
41     tf.write(sf.read())
42     os.chmod(str(t), 00755)
43    
44 schorsch 1.4 def install_tclscript(target, source, env):
45     # XXX posix only for the moment
46     for t,s in map(None, target,source):
47     bindir = os.path.split(t.get_abspath())[0]
48     instdir = os.path.split(bindir)[0]
49     tcllibdir = os.path.join(instdir, 'lib', 'tcl')
50     sf = open(str(s), 'r')
51     tf = open(str(t), 'w')
52     # as recommended in the wish manpage
53     tf.write('''#!/bin/sh\n''')
54     for line in sf.readlines():
55     if line.startswith('#!'):
56     tf.write('### ' + line)
57     if line.startswith('set radlib'):
58     # XXX this should really be handled by an envvar.
59     line = 'set radlib %s\n' % tcllibdir
60     tf.write(line)
61     os.chmod(str(t), 00755)
62 schorsch 1.5
63     def build_with_pyinstaller(targets, sources, env):
64     workpath = env.Dir('$RAD_BUILDOBJ', 'pybuild') # --workpath @
65     specpath = workpath # --specpath @
66     # -F # one-file
67     # --noconsole
68     pass