User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mono_debian [2017/12/08 19:52] – [Parrallel mono env] ssm2017mono_debian [2022/02/07 13:29] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== mono debian ======
 ====== wheezy ====== ====== wheezy ======
 ===== 2.6.7 ===== ===== 2.6.7 =====
Line 35: Line 36:
 [[http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/|source]] [[http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/|source]]
  
 +==== Debian 8 ====
 <sxh bash> <sxh bash>
-apt-get install libgdiplus g++ pkg-config glib-2.0 libcairo2-dev libtiff-dev libexif.dev make+apt-get install libgdiplus g++ pkg-config glib-2.0 libcairo2-dev libtiff-dev libexif-dev libgif-dev make gettext cmake
 </sxh> </sxh>
  
 +
 +==== Install script ====
 +<sxh bash>
 +#!/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
 +</sxh>
 {{tag>mono debian}} {{tag>mono debian}}

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