forked from McStasMcXtrace/McCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_macos_Yosemite_mcstas
executable file
·66 lines (58 loc) · 2.99 KB
/
build_macos_Yosemite_mcstas
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
#!/bin/sh
if [ "x$1" = "x" ]; then
# No arguments
echo Please provide one argument,e.g : $0 2.0
exit 1;
fi
if [ "x$2" != "x" ]; then
# If this is a meta-package being built, we should aim for installation in /Applications...
# For the actual mcstas part, the packages need a 'deep' PREFIX
export MCINSTALL_PREFIX=/Applications/McStas-$1.app/Contents/Resources/
fi
# 64-bit Mac OS
./mkdist mcstas $1 "" "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-comps $1 "" "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-perl $1 tools/Legacy-Perl/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-matlab-mcplot $1 tools/matlab/mcplot/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcplot-chaco $1 tools/Python/mcplot/chaco/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcplot-matplotlib $1 tools/Python/mcplot/matplotlib/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcplot-gnuplot $1 tools/Python/mcplot/gnuplot/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcrun $1 tools/Python/mcrun/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcgui $1 tools/Python/mcgui/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcdisplay-x3d $1 tools/Python/mcdisplay/x3d/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcdisplay-r $1 tools/Python/mcdisplay/R/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcdisplay-matplotlib $1 tools/Python/mcdisplay/matplotlib/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-tools-python-mcdisplay-vtk $1 tools/Python/mcdisplay/VTK/ "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-manuals $1 doc/manuals/mcstas/ "" mac_yosemite "o" -- OSXpkg
if [ "x$2" != "x" ]; then
# If this is a meta-package being built, we should aim for installation in /opt/mccode
export MCINSTALL_PREFIX=/usr/local/
fi
./mkdist mcstas-gcc $1 support/MacOSX/gcc-hpc/10.10 "" mac_yosemite "" -- OSXpkg
./mkdist mcstas-openmpi $1 support/MacOSX/openmpi/10.10 "" mac_yosemite "" -- OSXpkg
if [ "x$2" != "x" ]; then
# Build the App bundle and meta-package also.
# The App needs a higher-level PREFIX
export MCINSTALL_PREFIX=/Applications/McStas-$1.app/
./mkdist mcstas-app $1 support/MacOSX/McCode.app/ "" mac_yosemite "" -- OSXpkg
OSXVER=`sw_vers -productVersion|cut -f -2 -d.|sed -e 's/\./\_/g'`
cd dist
DISTDIR=$PWD
# Use the Tk for perl5.18 for Yosemite
unzip ../support/MacOSX/Perl-Tk/Tk-*10_10*zip
# Use the SciPDL package for Yosemite
unzip ../support/MacOSX/SciPDL/SciPDL-v2.5-Yosemite.pkg.zip
cd -
# A hack for creating a metapackage
cp -rp meta-pkgs/OSX/McStas-Metapackage_10_10.pmdoc dist/McStas-Metapackage.pmdoc
cp -rp meta-pkgs/OSX/mcstas_logos_etc dist/logos_etc
cd dist/McStas-Metapackage.pmdoc
REGEX="s/@VERSION@/${1}/g"
REGEXDIR="s+@DISTDIR@+${DISTDIR}+g"
find . -name \*xml -exec sed -i\.bak $REGEX \{\} \;
find . -name \*xml -exec sed -i\.bak2 $REGEXDIR \{\} \;
rm *.bak
rm *.bak2
cd ..
open McStas-Metapackage.pmdoc
fi