[packaging] Simplify Windows packaging scripts
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 12 Jun 2017 20:44:55 +0000 (22:44 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 13 Jun 2017 02:13:54 +0000 (04:13 +0200)
We don't need to build in a separate checkout of mono anymore.
Also use .pkg passed in from upstream build.

packaging/Windows/defs/gtksharp
packaging/Windows/defs/managed-components
packaging/Windows/defs/mono
packaging/Windows/defs/mono64
packaging/Windows/mono-MDK-windows
packaging/Windows/mono-MDK-windows-x64

index cc8f0dcda107429a59d4a03fa0c109cb11e7d4b0..c9f4152ba38c644cf2b356aeff2e8ed66d820b4b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash -xe
 
-REPO=${2:-"http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.26.msi"}
+REPO="https://dl.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.44.msi"
 REPODIR=$(dirname $(realpath $0))/../repos/gtksharp
 
 error()
index a24ab18c9fda923c929780932906839a9e24ec8b..00ee1476e596c709c377b8b63176989b4ee59122 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/bash -xe
 
-REPO=${2:-"http://storage.bos.internalx.com/mono-mac-4.0.0-branch/79/7975f5090d8b0d266dc0ba824295d92edd8873da/MonoFramework-MDK-4.0.0.0.macos10.xamarin.x86.pkg"}
 REPODIR=$(dirname $(realpath $0))/../repos/managed-components
 
 error()
@@ -19,8 +18,8 @@ download()
        mkdir -p ${REPODIR}
        report "Downloading Xar"
        wget --quiet -O ${REPODIR}/xar.tar.gz https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/xar/xar-1.5.2.tar.gz || error "*** Could not download Xar ***"
-       report "Downloading Mono MDK for Mac - ${REPO}"
-       wget --quiet -O ${REPODIR}/mono.xar ${REPO}
+       report "Copying Mono MDK for Mac"
+       cp ${2} ${REPODIR}/mono.xar
 }
 
 clean()
index 8bc4a4d8d02524e89305b8ae0a4e04162d676579..2897ea1eaf4a5a677aad321e2bfae4c1af6142f9 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash -xe
 
