forked from McStasMcXtrace/McCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_windows_mcstas
executable file
·89 lines (77 loc) · 4.15 KB
/
build_windows_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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
PATH=$PATH:$PWD/tools/download-tool
if [ "x$1" = "x" ]; then
# No arguments
echo Please provide one argument,e.g : $0 2.0
exit 1;
fi
# Ensure our 3rd party modules are in place and updated
THIRDPARTY=`ls 3rdparty | grep -v patches`
cd 3rdparty
echo $THIRDPARTY | xargs -n1 rm -r
cd -
git submodule init
git submodule update --recursive --remote --recursive --remote
for MODULE in `echo $THIRDPARTY`
do
if [ -d "3rdparty/patches/${MODULE}" ]; then
echo Making McCode cmake modules available for $MODULE
rsync -avz cmake/ 3rdparty/${MODULE}/
echo Applying McCode patches to 3rdparty/${MODULE}
cp -rp 3rdparty/patches/${MODULE}/* 3rdparty/${MODULE}/
fi
done
WORK=`pwd`
# Workaround for having CRLF linefeeds in a couple of windows packages
rsync -avz --delete --exclude=".svn/" --exclude="NCrystal_sample.comp" --exclude="NCrystal_example.instr" mcstas-comps/ mcstas-comps-win
find mcstas-comps-win -type f -not -name \*.off -exec unix2dos \{\} \;
rsync -avz --delete --exclude=".svn/" tools/Legacy-Perl/ tools/Legacy-Perl-win
rsync -avz --delete --exclude=".svn/" tools/Legacy-Perl-cmdline/ tools/Legacy-Perl-cmdline-win
find tools/Legacy-Perl-win -type f -exec unix2dos \{\} \;
find tools/Legacy-Perl-cmdline-win -type f -exec unix2dos \{\} \;
# Patch the Multilayer_sample to allow compilation with GSL
sed -i 's+@MCCODE_LIB@/miniconda3/+c:\\mcstas-'${1}'\\miniconda3\\Library\\mingw-w64\\+g' mcstas-comps-win/contrib/Multilayer_Sample.comp
# 64-bit
./mkdist mcstas $1 "" "" mingw64 "" -- nsis64
./mkdist mcstas-comps $1 mcstas-comps-win "" mingw64 "" -- nsis64
./mkdist mcstas-tools-perl $1 tools/Legacy-Perl-win/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-perl-cmdline $1 tools/Legacy-Perl-cmdline-win/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-matlab-mcplot $1 tools/matlab/mcplot/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcplot-pyqtgraph $1 tools/Python/mcplot/pyqtgraph/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcplot-matplotlib $1 tools/Python/mcplot/matplotlib/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcplot-svg $1 tools/Python/mcplot/svg/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcrun $1 tools/Python/mcrun/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcresplot $1 tools/Python/mcresplot/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcgui $1 tools/Python/mcgui/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mccodelib $1 tools/Python/mccodelib/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcdisplay-webgl $1 tools/Python/mcdisplay/webgl/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcdisplay-pyqtgraph $1 tools/Python/mcdisplay/pyqtgraph/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcdisplay-mantid $1 tools/Python/mcdisplay/mantid_xml/ "" mingw64 "" -- nsis64
./mkdist mcstas-clusterscripts $1 tools/cluster-scripts/ "" mingw64 "" -- nsis64
./mkdist mcstas-manuals $1 docpkg/manuals/mcstas/ "" mingw64 "" -- nsis64
./mkdist mcstas-tools-python-mcdoc $1 tools/Python/mcdoc/ "" mingw64 "" -- nsis64
if [ "x$2" != "x" ]; then
# Build the meta-packages also
cd meta-pkgs/windows/Support
if [ ! -f Miniconda3-latest-Windows-x86_64.exe ]; then
echo Sorry! I need to download a Miniconda3 for embedding - will take some time...
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
fi
cd ..
rm -f python-install.bat.in.2 python-install.bat docupdate.bat.in.2 docupdate.bat
sed s/@VERSION@/${1}/g python-install.bat.in > python-install.bat.in.2
sed s/@FLAVOR@/mcstas/g python-install.bat.in.2 > python-install.bat
sed s/@VERSION@/${1}/g docupdate.bat.in > docupdate.bat.in.2
sed s/@P@/mc/g docupdate.bat.in.2 >docupdate.bat.in.3
sed s/@FLAVOR@/mcstas/g docupdate.bat.in.3 > docupdate.bat
sed s/@VERSION@/${1}/g McStas-metapackage64.iss > McStas-${1}-metapackage64.iss
./iscc McStas-${1}-metapackage64.iss
mv Output/setup.exe dist/McStas-Metapackage-${1}-win64.exe
mkdir dist/extras
cp MSMPI/*.* dist/extras
cp NeXus/*.* dist/extras
cp Perl/*.msi dist/
cp $WORK/INSTALL-McStas-2.x/Windows/README.md dist/
mkdir dist/single-packages
mv dist/mcstas-* dist/single-packages
fi