[csproj] Update project files
[mono-project.git] / packaging / Windows / defs / mono
bloba396665b678f2016ec6a23541a35ee52e1ba6ebd
1 #!/bin/bash -xe
3 REPODIR=$(dirname $(realpath $0))/../../..
4 INSTALLDIR=$(realpath -m $(dirname $0)/../tmp/mono)
6 error()
8 echo "$(date "+%F@%T") :: $1" 1>&2
9 exit 1
12 report()
14 echo "$(date "+%F@%T") :: $1"
17 download()
19 wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
22 clean()
24 rm -rf ${INSTALLDIR}
27 build()
29 pushd ${REPODIR}
30 report "Building Mono"
31 mkdir -p ${INSTALLDIR}
32 EXTRA_CONF_FLAGS="--prefix=${INSTALLDIR}" CI_TAGS="win-i386,no-tests" scripts/ci/run-jenkins.sh || error "*** Could not run autogen ***"
33 popd
36 install()
38 pushd ${REPODIR}
39 MONO_EXECUTABLE=${REPODIR}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe make install || error "*** Installing to temporary prefix failed ***"
40 rm -f ${INSTALLDIR}/bin/mono-sgen.* \
41 ${INSTALLDIR}/bin/mono-boehm.* \
42 ${INSTALLDIR}/lib/libmono-2.0.* \
43 ${INSTALLDIR}/bin/libmonoboehm-2.0.* \
44 ${INSTALLDIR}/lib/libmonoboehm-2.0.* \
45 ${INSTALLDIR}/bin/libmonosgen-2.0.* \
46 ${INSTALLDIR}/lib/libmonosgen-2.0.* \
47 ${INSTALLDIR}/bin/*MonoPosixHelper.* \
48 ${INSTALLDIR}/lib/*MonoPosixHelper.* \
49 ${INSTALLDIR}/bin/mono \
50 ${INSTALLDIR}/bin/pedump \
51 ${INSTALLDIR}/bin/mono-package-runtime \
52 ${INSTALLDIR}/bin/monodis*
53 pushd ${REPODIR}
54 cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.exe ${INSTALLDIR}/bin/monodis.exe
55 cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.pdb ${INSTALLDIR}/bin/monodis.pdb
56 cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.exe ${INSTALLDIR}/bin/
57 cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.pdb ${INSTALLDIR}/bin/
58 cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.dll ${INSTALLDIR}/bin/
59 cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.pdb ${INSTALLDIR}/bin/
60 cp -a msvc/build/sgen/Win32/lib/Release/mono-2.0-sgen.lib ${INSTALLDIR}/lib/
61 cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.pdb ${INSTALLDIR}/lib/
62 cp -a msvc/build/sgen/Win32/lib/Release/libmono-static-sgen.lib ${INSTALLDIR}/lib/
63 cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.dll ${INSTALLDIR}/bin/
64 cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.pdb ${INSTALLDIR}/bin/
65 cp -a msvc/build/sgen/Win32/lib/Release/MonoPosixHelper.lib ${INSTALLDIR}/lib/
66 cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.pdb ${INSTALLDIR}/lib/
67 cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.exe ${INSTALLDIR}/bin/
68 cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.pdb ${INSTALLDIR}/bin/
69 cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.dll ${INSTALLDIR}/bin/
70 cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.pdb ${INSTALLDIR}/bin/
71 cp -a msvc/build/boehm/Win32/lib/Release/mono-2.0-boehm.lib ${INSTALLDIR}/lib/
72 cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.pdb ${INSTALLDIR}/lib/
73 if [ -e msvc/build/sgen/Win32/bin/Release/libmono-btls-shared.dll ]; then
74 cp -a msvc/build/sgen/Win32/bin/Release/libmono-btls-shared.dll ${INSTALLDIR}/bin/
76 cp -a msvc/build/boehm/Win32/lib/Release/libmono-static-boehm.lib ${INSTALLDIR}/lib/
77 cp -a ${INSTALLDIR}/bin/mono-sgen.exe ${INSTALLDIR}/bin/mono.exe
78 cp -a ${INSTALLDIR}/bin/mono-sgen.pdb ${INSTALLDIR}/bin/mono.pdb
79 popd
80 pushd ${INSTALLDIR}/bin
81 for i in *
82 do if [[ "`file -b $i`" == "POSIX shell script, ASCII text"* ]]
83 then RUNTIME=`grep -ho -m 1 "xbuild/.*/bin/\|[2,3,4]\.[0,5]/" $i | sed 's#/$##'`
84 if [ -n "$(grep -ho '.:/.*\.exe' $i)" ]
85 then EXENAME=$(basename `grep -ho '.:/.*\.exe' $i`)
87 if [ -f "../lib/mono/${RUNTIME}/${EXENAME}" ]
88 then sed "s#@@RUNTIME@@#${RUNTIME}#g" ${REPODIR}/packaging/Windows/resources/wrapper.bat > $i.bat
89 sed -i "s#@@COMMAND@@#${EXENAME}#g" $i.bat
90 sed -i 's#/#\\#g' $i.bat
92 sed -i "s#.:/.*/#\"\$\(cygpath -w \"\$\{BASH_SOURCE%/\*\}\"/../lib/mono/${RUNTIME}/\)\"#g" $i
93 sed -i 's#/.*/tmp/mono/bin#\"\$\{BASH_SOURCE%/\*\}\"#g' $i
95 done
96 unzip -jd . ${REPODIR}/pkgconfig.zip bin/pkg-config.exe
97 chmod a+x *.bat *.exe
98 popd
99 popd
101 find ${INSTALLDIR} -name monodoc.dll.config -exec sed -i 's#value=".*/lib/monodoc#value="C:\\Program Files (x86)\\Mono\\lib\\monodoc#g' {} \;
104 prerequisites()
106 which mcs 2>/dev/null || error "*** mcs is not in \$PATH ***"