Commits

Ivan Vučica  committed 2cac4ee

Separated env.sh to make it easier to set up environment outside the scripts.

  • Participants
  • Parent commits 312d0bf

Comments (0)

Files changed (2)

File android-gnustep.sh

 # wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130219.zip
 # apt-get install unzip
 
-# determine path to script
-# http://www.makkintosshu.com/journal/a-realpath-implementation-in-bash
-function realpath()
-{
-	local success=true
-	local path="$1"
-
-	# make sure the string isn't empty as that implies something in further logic
-	if [ -z "$path" ]; then
-		success=false
-	else
-		# start with the file name (sans the trailing slash)
-		path="${path%/}"
-
-		# if we stripped off the trailing slash and were left with nothing, that means we're in the root directory
-		if [ -z "$path" ]; then
-			path="/"
-		fi
-
-		# get the basename of the file (ignoring '.' & '..', because they're really part of the path)
-		local file_basename="${path##*/}"
-		if [[ ( "$file_basename" = "." ) || ( "$file_basename" = ".." ) ]]; then
-			file_basename=""
-		fi
-
-		# extracts the directory component of the full path, if it's empty then assume '.' (the current working directory)
-		local directory="${path%$file_basename}"
-		if [ -z "$directory" ]; then
-			directory='.'
-		fi
-
-		# attempt to change to the directory
-		if ! cd "$directory" &>/dev/null ; then
-			success=false
-		fi
-
-		if $success; then
-			# does the filename exist?
-			if [[ ( -n "$file_basename" ) && ( ! -e "$file_basename" ) ]]; then
-				success=false
-			fi
-
-			# get the absolute path of the current directory & change back to previous directory
-			local abs_path="$(pwd -P)"
-			cd "-" &>/dev/null
-
-			# Append base filename to absolute path
-			if [ "${abs_path}" = "/" ]; then
-				abs_path="${abs_path}${file_basename}"
-			else
-				abs_path="${abs_path}/${file_basename}"
-			fi
-
-			# output the absolute path
-			echo "$abs_path"
-		fi
-	fi
-
-	$success
-}
-
-export ANDROID_GNUSTEP_INSTALL_ROOT=`pwd`
-export ANDROID_GNUSTEP_SCRIPT=`realpath "${BASH_SOURCE}"`
-export ANDROID_GNUSTEP_SCRIPT_ROOT=`dirname "${ANDROID_GNUSTEP_SCRIPT}"`
+. $(dirname $BASH_SOURCE)/env.sh
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/00-dependencies-ubuntu.sh
+echo "that was 00"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/05-fetch-android-tools.sh
+echo "that was 05"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/06-fetch-android-sdk.sh
+echo "that was 06"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/10-fetch-android-ndk.sh
+echo "that was 10"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/11-ndk-environment.sh
+echo "that was 11"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/12-ndk-compiler-environment.sh
+echo "that was 12"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/15-bootstrap-standalone-ndk-toolchain.sh
+echo "that was 15"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/20-fetch-gnustep-and-libobjc2.sh
+echo "that was 20"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/25-fetch-android-cmake-toolchain-file.sh
+echo "that was 25"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/30-build-libobjc2.sh
+echo "that was 30"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/35-update-gnustep-make-for-androideabi.sh
+echo "that was 35"
+read
+
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/36-build-gnustep-make.sh
-
+echo "that was 36"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/40-source-gnustep-sh.sh
+echo "that was 40"
+read
 
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/45-patch-gnustep-base.sh
+echo "that was 45"
+read
 . ${ANDROID_GNUSTEP_SCRIPT_ROOT}/phases/46-build-gnustep-base.sh
+echo "that was 46"
+read
 
+
+# determine path to script
+# http://www.makkintosshu.com/journal/a-realpath-implementation-in-bash
+function realpath()
+{
+	local success=true
+	local path="$1"
+
+	# make sure the string isn't empty as that implies something in further logic
+	if [ -z "$path" ]; then
+		success=false
+	else
+		# start with the file name (sans the trailing slash)
+		path="${path%/}"
+
+		# if we stripped off the trailing slash and were left with nothing, that means we're in the root directory
+		if [ -z "$path" ]; then
+			path="/"
+		fi
+
+		# get the basename of the file (ignoring '.' & '..', because they're really part of the path)
+		local file_basename="${path##*/}"
+		if [[ ( "$file_basename" = "." ) || ( "$file_basename" = ".." ) ]]; then
+			file_basename=""
+		fi
+
+		# extracts the directory component of the full path, if it's empty then assume '.' (the current working directory)
+		local directory="${path%$file_basename}"
+		if [ -z "$directory" ]; then
+			directory='.'
+		fi
+
+		# attempt to change to the directory
+		if ! cd "$directory" &>/dev/null ; then
+			success=false
+		fi
+
+		if $success; then
+			# does the filename exist?
+			if [[ ( -n "$file_basename" ) && ( ! -e "$file_basename" ) ]]; then
+				success=false
+			fi
+
+			# get the absolute path of the current directory & change back to previous directory
+			local abs_path="$(pwd -P)"
+			cd "-" &>/dev/null
+
+			# Append base filename to absolute path
+			if [ "${abs_path}" = "/" ]; then
+				abs_path="${abs_path}${file_basename}"
+			else
+				abs_path="${abs_path}/${file_basename}"
+			fi
+
+			# output the absolute path
+			echo "$abs_path"
+		fi
+	fi
+
+	$success
+}
+
+export ANDROID_GNUSTEP_INSTALL_ROOT=`pwd`
+export ANDROID_GNUSTEP_SCRIPT=`realpath "${BASH_SOURCE}"`
+export ANDROID_GNUSTEP_SCRIPT_ROOT=`dirname "${ANDROID_GNUSTEP_SCRIPT}"`
+