Ivan Vučica avatar Ivan Vučica committed 321dba4

Added some error checking and configurability. Separated script into phases.

Comments (0)

Files changed (10)

GNUstep libobjc2 on Ubuntu.sh

-#!/bin/bash
-
-# GNUstep with libobjc2
-# installation on cleanly installed desktop Ubuntu 12.04
-
-# Based on Etoile's INSTALL file
-
-# Differences:
-# $PWD/Debug/bin turns out to be $PWD/Release+Asserts/bin
-
-sudo apt-get install subversion g++ libffi-dev libxml2-dev libicu-dev libgmp3-dev libjpeg-dev libtiff-dev libpng-dev libcairo-dev libxt-dev libopenssl-dev libxslt-dev libgl1-mesa-dev libglu1-mesa-dev
-
-# The following shouldn't be necessary, according to
-# gnustep-base docs, but currently, it nonetheless is 
-# required.
-sudo apt-get install libgnutls-dev
-
-
-svn co svn://svn.gna.org/svn/gnustep/modules/ gnustep
-svn co svn://svn.gna.org/svn/etoile/trunk/ etoile
-svn co http://llvm.org/svn/llvm-project/llvm/trunk/ llvm
-
-cd llvm/tools
-svn co http://llvm.org/svn/llvm-project/cfe/trunk/ clang
-cd ..
-./configure --enable-optimized && make -j3
-export PATH=$PATH:$PWD/Release+Asserts/bin: # llvm/Debug/bin contains the clang binary
-export CC=clang # Make Clang the C/ObjC compiler rather than GCC
-
-clang -v
-
-cd ..
-cd gnustep
-
-# - Install GNUstep Make a first time:
-cd core/make
-./configure --enable-debug-by-default --with-layout=gnustep # --prefix=/
-make && sudo -E make install
-. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh 
-# Or . /System/Library/Makefiles/GNUstep.sh if --prefix=/ was passed
-
-# - Build libobjc2
-cd ../../dev-libs/libobjc2
-make debug=no && sudo -E make strip=yes install
-
-# - Install GNUstep Make a second time so it can detect the new ObjC runtime just installed:
-cd ../../core/make
-./configure --enable-debug-by-default --with-layout=gnustep #--prefix=/
-make && sudo -E make install
-
-# Re-source GNUstep
-. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
-
-# - Build and Install GNUstep Base, Gui and Back:
-cd ../base
-# For Linux e.g. Ubuntu, --with-ffi-include is usually required
-./configure --with-ffi-include=/usr/include/`gcc -dumpmachine`
-make -j 3 && sudo -E make install
-
-cd ../gui
-./configure && make -j 3 && sudo -E make install
-
-cd ../back
-./configure --enable-graphics=cairo && make -j 3 && sudo -E make install
-

GNUstep with libobjc2 on Ubuntu.sh

+#!/bin/bash
+
+# GNUstep with libobjc2
+# installation on cleanly installed desktop Ubuntu 12.04
+
+# Based on Etoile's INSTALL file
+
+# Differences:
+# $PWD/Debug/bin turns out to be $PWD/Release+Asserts/bin
+
+GSU_BUILD_ROOT="`pwd`"
+GSU_SCRIPT_ROOT="`dirname "$0"`"
+GSU_SCRIPT_ROOT="`readlink -f "$GSU_SCRIPT_ROOT"`"
+. "$GSU_SCRIPT_ROOT/phases/00-ubuntu-deps.sh"
+if [ "$WITHOUT_CHECKOUT" == "1" ] ; then
+	echo "Skipping checkout from VCS"
+else
+	. "$GSU_SCRIPT_ROOT/phases/05-vcs-checkout.sh"
+fi	
+. "$GSU_SCRIPT_ROOT/phases/10-build-llvm.sh"
+. "$GSU_SCRIPT_ROOT/phases/15-build-libobjc2.sh"
+exit 0
+. "$GSU_SCRIPT_ROOT/phases/20-build-gnustep-make.sh"
+. "$GSU_SCRIPT_ROOT/phases/25-build-gnustep-base.sh"
+. "$GSU_SCRIPT_ROOT/phases/30-build-gnustep-gui.sh"
+. "$GSU_SCRIPT_ROOT/phases/35-build-gnustep-back.sh"
+

phases/00-ubuntu-deps.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Installing dependencies"
+echo "======================="
+
+sudo apt-get install subversion g++ libffi-dev libxml2-dev libicu-dev libgmp3-dev libjpeg-dev libtiff-dev libpng-dev libcairo-dev libxt-dev libopenssl-dev libxslt-dev libgl1-mesa-dev libglu1-mesa-dev
+
+# The following shouldn't be necessary, according to
+# gnustep-base docs, but currently, it nonetheless is 
+# required.
+sudo apt-get install libgnutls-dev
+
+

