forked from McStasMcXtrace/McCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_windows_mcxtrace
executable file
·72 lines (63 loc) · 3.66 KB
/
build_windows_mcxtrace
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
#!/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
WORK=`pwd`
# Ensure our 3rd party modules are in place and updated
git submodule init
git submodule update --recursive --remote --recursive --remote
# Workaround for having CRLF linefeeds in a couple of windows packages
rsync -avz --delete --exclude=".svn/" mcxtrace-comps/ mcxtrace-comps-win
find mcxtrace-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 relevant comps to allow compilation with gsl
find mcxtrace-comps-win -type f -name \*.comp -exec sed -i 's+@MCCODE_LIB@/miniconda3/+c:\\mcxtrace-'${1}'\\miniconda3\\Library\\mingw-w64\\+g' {} \;
# 64-bit
./mkdist mcxtrace $1 "" "" mingw64 "" -- nsis64
./mkdist mcxtrace-comps $1 mcxtrace-comps-win "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-perl-cmdline $1 tools/Legacy-Perl-cmdline-win/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-perl $1 tools/Legacy-Perl-win/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-matlab-mxplot $1 tools/matlab/mcplot/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mccodelib $1 tools/Python/mccodelib/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxplot-matplotlib $1 tools/Python/mcplot/matplotlib/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxplot-pyqtgraph $1 tools/Python/mcplot/pyqtgraph/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxrun $1 tools/Python/mcrun/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxgui $1 tools/Python/mcgui/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxdisplay-pyqtgraph $1 tools/Python/mcdisplay/pyqtgraph/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxdisplay-matplotlib $1 tools/Python/mcdisplay/matplotlib/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-tools-python-mxdisplay-webgl $1 tools/Python/mcdisplay/webgl/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-clusterscripts $1 tools/cluster-scripts/ "" mingw64 "" -- nsis64
./mkdist mcxtrace-manuals $1 docpkg/manuals/mcxtrace/ "" mingw64 "o" -- nsis64
./mkdist mcxtrace-tools-python-mxdoc $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@/mcxtrace/g python-install.bat.in.2 > python-install.bat
sed s/@VERSION@/${1}/g docupdate.bat.in > docupdate.bat.in.2
sed s/@P@/mx/g docupdate.bat.in.2 >docupdate.bat.in.3
sed s/@FLAVOR@/mcxtrace/g docupdate.bat.in.3 > docupdate.bat
sed s/@VERSION@/${1}/g McXtrace-metapackage64.iss > McXtrace-${1}-metapackage64.iss
./iscc McXtrace-${1}-metapackage64.iss
mv Output/setup.exe dist/McXtrace-Metapackage-${1}-win64.exe
mkdir dist/extras
cp MSMPI/*.* dist/extras
cp NeXus/*.* dist/extras
cp Perl/*.msi dist/
# Needs creation : cp $WORK/INSTALL-McStas-2.x/Windows/README.md dist/
mkdir dist/single-packages
mv dist/mcxtrace-* dist/single-packages
# Needs creation : cp INSTALL-McStas-2.x/Windows/README.md dist
fi