aboutsummaryrefslogtreecommitdiffstats
path: root/biology/tinker/scripts/build_viewer
blob: 24fb838c4fd09a2d1e1251186a437e4283f23893 (plain) (blame)
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
#!/bin/sh

# This builds the molecular viewer for tinker files.  It is a modified
# version of rasmol.  One of the problems with rasmol is that is only
# works at one color depth.  This script will build three viewers at
# different color depths, 8-bit, 16-bit, and 32-bit.  The binaries are
# called tview-8, tview-16, and tview-32 respectively.

cd ${WRKSRC}/../rasmol

cp Imakefile Imakefile.orig

sed s@/user/ponder@${PREFIX}/share@ Imakefile > Imakefile.temp

sed s@'ComplexProgramTarget(rasmol)'@'ComplexProgramTarget(tview-32)'@ \
    Imakefile.temp > Imakefile

xmkmf -a

make clean && make

sed -e s@'DEPTHDEF = -DTHIRTYTWOBIT'@'# DEPTHDEF = -DTHIRTYTWOBIT'@ \
    -e s@'# DEPTHDEF = -DSIXTEENBIT'@'DEPTHDEF = -DSIXTEENBIT'@ \
    -e s@'ComplexProgramTarget(rasmol)'@'ComplexProgramTarget(tview-16)'@ \
       Imakefile.temp > Imakefile

xmkmf -a

make clean && make

sed -e s@'DEPTHDEF = -DTHIRTYTWOBIT'@'# DEPTHDEF = -DTHIRTYTWOBIT'@ \
    -e s@'# DEPTHDEF = -DEIGHTBIT'@'DEPTHDEF = -DEIGHTBIT'@ \
    -e s@'ComplexProgramTarget(rasmol)'@'ComplexProgramTarget(tview-8)'@ \
       Imakefile.temp > Imakefile

xmkmf -a

make clean && make

# Restore Imakefile to original state so that rerunning this script does
# the right thing.
rm Imakefile.temp
mv Imakefile.orig Imakefile
xmkmf -a
make clean

exit 0