GithubHelp home page GithubHelp logo

sysrpl / codebot.setup Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 11.0 78 KB

All the information and scripts used to setup a new cross platform development environment

Shell 76.86% Inno Setup 9.30% Batchfile 13.84%

codebot.setup's Introduction

Free Pascal 3.0 with Lazarus

This guide will assist users in obtaining Free Pascal 3.0 Lazarus. It currently has sections for Microsoft Windows and Linux, and Macintosh.

Installation

The quickest and most straight forward way to setup Free Pascal 3.0 with Lazarus is to use an automated installer. These automated installers will not interfere with other development envrionments you might already have on your computer.

Windows

To install: Download and run the Free Pascal 3.0 with Lazarus installer.

This installer is built using Inno Setup. If you would like to build your own Windows installer, the inno setup script project is available on github here.

Windows Installer Notes

  • The setup program is currently not signed by an authority
  • It will therefore say publisher unknown, which is normal

Linux

To install: Open a terminal and type:

curl -L http://www.getlazarus.org/download/?platform=linux -o setup.sh
sh setup.sh

The Linux installer is a shell script which builds Free Pascal 3.0 with Lazarus on Linux. If you would like to view or suggest changes to the script, it's available on github here.

Linux Installer Notes

  • The install folder defaults to $HOME/Development/FreePascal
  • You can easily change this by editing the install script

Macintosh

To install: Open a terminal and type:

curl -L http://www.getlazarus.org/download/?platform=macintosh -o setup.sh
sh setup.sh

The Macintosh installer is a shell script which step you through setting up Free Pascal 3.0 with Lazarus on Macintosh. It will automatically setup tools, such as xcode, which are needed when developing for Macintosh. If you would like to view or suggest changes to the script, it's [available on github here](https://github.com/syscurl http://www.getlazarus.org/download/?platform=macintoshrpl/Codebot.Setup/blob/master/macintosh/install.fpc-3.0.darwin.sh).

Macintosh Installer Notes

  • The install folder defaults to $HOME/Development/FreePascal
  • You can easily change this by editing the install script
  • After install, you'll need to code sign the debugger

codebot.setup's People

Contributors

sysrpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codebot.setup's Issues

install error 2

make[1]: Leaving directory '/home/bas/Development/FreePascal/lazarus/ide'
make: *** [Makefile:3070: ide] Error 2

changes.diff gets out of date

My intial attempts to compile failed because the changes.diff file was out of date.

Unless you run a regular script updating your copies from the main svn repo, the changes.diff file gets out of date. It may be better to adjust the script to obtain the original sources, or make downloading from your site optional, rather than download out of date files and risking a failure of the patch.

Script for installing Lazarus & FPC, can't recompile Lazarus

The script works great. Thanks!
Unfortunally I can't install additional packages. Get error as below. fpcres is in the directory. FPC problem?
Regards, Han
Compile package cairocanvas_pkg 0.0: Success
Compile package Printer4Lazarus 0.5: Success
Build IDE: Exit code 2, Errors: 1, Warnings: 1
Warning: svn not in path.
lazarus.pp(165,1) Error: Can't call the resource compiler "/home/pi/Development/FreePascal/fpc/bin/fpcres", switching to external mode

Rasberry: script not working - tar nor found?

I get

`After install do you want to shortcuts created in:
/home/pi/.local/share/applications (y/n)? y

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
tar: This does not look like a tar archive

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
./setup.sh: line 206: /home/pi/Development/FreePascal/fpc/bin/fpcmkcfg: No such file or directory
find: ‘/home/pi/Development/FreePascal/lazarus/config’: No such file or directory
find: ‘/home/pi/Development/FreePascal/lazarus/config’: No such file or directory
find: ‘/home/pi/Development/FreePascal/lazarus’: No such file or directory
find: ‘/home/pi/Development/FreePascal/lazarus’: No such file or directory
cp: cannot stat '/home/pi/Development/FreePascal/lazarus/lazarus.desktop': No such file or directory
mv: cannot stat '/home/pi/Development/FreePascal/lazarus/lazarus.desktop': No such file or directory
./setup.sh: line 237: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 238: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 239: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 240: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
chmod: cannot access '/home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh': No such file or directory

Your Free Pascal 3.0 with Lazarus is now installed
`
Any help would be great - looks like the sownload location is incorrect