-REPO=https://github.com/mono/mono.git
-REPODIR=$(dirname $(realpath $0))/../repos/mono
+REPODIR=$(dirname $(realpath $0))/../../..
+INSTALLDIR=$(realpath -m $(dirname $0)/../tmp/mono)
 
 error()
 {
@@ -16,41 +16,20 @@ report()
 
 download()
 {
-       if [ ! -d "${REPODIR}" ]
-       then
-               report "Checking Mono out from Git"
-               git clone --config core.autocrlf=input $REPO ${REPODIR} || error "*** Could not run git clone ***"
-       else
-               report "Fetching the latest Mono from Git"
-               cd ${REPODIR} && git fetch origin || error "*** Could not run git fetch ***"
-       fi
-       if [ -n "$1" ]
-       then
-               report "Checkout out revision $1"
-               cd ${REPODIR} && git reset --hard $1 || error "*** Could not run git checkout ***"
-       fi
-       cd ${REPODIR} && git submodule init || error "*** Could not run git submodule init ***"
-       cd ${REPODIR} && git submodule update || error "*** Could not run git submodule update ***"
        wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
 }
 
 clean()
 {
-       rm -fr ${REPODIR}/../../tmp/mono
-       pushd ${REPODIR}
-       report "Running git clean and reset"
-       git clean -fdx || error "*** Could not run git clean ***"
-       git reset --hard HEAD || error "*** Could not run git reset ***"
-       popd
-       wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
+       rm -rf ${INSTALLDIR}
 }
 
 build()
 {
        pushd ${REPODIR}
        report "Building Mono"
-       mkdir -p ../../tmp/mono
-       WORKSPACE=${REPODIR} EXTRA_CONF_FLAGS="--prefix=$(realpath ../../tmp/mono)" ghprbPullId=1 CI_TAGS="no-tests" label="w32" scripts/ci/run-jenkins.sh || error "*** Could not run autogen ***"
+       mkdir -p ${INSTALLDIR}
+       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 ***"
        popd
 }
 
@@ -58,37 +37,37 @@ install()
 {
        pushd ${REPODIR}
        MONO_EXECUTABLE=${REPODIR}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe make install || error "*** Installing to temporary prefix failed ***"
-       rm -f   ../../tmp/mono/bin/mono-sgen.* \
-               ../../tmp/mono/bin/mono-boehm.* \
-               ../../tmp/mono/lib/libmono-2.0.* \
-               ../../tmp/mono/lib/libmonoboehm-2.0.* \
-               ../../tmp/mono/lib/libmonosgen-2.0.* \
-               ../../tmp/mono/bin/MonoPosixHelper.* \
-               ../../tmp/mono/lib/MonoPosixHelper.* \
-               ../../tmp/mono/bin/mono \
-               ../../tmp/mono/bin/pedump \
-               ../../tmp/mono/bin/mono-package-runtime \
-               ../../tmp/mono/bin/monodis*
+       rm -f   ${INSTALLDIR}/bin/mono-sgen.* \
+               ${INSTALLDIR}/bin/mono-boehm.* \
+               ${INSTALLDIR}/lib/libmono-2.0.* \
+               ${INSTALLDIR}/lib/libmonoboehm-2.0.* \
+               ${INSTALLDIR}/lib/libmonosgen-2.0.* \
+               ${INSTALLDIR}/bin/MonoPosixHelper.* \
+               ${INSTALLDIR}/lib/MonoPosixHelper.* \
+               ${INSTALLDIR}/bin/mono \
+               ${INSTALLDIR}/bin/pedump \
+               ${INSTALLDIR}/bin/mono-package-runtime \
+               ${INSTALLDIR}/bin/monodis*
        pushd ${REPODIR}
-       cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.exe        ../../tmp/mono/bin/monodis.exe
-       cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.pdb        ../../tmp/mono/bin/monodis.pdb
-       cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.exe   ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.pdb   ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.dll       ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/Win32/lib/Release/mono-2.0-sgen.lib       ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.pdb       ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.dll     ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/Win32/lib/Release/MonoPosixHelper.lib     ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.pdb     ../../tmp/mono/lib/
-       cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.exe         ../../tmp/mono/bin/
-       cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.pdb         ../../tmp/mono/bin/
-       cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.dll     ../../tmp/mono/bin/
-       cp -a msvc/build/boehm/Win32/lib/Release/mono-2.0-boehm.lib     ../../tmp/mono/lib/
-       cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.pdb     ../../tmp/mono/lib/
-       cp -a ../../tmp/mono/bin/mono-sgen.exe  ../../tmp/mono/bin/mono.exe
-       cp -a ../../tmp/mono/bin/mono-sgen.pdb  ../../tmp/mono/bin/mono.pdb
+       cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.exe        ${INSTALLDIR}/bin/monodis.exe
+       cp -a msvc/build/sgen/Win32/bin/Release/monodis-sgen.pdb        ${INSTALLDIR}/bin/monodis.pdb
+       cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.exe   ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/Win32/bin/Release/mono-sgen.pdb   ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.dll       ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/Win32/lib/Release/mono-2.0-sgen.lib       ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/Win32/bin/Release/mono-2.0-sgen.pdb       ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.dll     ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/Win32/lib/Release/MonoPosixHelper.lib     ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/Win32/bin/Release/MonoPosixHelper.pdb     ${INSTALLDIR}/lib/
+       cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.exe         ${INSTALLDIR}/bin/
+       cp -a msvc/build/boehm/Win32/bin/Release/mono-boehm.pdb         ${INSTALLDIR}/bin/
+       cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.dll     ${INSTALLDIR}/bin/
+       cp -a msvc/build/boehm/Win32/lib/Release/mono-2.0-boehm.lib     ${INSTALLDIR}/lib/
+       cp -a msvc/build/boehm/Win32/bin/Release/mono-2.0-boehm.pdb     ${INSTALLDIR}/lib/
+       cp -a ${INSTALLDIR}/bin/mono-sgen.exe   ${INSTALLDIR}/bin/mono.exe
+       cp -a ${INSTALLDIR}/bin/mono-sgen.pdb   ${INSTALLDIR}/bin/mono.pdb
        popd
-       pushd ${REPODIR}/../../tmp/mono/bin
+       pushd ${INSTALLDIR}/bin
        for i in *
                do if [[ "`file -b $i`" == "POSIX shell script, ASCII text"* ]]
                        then RUNTIME=`grep -ho -m 1 "xbuild/.*/bin/\|[2,3,4]\.[0,5]/" $i | sed 's#/$##'`
@@ -96,7 +75,7 @@ install()
                                then EXENAME=$(basename `grep -ho '.:/.*\.exe' $i`)
                        fi
                        if [ -f "../lib/mono/${RUNTIME}/${EXENAME}" ]
-                               then sed "s#@@RUNTIME@@#${RUNTIME}#g" ${REPODIR}/../../resources/wrapper.bat > $i.bat
+                               then sed "s#@@RUNTIME@@#${RUNTIME}#g" $(dirname $0)/../resources/wrapper.bat > $i.bat
                                sed -i "s#@@COMMAND@@#${EXENAME}#g" $i.bat
                                sed -i 's#/#\\#g' $i.bat
                        fi
index 543fe8c2d831dbb5374d2811a15b6ee5a1ba1dfc..cec3177f3fb71c39d4f903ed6f7f2c1faf23fcb0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash -xe
 
-REPO=https://github.com/mono/mono.git
-REPODIR=$(dirname $(realpath $0))/../repos/mono
+REPODIR=$(dirname $(realpath $0))/../../..
+INSTALLDIR=$(realpath -m $(dirname $0)/../tmp/mono)
 
 error()
 {
@@ -16,41 +16,20 @@ report()
 
 download()
 {
-       if [ ! -d "${REPODIR}" ]
-       then
-               report "Checking Mono out from Git"
-               git clone --config core.autocrlf=input $REPO ${REPODIR} || error "*** Could not run git clone ***"
-       else
-               report "Fetching the latest Mono from Git"
-               cd ${REPODIR} && git fetch origin || error "*** Could not run git fetch ***"
-       fi
-       if [ -n "$1" ]
-       then
-               report "Checkout out revision $1"
-               cd ${REPODIR} && git reset --hard $1 || error "*** Could not run git checkout ***"
-       fi
-       cd ${REPODIR} && git submodule init || error "*** Could not run git submodule init ***"
-       cd ${REPODIR} && git submodule update || error "*** Could not run git submodule update ***"
        wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
 }
 
 clean()
 {
-       rm -fr ${REPODIR}/../../tmp/mono
-       pushd ${REPODIR}
-       report "Running git clean and reset"
-       git clean -fdx || error "*** Could not run git clean ***"
-       git reset --hard HEAD || error "*** Could not run git reset ***"
-       popd
-       wget --quiet -O ${REPODIR}/pkgconfig.zip http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
+       rm -rf ${INSTALLDIR}
 }
 
 build()
 {
        pushd ${REPODIR}
        report "Building Mono"
-       mkdir -p ../../tmp/mono
-       WORKSPACE=${REPODIR} EXTRA_CONF_FLAGS="--prefix=$(realpath ../../tmp/mono)" ghprbPullId=1 CI_TAGS="no-tests" label="w64" scripts/ci/run-jenkins.sh || error "*** Could not run autogen ***"
+       mkdir -p ${INSTALLDIR}
+       WORKSPACE=${REPODIR} EXTRA_CONF_FLAGS="--prefix=${INSTALLDIR}" ghprbPullId=1 CI_TAGS="no-tests" label="w64" scripts/ci/run-jenkins.sh || error "*** Could not run autogen ***"
        popd
 }
 
@@ -58,32 +37,32 @@ install()
 {
        pushd ${REPODIR}
        MONO_EXECUTABLE=${REPODIR}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe make install || error "*** Installing to temporary prefix failed ***"
-       rm -f   ../../tmp/mono/bin/mono-sgen.* \
-               ../../tmp/mono/bin/mono-boehm.* \
-               ../../tmp/mono/lib/libmono-2.0.* \
-               ../../tmp/mono/lib/libmonoboehm-2.0.* \
-               ../../tmp/mono/lib/libmonosgen-2.0.* \
-               ../../tmp/mono/bin/MonoPosixHelper.* \
-               ../../tmp/mono/lib/MonoPosixHelper.* \
-               ../../tmp/mono/bin/mono \
-               ../../tmp/mono/bin/pedump \
-               ../../tmp/mono/bin/mono-package-runtime \
-               ../../tmp/mono/bin/monodis*
+       rm -f   ${INSTALLDIR}/bin/mono-sgen.* \
+               ${INSTALLDIR}/bin/mono-boehm.* \
+               ${INSTALLDIR}/lib/libmono-2.0.* \
+               ${INSTALLDIR}/lib/libmonoboehm-2.0.* \
+               ${INSTALLDIR}/lib/libmonosgen-2.0.* \
+               ${INSTALLDIR}/bin/MonoPosixHelper.* \
+               ${INSTALLDIR}/lib/MonoPosixHelper.* \
+               ${INSTALLDIR}/bin/mono \
+               ${INSTALLDIR}/bin/pedump \
+               ${INSTALLDIR}/bin/mono-package-runtime \
+               ${INSTALLDIR}/bin/monodis*
        pushd ${REPODIR}
-       cp -a msvc/build/sgen/x64/bin/Release/monodis-sgen.exe  ../../tmp/mono/bin/monodis.exe
-       cp -a msvc/build/sgen/x64/bin/Release/monodis-sgen.pdb  ../../tmp/mono/bin/monodis.pdb
-       cp -a msvc/build/sgen/x64/bin/Release/mono-sgen.exe             ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/x64/bin/Release/mono-sgen.pdb             ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/x64/bin/Release/mono-2.0-sgen.dll ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/x64/lib/Release/mono-2.0-sgen.lib ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/x64/bin/Release/mono-2.0-sgen.pdb ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/x64/bin/Release/MonoPosixHelper.dll       ../../tmp/mono/bin/
-       cp -a msvc/build/sgen/x64/lib/Release/MonoPosixHelper.lib       ../../tmp/mono/lib/
-       cp -a msvc/build/sgen/x64/bin/Release/MonoPosixHelper.pdb       ../../tmp/mono/lib/
-       cp -a ../../tmp/mono/bin/mono-sgen.exe  ../../tmp/mono/bin/mono.exe
-       cp -a ../../tmp/mono/bin/mono-sgen.pdb  ../../tmp/mono/bin/mono.pdb
+       cp -a msvc/build/sgen/x64/bin/Release/monodis-sgen.exe  ${INSTALLDIR}/bin/monodis.exe
+       cp -a msvc/build/sgen/x64/bin/Release/monodis-sgen.pdb  ${INSTALLDIR}/bin/monodis.pdb
+       cp -a msvc/build/sgen/x64/bin/Release/mono-sgen.exe             ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/x64/bin/Release/mono-sgen.pdb             ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/x64/bin/Release/mono-2.0-sgen.dll ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/x64/lib/Release/mono-2.0-sgen.lib ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/x64/bin/Release/mono-2.0-sgen.pdb ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/x64/bin/Release/MonoPosixHelper.dll       ${INSTALLDIR}/bin/
+       cp -a msvc/build/sgen/x64/lib/Release/MonoPosixHelper.lib       ${INSTALLDIR}/lib/
+       cp -a msvc/build/sgen/x64/bin/Release/MonoPosixHelper.pdb       ${INSTALLDIR}/lib/
+       cp -a ${INSTALLDIR}/bin/mono-sgen.exe   ${INSTALLDIR}/bin/mono.exe
+       cp -a ${INSTALLDIR}/bin/mono-sgen.pdb   ${INSTALLDIR}/bin/mono.pdb
        popd
-       pushd ${REPODIR}/../../tmp/mono/bin
+       pushd ${INSTALLDIR}/bin
        for i in *
                do if [[ "`file -b $i`" == "POSIX shell script, ASCII text"* ]]
                        then RUNTIME=`grep -ho -m 1 "xbuild/.*/bin/\|[2,3,4]\.[0,5]/" $i | sed 's#/$##'`
@@ -91,7 +70,7 @@ install()
                                then EXENAME=$(basename `grep -ho '.:/.*\.exe' $i`)
                        fi
                        if [ -f "../lib/mono/${RUNTIME}/${EXENAME}" ]
-                               then sed "s#@@RUNTIME@@#${RUNTIME}#g" ${REPODIR}/../../resources/wrapper.bat > $i.bat
+                               then sed "s#@@RUNTIME@@#${RUNTIME}#g" $(dirname $0)/../resources/wrapper.bat > $i.bat
                                sed -i "s#@@COMMAND@@#${EXENAME}#g" $i.bat
                                sed -i 's#/#\\#g' $i.bat
                        fi
index 1b4853526897a53a323c134984827330c65d848a..1bec768090f475797d04b6ae30d2830337507bcc 100755 (executable)
@@ -4,8 +4,8 @@ for i in ${COMPONENTS}
        do defs/$i prerequisites
 done
 COMPONENTS="gtksharp managed-components"
-defs/mono download ${monosha1}
-defs/gtksharp download ${gtksharpmsi}
+defs/mono download
+defs/gtksharp download
 defs/managed-components download ${mdk}
 COMPONENTS="mono gtksharp managed-components"
 for i in ${COMPONENTS}
index d958fb38106906ae5ccca3e56a2b535eb5e518f1..737f62f809a0ad585f727c47c84d6616f883427b 100755 (executable)
@@ -4,7 +4,7 @@ for i in ${COMPONENTS}
        do defs/$i prerequisites
 done
 COMPONENTS="managed-components"
-defs/mono64 download ${monosha1}
+defs/mono64 download
 defs/managed-components download ${mdk}
 COMPONENTS="mono64 managed-components"
 for i in ${COMPONENTS}