User Tools

mono debian

wheezy

2.6.7

Source

Source (6mn of compilation)

libgdi+

apt-get install libpng-dev fontconfig libfreetype6-dev libfontconfig1-dev libjpeg8-dev libtiff5-dev libgif-dev
wget http://origin-download.mono-project.com/sources/libgdiplus/libgdiplus-2.6.7.tar.bz2
tar -jxf libgdiplus-2.6.7.tar.bz2
cd libgdiplus-2.6.7
./configure --prefix=/usr/local; make; make install
export LD_LIBRARY_PATH=/usr/local/lib

mono

apt-get install bzip2 make gcc g++ bison gettext pkg-config glib-2.0 libglib2.0-dev
wget http://origin-download.mono-project.com/sources/mono/mono-2.6.7.tar.bz2
tar -jxf mono-2.6.7.tar.bz2
cd mono-2.6.7
./configure --prefix=/usr/local; make; make install

3.0.6

apt-get remove monodoc-browser
deb http://debian.meebey.net/experimental/mono /
apt-get update
apt-get install mono-complete

Parrallel mono env

Debian 8

apt-get install libgdiplus g++ pkg-config glib-2.0 libcairo2-dev libtiff-dev libexif-dev libgif-dev make gettext cmake

Install script

#!/bin/bash    
                     
# config                                                  
DEBIAN_VERSION="9"
SOURCE_FOLDER="/opt/mono-files/todo"
DEST_FOLDER="/opt/mono-files/compiled/debian$DEBIAN_VERSION"
LOG_FILE="/opt/compile-mono.log"
               
# set text colors                     
ColRedF=$'\e[31m';     
ColGreenF=$'\e[32m';                                                            
ColYellowF=$'\e[33m';                                     
ColReset=$'\e[0m';                                                
                                               
# check if root                                                                
if [[ $EUID -ne 0 ]]; then          
        echo -e "${ColGreenF}This script must be run as root${ColReset}"
        exit 1               
fi                                      
 
# backup some env
OLD_DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH
OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH                                     
OLD_PATH=$PATH                                     
OLD_PS1=$PS1                 
                    
function compile_libgdiplus {
        cd /tmp
        if [ ! -d /tmp/libgdiplus ]; then
                mkdir /tmp/libgdiplus
        fi                                                   
        if [ -d /tmp/libgdiplus/libgdiplus-4.2 ]; then      
                rm -R /tmp/libgdiplus/libgdiplus-4.2
        fi                
        if [ ! -f /tmp/libgdiplus/libgdiplus-4.2.tar.gz ]; then
                cp /opt/libgdiplus/libgdiplus-4.2.tar.gz /tmp/libgdiplus
        fi      
        cd /tmp/libgdiplus
        tar -zxf libgdiplus-4.2.tar.gz                                         
        cd /tmp/libgdiplus/libgdiplus-4.2                              
        ./configure --prefix=/opt/mono-$1                  
        make                
        make install                                       
}                           
                                                            
function compile_mono {                                           
        cd /opt/mono-$1            
        ./configure --prefix=/opt/mono-$1                   
        make                 
        make install                                        
}

function get_sources {
        if [ -d /opt/mono-$1 ];then                         
                rm -R /opt/mono-$1
        fi
        mv $SOURCE_FOLDER/mono-$1.tar.bz2 /opt
        cd /opt  
        mkdir mono-$1
        tar -jxf mono-$1.tar.bz2 --strip 1 -C /opt/mono-$1                
}                          
    
function create_venv {
        echo "#!/bin/bash
MONO_VERSION=$1
MONO_PREFIX=/opt/mono-\${MONO_VERSION}
GNOME_PREFIX=/opt/gnome
export DYLD_FALLBACK_LIBRARY_PATH=\$MONO_PREFIX/lib:\$DYLD_FALLBACK_LIBRARY_PATH
export LD_LIBRARY_PATH=\$MONO_PREFIX/lib:\$LD_LIBRARY_PATH
export C_INCLUDE_PATH=\$MONO_PREFIX/include:\$GNOME_PREFIX/include
export ACLOCAL_PATH=\$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=\$MONO_PREFIX/lib/pkgconfig:\$GNOME_PREFIX/lib/pkgconfig
export PATH=\$MONO_PREFIX/bin:\$PATH
PS1=\"[mono-\$MONO_VERSION] \\w @ \"
" > /opt/mono-$1/mono-$1.venv
        source /opt/mono-$1/mono-$1.venv
}

function reset_venv {
        export DYLD_FALLBACK_LIBRARY_PATH=$OLD_DYLD_FALLBACK_LIBRARY_PATH
        export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH
        export PATH=$OLD_PATH
        PS1=$OLD_PS1
}

function backup_file {
        cd /opt
        tar -zcf mono-$1-debian$DEBIAN_VERSION.tar.gz mono-$1
        mv mono-$1-debian$DEBIAN_VERSION.tar.gz $DEST_FOLDER
        rm -R mono-$1
        rm mono-$1.tar.bz2
}

function do_it {
        VERSION=$1
        echo "[$(date)] > ===============================" | tee -a ${LOG_FILE}
        echo "[$(date)] > Mono version : $VERSION" | tee -a ${LOG_FILE}
        echo "[$(date)] > get sources" | tee -a ${LOG_FILE}
        get_sources $VERSION
        echo "[$(date)] > create venv" | tee -a ${LOG_FILE}
        create_venv $VERSION
        echo "[$(date)] > path : $PATH" | tee -a ${LOG_FILE}
        echo "[$(date)] > compile libgdiplus" | tee -a ${LOG_FILE}
        compile_libgdiplus $VERSION
        echo "[$(date)] > compile mono" | tee -a ${LOG_FILE}
        compile_mono $VERSION
        echo "[$(date)] > backup files" | tee -a ${LOG_FILE}
        backup_file $VERSION
        echo "[$(date)] > reset venv" | tee -a ${LOG_FILE}
        reset_venv
        echo "[$(date)] > path : $PATH" | tee -a ${LOG_FILE}
}

# get all mono versions to compile
cd $SOURCE_FOLDER
for archive in *; do
        mono_version=$(echo $(basename $archive .tar.bz2)| cut -d'-' -f 2)
        do_it $mono_version
done

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information