Script in the repo is out of date.

Compare https://github.com/sysrpl/Codebot.Setup/raw/master/macintosh/install.fpc-3.0.darwin.sh with https://www.getlazarus.org/download/?platform=macintosh, the one on this repository is obviously dated, not sure if it's intended?

Result of diff setup.sh install.fpc-3.0.darwin.sh:

14a15,16
> # TODO Prompt the user for the install folder and provide BASE as the default
> 
21,22c23,24
< FPC="3.1.1"
< LAZ="2.2"
---
> FPC="3.0"
> LAZ="1.5"
26c28,35
< # Check OS version
---
> # Add port commands to the path if it's not already there
> if [[ ! "$PATH" == *"/opt/local/bin"* ]]; then
> 	PATH=/opt/local/bin:$PATH
> fi
> 
> # Begin block comment
> # if [ 1 -eq 0 ]; then
> 
37,44d45
< elif [ "$OS_VERSION" -eq 12 ]; then
< 	echo "Detected OSX Sierra"
< elif [ "$OS_VERSION" -eq 13 ]; then
< 	echo "Detected OSX High Siera"
< elif [ "$OS_VERSION" -eq 14 ]; then
< 	echo "Detected OSX Mojave"
< elif [ "$OS_VERSION" -eq 15 ]; then
< 	echo "Detected OSX Catalina"
66d66
< 		exit 1;
72,74c72,91
< PACKAGER="none"
< 
< while true; do
---
> if ! port version &> /dev/null ; then
> 	echo "Setup has detected that macports is not installed"
> 	read -p "Press [ENTER] to install macports"
> 	echo "Please wait for macports to install"
> 	MACPORTS=/tmp/macports.pkg
> 	if [ ! -f "$MACPORTS" ]; then
> 	  if [ "$OS_VERSION" -eq 7 ]; then
> 		  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.7-Lion.pkg
> 	  elif [ "$OS_VERSION" -eq 8 ]; then
> 		  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.8-MountainLion.pkg
> 	  elif [ "$OS_VERSION" -eq 9 ]; then
> 		  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.9-Mavericks.pkg
> 	  elif [ "$OS_VERSION" -eq 10 ]; then
> 		  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.10-Yosemite.pkg
> 	  elif [ "$OS_VERSION" -eq 11 ]; then
> 		  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.11-ElCapitan.pkg
> 	  fi
> 	  curl "$PKGURL" -o "$MACPORTS"
> 	fi
> 	open $MACPORTS
76,78c93,94
< 	echo "This installer requires either Homebrew or Macports"
< 	echo -n "Which would you prefer [(b)rew or (p)ort]: "
< 	read PACKAGER
---
> 	sleep 10s
> 	read -p "After macports is installed press [ENTER] to continue"
80,135c96,99
< 
< 	case $PACKAGER in
< 		[bB][rR][eE][wW]|[bB]) 
< 			PACKAGER="brew"			
< 			break
< 			;;
< 		[pP][oO][rR][tT]|[pP]) 
< 			PACKAGER="port"
< 			break
< 			;;
< 		*)
< 			echo "Invalid selection"
< 			echo
< 			continue
< 			;;
< 	esac
< done		
< 
< if [ $PACKAGER == "port" ] ; then
< 
< 	# Add port commands to the path if it's not already there
< 	if [[ ! "$PATH" == *"/opt/local/bin"* ]]; then
< 		PATH=/opt/local/bin:$PATH
< 	fi
< 
< 	if ! which port &> /dev/null ; then
< 		echo "Setup has detected that Macports is not installed"
< 		read -p "Press [ENTER] to install Macports"
< 		echo "Please wait for Macports to install"
< 		MACPORTS=/tmp/macports.pkg
< 		if [ ! -f "$MACPORTS" ]; then
< 		  if [ "$OS_VERSION" -eq 7 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.7-Lion.pkg
< 		  elif [ "$OS_VERSION" -eq 8 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.8-MountainLion.pkg
< 		  elif [ "$OS_VERSION" -eq 9 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.9-Mavericks.pkg
< 		  elif [ "$OS_VERSION" -eq 10 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.10-Yosemite.pkg
< 		  elif [ "$OS_VERSION" -eq 11 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.3.4-10.11-ElCapitan.pkg
< 		  elif [ "$OS_VERSION" -eq 12 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.5.4-10.12-Sierra.pkg
< 		  elif [ "$OS_VERSION" -eq 13 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.5.4-10.13-HighSierra.pkg
< 		  elif [ "$OS_VERSION" -eq 14 ]; then
< 			  PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.5.4-10.14-Mojave.pkg
< 		  elif [ "$OS_VERSION" -eq 15 ]; then
< 			  PKGURL=https://github.com/macports/macports-base/releases/download/v2.6.1/MacPorts-2.6.1-10.15-Catalina.pkg
< 		  fi
< 		  curl "$PKGURL" -o "$MACPORTS"
< 		fi
< 		open $MACPORTS
< 		echo
< 		sleep 10s
< 		read -p "After Macports is installed press [ENTER] to continue"
---
> 	if ! port version &> /dev/null ; then
> 		echo "Setup has detected that macports was not completely installed"
> 		echo "Please wait for macports to install and re-run this script"
> 		echo "done."
137,145d100
< 		if ! port version &> /dev/null ; then
< 			echo "Setup has detected that Macports was not completely installed"
< 			echo "Please wait for Macports to install and re-run this script"
< 			echo "done."
< 			echo
< 			exit 1;
< 		fi
< 	else
< 		echo "Found Macports"	
146a102,104
> else
> 	echo "Found macports"	
> fi
147a106,110
> if ! ggdb --version &> /dev/null ; then
> 	echo "Setup has detected that the gnu debugger is not installed"
> 	read -p "Press [ENTER] to install the gnu debugger"
> 	sudo port install gdb
> 	echo
149,151c112,113
< 		echo "Setup has detected that the gnu debugger is not installed"
< 		read -p "Press [ENTER] to install the gnu debugger"
< 		sudo port install gdb
---
> 		echo "Setup has detected that the gnu debugger did not install"
> 		echo "done."
153,160d114
< 		if ! ggdb --version &> /dev/null ; then
< 			echo "Setup has detected that the gnu debugger did not install"
< 			echo "done."
< 			echo
< 			exit 1;
< 		fi
< 	else
< 		echo "Found gnu debugger"	
161a116,118
> else
> 	echo "Found gnu debugger"	
> fi
162a120,124
> if ! 7za --help &> /dev/null ; then
> 	echo "Setup has detected that the 7-zip is not installed"
> 	read -p "Press [ENTER] to install 7-zip"
> 	sudo port install p7zip
> 	echo
164,187c126,127
< 		echo "Setup has detected that the 7-zip is not installed"
< 		read -p "Press [ENTER] to install 7-zip"
< 		sudo port install p7zip
< 		echo
< 		if ! 7za --help &> /dev/null ; then
< 			echo "Setup has detected that 7-zip did not install"
< 			echo "done."
< 			echo
< 			exit 1;
< 		fi
< 	else
< 		echo "Found 7-zip"	
< 	fi
< 	sleep 2s
< 
< 	SIGNED="$(codesign -dv /opt/local/bin/ggdb 2>&1)"
< 
< 	if [[ $SIGNED == *"object is not signed"* ]]
< 	then
< 		echo
< 		echo "Setup has detected that the gnu debugger is not currently code signed." 
< 		echo
< 		echo "After install is complete you will be provided instructions on how to sign the" 
< 		echo "debugger. This will allow it authorization to attach to programs for debugging."
---
> 		echo "Setup has detected that 7-zip did not install"
> 		echo "done."
189,243d128
< 		read -p "Press [ENTER] to continue"
< 	fi
< 	
< elif [ $PACKAGER == "brew" ] ; then
< 
< 	# Add brew commands to the path if it's not already there
< 	if [[ ! "$PATH" == *"/usr/local/bin"* ]]; then
< 	   PATH=/usr/local/bin:$PATH
< 	fi
< 
< 	if ! which brew 2> /dev/null; then
< 		echo "Setup has detected that Homebrew is not installed"
< 		read -p "Press [ENTER] to install Homebrew"
< 		ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
< 		if ! which brew 2> /dev/null; then
< 			echo "Setup has detected that Homebrew was not completely installed"
< 			echo "done."
< 			echo
< 			exit 1;
< 		fi
< 	else
< 		echo "Found Homebrew"
< 	fi
< 
< 	echo "Checking if Homebrew is up to date"
< 	brew update
< 
< 	if ! gdb --version &> /dev/null ; then
< 	   echo "Setup has detected that the gnu debugger is not installed"
< 	   read -p "Press [ENTER] to install the gnu debugger"
< 	   brew install gdb
< 	   echo
< 	   if ! gdb --version &> /dev/null ; then
< 		  echo "Setup has detected that the gnu debugger did not install"
< 		  echo "done."
< 		  echo
< 		  exit 1
< 	   fi
< 	else
< 	   echo "Found gnu debugger"   
< 	fi
< 
< 	if ! 7za --help &> /dev/null ; then
< 	   echo "Setup has detected that the 7-zip is not installed"
< 	   read -p "Press [ENTER] to install 7-zip"
< 	   brew install p7zip
< 	   echo
< 	   if ! 7za --help &> /dev/null ; then
< 		  echo "Setup has detected that 7-zip did not install"
< 		  echo "done."
< 		  echo
< 		  exit 1
< 	   fi
< 	else
< 	   echo "Found 7-zip"   
244a130,132
> else
> 	echo "Found 7-zip"	
> fi
246c134
< 	SIGNED="$(codesign -dv /usr/local/bin/gdb 2>&1)"
---
> SIGNED="$(codesign -dv /opt/local/bin/ggdb 2>&1)"
248,257c136,144
< 	if [[ $SIGNED == *"object is not signed"* ]]
< 	then
< 	   echo
< 	   echo "Setup has detected that the gnu debugger is not currently code signed." 
< 	   echo
< 	   echo "After install is complete you will be provided instructions on how to sign the" 
< 	   echo "debugger. This will allow it authorization to attach to programs for debugging."
< 	   echo
< 	   read -p "Press [ENTER] to continue"
< 	fi
---
> if [[ $SIGNED == *"object is not signed"* ]]
> then
> 	echo
> 	echo "Setup has detected that the gnu debugger is not currently code signed." 
> 	echo
> 	echo "After install is complete you will be provided instructions on how to sign the" 
> 	echo "debugger. This will allow it authorization to attach to programs for debugging."
> 	echo
> 	read -p "Press [ENTER] to continue"
274c161
< echo "It will install svn trunk builds of:"
---
> echo "It will install copies of:"
290c177
< 	read CHOICE
---
> 		read CHOICE
301d187
< 	EXPAND=${EXPAND%/}
390c276
< ORIGIN="/Users/macuser/Development/Cocoa"
---
> ORIGIN="/Users/macuser/Development/FreePascal"
393,394c279
< replace "fpc/bin/x86_64-darwin" "$ORIGIN" "$BASE" "*.cfg" 
< replace "fpc/bin/x86_64-darwin" "$ORIGIN" "$BASE" "fpc.sh" 
---
> replace "fpc/bin" "$ORIGIN" "$BASE" "*.cfg" 
400a286,291
> TERMINAL="Free Pascal Terminal.command"
> echo "osascript -e 'tell app \"Terminal\"" > "$TERMINAL"
> echo "    do script \"export PPC_CONFIG_PATH=\\\"$BASE/fpc/bin\\\" && export PATH=\\\"\$PPC_CONFIG_PATH:\$PATH\\\"\"" >> "$TERMINAL"
> echo "end tell'" >> "$TERMINAL"
> chmod +x "$TERMINAL"
> 
412c303
< echo "Free Pascal $FPC with Lazarus $LAZ install complete"
---
> echo "Free Pascal 3.0 with Lazarus install complete"
422c313
< 	open "http://www.getlazarus.org/setup/macintosh/"
---
> 	open "http://lazarus.codebot.org/darwin/debugger"

2021 install setup for Catalina, Big Sur and Monterey

#!/bin/bash

This is the universal OSX script to install Free Pascal and Lazarus

Modified to install on Catalina, Big Sur and Monterey by [email protected]

If you need to fix something and or want to contribute, send your

changes to sysrpl at codebot dot org with "osx free pascal install"

in the subject line.

Change the line below to define your own install folder

BASE="$HOME/Development/FreePascal"

BASE can be whatever you want, but it should:

A) Be under your $HOME folder

B) Not already exist

TODO Prompt the user for the install folder and provide BASE as the default

Prevent this script from running as root

if [ "$(id -u)" = "0" ]; then
echo "This script should not be run as root"
exit 1
fi

FPC="3.0"
LAZ="1.5"
OS_TARGET="darwin"
OS_VERSION=$(sw_vers -productVersion | awk -F "." '{print $2}')

Add port commands to the path if it's not already there

if [[ ! "$PATH" == "/opt/local/bin" ]]; then
PATH=/opt/local/bin:$PATH
fi

Begin block comment

if [ 1 -eq 0 ]; then

if [ "$OS_VERSION" -eq 7 ]; then
echo "Detected OSX Lion"
elif [ "$OS_VERSION" -eq 8 ]; then
echo "Detected OSX Mountain Lion"
elif [ "$OS_VERSION" -eq 9 ]; then
echo "Detected OSX Mavericks"
elif [ "$OS_VERSION" -eq 10 ]; then
echo "Detected OSX Yosemite"
elif [ "$OS_VERSION" -eq 11 ]; then
echo "Detected OSX El Capitain"
elif [ "$OS_VERSION" -eq 12 ]; then
echo "Detected MacOS Sierra"
elif [ "$OS_VERSION" -eq 13 ]; then
echo "Detected MacOS High Sierra"
elif [ "$OS_VERSION" -eq 14 ]; then
echo "Detected MacOs Tiger"
elif [ "$OS_VERSION" -eq 15 ]; then
echo "Detected MacOs Catalina"
elif [ "$OS_VERSION" -eq 16 ]; then
echo "Detected MacOS Big Sur"
elif [ "$OS_VERSION" -eq 17 ]; then
echo "Detected MacOS Monterey"
else
echo "This installer does not recognize your OS"
echo "done."
echo
exit 1
fi

if ! xcode-select -p &> /dev/null ; then
echo "Setup has detected that xcode tools are not installed"
read -p "Press [ENTER] to install xcode tools"
sudo xcode-select --install &> /dev/null ;
echo "Please wait for xcode tools to install"
echo
sleep 10s
read -p "After code tools are installed press [ENTER] to continue"
echo
if ! xcode-select -p &> /dev/null ; then
echo "Setup has detected that xcode tools were not completely installed"
echo "Please wait for xcode tools to install and re-run this script"
echo "done."
echo
fi
else
echo "Found xcode tools"
fi

if ! port version &> /dev/null ; then
echo "Setup has detected that macports is not installed"
read -p "Press [ENTER] to install macports"
echo "Please wait for macports to install"
MACPORTS=/tmp/macports.pkg
if [ ! -f "$MACPORTS" ]; then
if [ "$OS_VERSION" -eq 7 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.7-Lion.pkg
elif [ "$OS_VERSION" -eq 8 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.8-MountainLion.pkg
elif [ "$OS_VERSION" -eq 9 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.9-Mavericks.pkg
elif [ "$OS_VERSION" -eq 10 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.10-Yosemite.pkg
elif [ "$OS_VERSION" -eq 11 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.11-ElCapitan.pkg
elif [ "$OS_VERSION" -eq 12 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.12-Sierra.pkg
elif [ "$OS_VERSION" -eq 13 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.13-HighSierra.pkg
elif [ "$OS_VERSION" -eq 14 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.14-Mojave.pkg
elif [ "$OS_VERSION" -eq 15 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-10.15-Catalina.pkg
elif [ "$OS_VERSION" -eq 16 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-11-BigSur.pkg
elif [ "$OS_VERSION" -eq 17 ]; then
PKGURL=https://distfiles.macports.org/MacPorts/MacPorts-2.7.1-12-Monterey.pkg
fi
curl "$PKGURL" -o "$MACPORTS"
fi
open $MACPORTS
echo
sleep 10s
read -p "After macports is installed press [ENTER] to continue"
echo
if ! port version &> /dev/null ; then
echo "Setup has detected that macports was not completely installed"
echo "Please wait for macports to install and re-run this script"
echo "done."
echo
fi
else
echo "Found macports"
fi

if ! ggdb --version &> /dev/null ; then
echo "Setup has detected that the gnu debugger is not installed"
read -p "Press [ENTER] to install the gnu debugger"
sudo port install gdb
echo
if ! ggdb --version &> /dev/null ; then
echo "Setup has detected that the gnu debugger did not install"
echo "done."
echo
fi
else
echo "Found gnu debugger"
fi

if ! 7za --help &> /dev/null ; then
echo "Setup has detected that the 7-zip is not installed"
read -p "Press [ENTER] to install 7-zip"
sudo port install p7zip
echo
if ! 7za --help &> /dev/null ; then
echo "Setup has detected that 7-zip did not install"
echo "done."
echo
fi
else
echo "Found 7-zip"
fi

SIGNED="$(codesign -dv /opt/local/bin/ggdb 2>&1)"

if [[ $SIGNED == "object is not signed" ]]
then
echo
echo "Setup has detected that the gnu debugger is not currently code signed."
echo
echo "After install is complete you will be provided instructions on how to sign the"
echo "debugger. This will allow it authorization to attach to programs for debugging."
echo
read -p "Press [ENTER] to continue"
fi

Cross platform expandPath function

function expandPath() {
if [ uname="Darwin" ]; then
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}";
else
echo $(readlink -m $1)
fi
}

Present a description of this script

clear
echo "This is the universal OSX script to install Free Pascal and Lazarus"
echo "-------------------------------------------------------------------"
echo
echo "It will install copies of:"
echo " Free Pascal $FPC"
echo " Lazarus $LAZ"
echo
echo "This script not interfere with your existing Lazarus environment"
echo

BASE=$HOME/Development/FreePascal

Ask a series of questions

while true; do
# Ask for an install location
echo "Enter an installation folder or press return to"
echo "accept the default install location"
echo
echo -n "[$BASE]: "
read CHOICE
echo

# Use BASE as the default
if [ -z "$CHOICE" ]; then
	CHOICE=$BASE
fi

# Allow for relative paths
CHOICE=`eval echo $CHOICE`
EXPAND=`expandPath "$CHOICE"`

# Allow install only under your home folder
if [[ $EXPAND == $HOME* ]]; then
	echo "The install folder will be:"
	echo "$EXPAND"
	echo
else
	echo "The install folder must be under your personal home folder"
	echo
	continue
fi

# Confirm their choice
echo -n "Continue? (y,n): "
read CHOICE
echo 

case $CHOICE in
	[yY][eE][sS]|[yY]) 
		;;
	*)
		echo "done."
		echo
		exit 1
		;;
esac

# If folder already exists ask to remove it
if [ -d "$EXPAND" ]; then
	echo "Directory already exist"
	echo -n "Remove the entire folder and overwrite? (y,n): "
	read CHOICE
	case $CHOICE in
		[yY][eE][sS]|[yY]) 
			echo
			rm -rf $EXPAND
			;;
		*)
			echo
			echo "done."
			echo
			exit 1
			;;
	esac
fi

break

done

Create the folder

BASE=$EXPAND
mkdir -p "$BASE"

Exit if the folder could not be created

if [ ! -d "$BASE" ]; then
echo "Could not create directory"
echo
echo "done."
echo
exit 1;
fi

CURRENT=pwd
cd $BASE

Download and extract the archive

ARCHIVE="fpc-$FPC.$OS_TARGET.7z"
curl "http://cache.getlazarus.org/archives/$ARCHIVE" -o "$ARCHIVE"
7za x "$ARCHIVE"
rm "$ARCHIVE"

fi

End block comment

function Replace(folder, search, replace, filespec)

function replace() {
cd "$BASE/$1"
shift
SEARCH=$(echo "$1" | sed 's/[*.]/\&/g')
SEARCH=$(echo "$SEARCH" | sed 's///\//g')
shift
REPLACE=$(echo "$1" | sed 's/[*.]/\&/g')
REPLACE=$(echo "$REPLACE" | sed 's///\//g')
shift
# Replace using perl
perl -pi -w -e "s/${SEARCH}/${REPLACE}/g;" $1 &> /dev/null
}

ORIGIN="/Users/macuser/Development/FreePascal"
replace "lazarus/config" "$ORIGIN" "$BASE" "."
replace "lazarus/lazarus.app/Contents/MacOS" "$ORIGIN" "$BASE" "lazarus"
replace "fpc/bin" "$ORIGIN" "$BASE" "*.cfg"
echo

cd $BASE
ditto ./lazarus/lazarus.app ./Lazarus.app/
cd $BASE

TERMINAL="Free Pascal Terminal.command"
echo "osascript -e 'tell app "Terminal"" > "$TERMINAL"
echo " do script "export PPC_CONFIG_PATH=\"$BASE/fpc/bin\" && export PATH=\"$PPC_CONFIG_PATH:$PATH\""" >> "$TERMINAL"
echo "end tell'" >> "$TERMINAL"
chmod +x "$TERMINAL"

Count this as an install

function hit() {
if type "curl" > /dev/null; then
curl -s -o /dev/null "$1"
elif type "wget" > /dev/null; then
wget -q -O /dev/null "$1"
fi
}

hit "http://www.getlazarus.org/installed/?platform=macintosh"

echo "Free Pascal 3.0 with Lazarus install complete"

if [[ $SIGNED == "object is not signed" ]]
then
echo
echo "The gnu debugger is not currently code signed"
echo
echo "Read http://lazarus.codebot.org/darwin/debugger for instructions on"
echo "how to code sign the debugger"
echo
open "http://lazarus.codebot.org/darwin/debugger"
echo
fi

open "$BASE"
cd $CURRENT

Syntax error in setup.sh

When I try to run setup.sh, I get following:
setup.sh: 51: setup.sh: Syntax error: "(" unexpected

My OS is Xubuntu 15.10

add support to new mac os

add support to new mac os
add after elif [ "$OS_VERSION" -eq 11 ]; then
echo "Detected OSX El Capitain"

add this
elif [ "$OS_VERSION" -eq 14 ]; then
echo "Detected OSX mojave"

you can replace 14 with mac os ver and change "OSX mojave" mac os name .

that all .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.