phases/05-vcs-checkout.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Downloading from version control: GNUstep"
+echo "========================================="
+if svn co svn://svn.gna.org/svn/gnustep/modules/ gnustep ; then
+	echo "Ok"
+else
+	echo "Failed GNUstep download"
+	exit 1
+fi
+
+
+if [ "$WITH_ETOILE" == "1" ]; then
+	echo "Downloading from version control: Etoile"
+	echo "========================================"
+	if svn co svn://svn.gna.org/svn/etoile/trunk/ etoile ; then
+		echo "Ok"
+	else
+		echo "Failed Etoile download"
+		exit 1
+	fi
+else
+	echo "Skipping Etoile checkout! Set WITH_ETOILE=1 to include Etoile."
+fi
+
+if [ "$WITH_TRUNK_LLVM" == "1" ]; then
+	echo "Downloading from version control: LLVM"
+	echo "======================================"
+	if svn co http://llvm.org/svn/llvm-project/llvm/trunk/ llvm ; then
+		echo "Ok"
+	else
+		echo "Failed LLVM download"
+		exit 1
+	fi
+
+	echo "Downloading from version control: Clang"
+	echo "======================================="
+	cd llvm/tools
+	if svn co http://llvm.org/svn/llvm-project/cfe/trunk/ clang ; then
+		echo "Ok"
+	else
+		echo "Failed Clang download"
+		exit 1
+	fi
+else
+	echo "Skipping LLVM and Clang checkout! Set WITH_TRUNK_LLVM=1 to include LLVM and Clang."
+fi
+

phases/10-build-llvm.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building trunk LLVM and Clang"
+echo "============================="
+if [ "$WITH_TRUNK_LLVM" == "1" ] ; then
+if [ -e "$GSU_BUILD_ROOT/llvm/Release+Asserts/bin/clang" ] ; then
+	echo "Clang already set up in expected directory"
+else
+	cd llvm
+	export CC=gcc
+	export CXX=g++
+	if ./configure --enable-optimized && make -j3 ; then
+		echo "Ok"
+	else
+		echo "Failed building trunk LLVM and Clang"
+		exit 1
+	fi
+	export PATH=$PATH:$GSU_BUILD_ROOT/llvm/Release+Asserts/bin: # llvm/Debug/bin contains the clang binary
+	export CC=clang # Make Clang the C/ObjC compiler rather than GCC
+	export CXX=clang++
+fi
+
+	echo "Clang now lives in $GSU_BUILD_ROOT/llvm/Release+Asserts/bin/clang"
+	if clang -v ; then
+		echo -n "Clang binary used: "
+		which clang
+	else
+		echo "Clang failed to start"
+		exit 1
+	fi
+else
+	echo "Building trunk LLVM and Clang skipped! Set WITH_TRUNK_LLVM=1 to build them."
+fi
+

phases/15-build-libobjc2.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building libobjc2"
+echo "================="
+cd gnustep/dev-libs/libobjc2
+if [[ -e CMakeCache.txt || -e Build/ ]]; then
+	echo "libobjc2 seems already built; remove `pwd`/Build/ and CMakeCache.txt to force rebuild"
+	echo "  rm -rf \"`pwd`\"/Build/"
+	echo "  rm -rf \"`pwd`\"/CMakeCache.txt"
+
+else
+	mkdir Build/
+	cd Build
+	if cmake .. ; then
+		echo "CMake ok"
+	else
+		echo "CMake failed"
+		exit 1
+	fi
+	if make debug=no -j 3 && sudo -E make strip=yes install ; then
+		echo "libobjc2 installed ok"
+	else
+		echo "libobjc2 failed to build or install"
+		exit 1
+	fi
+	cd ..
+fi
+

phases/20-build-gnustep-make.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building GNUstep Make"
+echo "====================="
+
+# - Install GNUstep Make. It detects the new ObjC runtime we just installed.
+cd gnustep/core/make/
+if ./configure \
+	--enable-debug-by-default \
+	--with-layout=gnustep \
+	--enable-objc-nonfragile-abi \
+	--prefix=/GNUstep \
+	; then
+	echo "Configured ok"
+else
+	echo "GNUstep Make configure failed"
+	exit 1
+fi
+
+if make -j 3 && sudo -E make install ; then
+	echo "GNUstep Make installed ok"
+else
+	echo "GNUstep Make failed to build or install"
+	exit 1
+fi
+
+# Re-source GNUstep
+. /GNUstep/System/Library/Makefiles/GNUstep.sh
+

phases/25-build-gnustep-base.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building GNUstep Base"
+echo "====================="
+
+# - Build and Install GNUstep Base:
+cd gnustep/core/base
+# For Linux e.g. Ubuntu, --with-ffi-include is usually required
+./configure --with-ffi-include=/usr/include/`gcc -dumpmachine` --disable-mixedabi
+make -j 3 && sudo -E make install
+

phases/30-build-gnustep-gui.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building GNUstep GUI"
+echo "===================="
+
+cd gnustep/core/gui/
+./configure && make -j 3 && sudo -E make install
+

phases/35-build-gnustep-back.sh

+#!/bin/bash
+
+cd "$GSU_BUILD_ROOT"/
+
+echo "Building GNUstep Back (with cairo)"
+echo "=================================="
+
+cd gnustep/core/back/
+./configure --enable-graphics=cairo && make -j 3 && sudo -E make install
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.