3 REPODIR=$(dirname $(realpath $0))/../../..
4 INSTALLDIR=$(realpath -m $(dirname $0)/../tmp/mono)
8 echo "$(date "+%F@%T") :: $1" 1>&2
14 echo "$(date "+%F@%T") :: $1"
19 wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
30 report "Building Mono"
31 mkdir -p ${INSTALLDIR}
32 WORKSPACE=${REPODIR} EXTRA_CONF_FLAGS="--prefix=${INSTALLDIR}" ghprbPullId=1 CI_TAGS="no-tests" label="w32" scripts/ci/run-jenkins.sh || error "*** Could not run autogen ***"
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}/lib/libmonoboehm-2.0.* \
44 ${INSTALLDIR}/lib/libmonosgen-2.0.* \
45 ${INSTALLDIR}/bin/MonoPosixHelper.* \
46 ${INSTALLDIR}/lib/MonoPosixHelper.* \
47 ${INSTALLDIR}/bin/mono \
48 ${INSTALLDIR}/bin/pedump \
49 ${INSTALLDIR}/bin/mono-package-runtime \
50 ${INSTALLDIR}/bin/monodis*
52 cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.exe ${INSTALLDIR}/bin/monodis.exe
53 cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.pdb ${INSTALLDIR}/bin/monodis.pdb
54 cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.exe ${INSTALLDIR}/bin/
55 cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.pdb ${INSTALLDIR}/bin/
56 cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.dll ${INSTALLDIR}/bin/
57 cp -a msvc/build/sgen/Win32/lib/Release/mono-2.0-sgen.lib ${INSTALLDIR}/lib/
58 cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.pdb ${INSTALLDIR}/lib/
59 cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.dll ${INSTALLDIR}/bin/
60 cp -a msvc/build/sgen/Win32/lib/Release/MonoPosixHelper.lib ${INSTALLDIR}/lib/
61 cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.pdb ${INSTALLDIR}/lib/
62 cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.exe ${INSTALLDIR}/bin/
63 cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.pdb ${INSTALLDIR}/bin/
64 cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.dll ${INSTALLDIR}/bin/
65 cp -a msvc/build/boehm/Win32/lib/Release/mono-2.0-boehm.lib ${INSTALLDIR}/lib/
66 cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.pdb ${INSTALLDIR}/lib/
67 cp -a ${INSTALLDIR}/bin/mono-sgen.exe ${INSTALLDIR}/bin/mono.exe
68 cp -a ${INSTALLDIR}/bin/mono-sgen.pdb ${INSTALLDIR}/bin/mono.pdb
70 pushd ${INSTALLDIR}/bin
72 do if [[ "`file -b $i`" == "POSIX shell script, ASCII text"* ]]
73 then RUNTIME=`grep -ho -m 1 "xbuild/.*/bin/\|[2,3,4]\.[0,5]/" $i | sed 's#/$##'`
74 if [ -n "$(grep -ho '.:/.*\.exe' $i)" ]
75 then EXENAME=$(basename `grep -ho '.:/.*\.exe' $i`)
77 if [ -f "../lib/mono/${RUNTIME}/${EXENAME}" ]
78 then sed "s#@@RUNTIME@@#${RUNTIME}#g" ${REPODIR}/packaging/Windows/resources/wrapper.bat > $i.bat
79 sed -i "s#@@COMMAND@@#${EXENAME}#g" $i.bat
80 sed -i 's#/#\\#g' $i.bat
82 sed -i "s#.:/.*/#\"\$\(cygpath -w \"\$\{BASH_SOURCE%/\*\}\"/../lib/mono/${RUNTIME}/\)\"#g" $i
83 sed -i 's#/.*/tmp/mono/bin#\"\$\{BASH_SOURCE%/\*\}\"#g' $i
86 unzip -jd . ${REPODIR}/pkgconfig.zip bin/pkg-config.exe
94 which mcs 2>/dev/null || error "*** mcs is not in \$PATH ***"