"Fossies" - the Fresh Open Source Software Archive

Member "fsharp-4.5/mono/prepare-mono.sh" (5 Sep 2018, 1939 Bytes) of package /linux/misc/mono-sources/fsharp/fsharp-4.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "prepare-mono.sh": 4.1.33_vs_4.5.

    1 #!/usr/bin/env sh
    2 
    3 # OS detection
    4 
    5 OSName=$(uname -s)
    6 case $OSName in
    7     Darwin)
    8         OS=OSX
    9         ;;
   10 
   11     Linux)
   12         OS=Linux
   13         ;;
   14 
   15     *)
   16         echo "Unsupported OS '$OSName' detected. Cannot continue with build, the scripts must be updated to support this OS."
   17         exit 1
   18         ;;
   19 esac
   20 
   21 # On Linux (or at least, Ubuntu), when building with Mono, need to install the mono-devel package first.
   22 if [ $OS = 'Linux' ]; then
   23     sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
   24     echo "deb http://download.mono-project.com/repo/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
   25     sudo apt-get update
   26     sudo apt-get -y install mono-devel msbuild
   27 fi
   28 
   29 # The FSharp.Compiler.Tools package doesn't work correctly unless a proper install of F# has been done on the machine.
   30 # OSX can skip this because the OSX Mono installer includes F#.
   31 if [ $OS != 'OSX' ]; then
   32     sudo apt-get -y install fsharp
   33 fi
   34 
   35 # "access to the path /etc/mono/registry/last-time is denied"
   36 # On non-OSX systems, may need to create Mono's registry folder to avoid exceptions during builds.
   37 # This doesn't seem to be necessary on OSX, as the folder is created by the installer.
   38 if [ $OS != 'OSX' ]; then
   39     # This registry folder path is correct for Linux;
   40     # on OSX the folder is /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/registry
   41     # and may be different for *BSD systems.
   42     __MonoRegistryDir="/etc/mono/registry"
   43     if [ ! -d "$__MonoRegistryDir" ]; then
   44       echo "Mono registry directory does not exist (it may not have been created yet)."
   45       echo "The directory needs to be created now; superuser permissions are required for this."
   46       { sudo -- sh -c "mkdir -p $__MonoRegistryDir && chmod uog+rw $__MonoRegistryDir"; } || { echo "Unable to create/chmod Mono registry directory '$__MonoRegistryDir'." >&2; }
   47     fi
   48 fi