-
Notifications
You must be signed in to change notification settings - Fork 8
Mac OSX Installation
The following prerequisites and instructions are needed to install Bachelor locally on your machine.
- Make sure MAMP is the latest version.
- It is beneficial to make an alias to MAMP's PHP. This can be done by editing your .bash_profile and adding the following line (Note: The path may vary depending on your version of MAMP):
alias phpm="/Applications/MAMP/bin/php/php5.X.X/bin/php"
- You will need composer to install Symfony. This can be done by executing the following command in terminal:
curl -sS https://getcomposer.org/installer | phpm
- Clone the repository to your local machine. The directory you clone the repository to should be the document root that is set in MAMP. (e.g. /Applications/MAMP/htdocs)
- Once cloned, you will need to run composer to install MAMP. Provided you have done the prerequisites to install Bachelor, you can achieve this by running the following in terminal in the Symfony folder of Bachelor:
phpm PATH/TO/composer.phar install
You will be prompted several times about settings for your environment and Bachelor. - Once you have completed installation via composer, you will need to create the database and schema as well as populate the default board data. To do this, run the following commands while in the Symfony folder of Bachelor:
phpm app/console codebender:install
or
phpm app/console doctrine:database:create
phpm app/console doctrine:schema:create
phpm app/console doctrine:fixtures:load
After this is all completed you are now ready to move onto installing the Compiler, Libraries, and Sender.
For the Compiler, you will need Clang, Pear, and AVR-GCC.
Pear is included in MAMP, and can be found in:
/Applications/MAMP/bin/php/php5.X.X/bin/pear
You may wish to create an alias to pear, so you can easily run commands with it.
Clang is included in Xcode's command line tools. To do this, go to the Xcode in the Mac App Store and download. You will need the command lines tools to install Clang, which if you are using OSX 10.9 requires going into Apples Developer Portal and downloading them. Go here, login using your iTunes account (it's free), and download the Command Line Tools. You can search for them on the left hand pane. Once downloaded simply install them.
If you are using a older version of OSX, the command line tools can be found in the preferences pane under download, in Xcode.
AVR-GCC is included in a handy package called CrossPack. To download this, go here and click the download button. Download the latest version of the package and install it once it's completed. Once completed you will be able to use avr-gcc.
To install Arduino, simply go to the Arduino Software page and download the OSX version.
Install the codebender libraries outside the Symfony directory of the Bachelor repository. Do this with the following command:
git clone https://github.com/codebendercc/libs
After cloning the repository remember to run composer to install the libraries. Run the command using phpm /PATH/TO/composer.phar install
.
You will now need to setup MAMP's virtual hosts. To do this, follow the steps outlined below.
Open the Virtual Hosts file located at /Appliations/MAMP/conf/apache/extra/httpd-vhosts.conf
using the editor of your choice. From here copy and paste the following entry, replacing /PATH/TO with the correct path to the Symfony directory you cloned in the previous step.
<VirtualHost *:80>
ServerName libs.codebender.cc
#ServerAlias www.example.com
ServerAdmin root@localhost
DirectoryIndex index.php
DocumentRoot /PATH/TO/libs/Symfony/web
<Directory /PATH/TO/libs/Symfony/web/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
After this is completed you must ensure that MAMP listens to your Virtual Host entry. To do this, edit the file located at /Applications/MAMP/conf/apache/httpd.conf
, and uncomment line 525. You entry should look like the following:
# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Make sure to restart MAMP after changing the virtual hosts files for the changes to take affect.
You will need to setup TFTP to test Symfony. To do this, follow the tutorial listed here, as Mac OSX already comes with TFTP installed, but is non-trivial to setup.