From ebf4559ede4a1540a6c551c03f60a566b36b8022 Mon Sep 17 00:00:00 2001 From: Nathan Fiedler Date: Wed, 10 Feb 2016 18:11:32 -0800 Subject: [PATCH] Instructions for building on various platforms Include Vagrant files for FreeBSD 10.2 and Ubuntu Linux 14.04 LTS. --- README.md | 1 - docs/Development_Setup.md | 70 +++++++++++++++++++++++++++++++++++ vagrant/freebsd10/Vagrantfile | 25 +++++++++++++ vagrant/ubuntu14/Vagrantfile | 20 ++++++++++ 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 docs/Development_Setup.md create mode 100644 vagrant/freebsd10/Vagrantfile create mode 100644 vagrant/ubuntu14/Vagrantfile diff --git a/README.md b/README.md index 56aeef0..3f87c46 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ A somewhat safe Rust interface to the [ImageMagick](http://www.imagemagick.org/) * Rust * Cargo * ImageMagick (version 6 or higher) -* On Mac OS X: Xcode and Command Line Tools (`xcode-select --install`) ## Build and Test diff --git a/docs/Development_Setup.md b/docs/Development_Setup.md new file mode 100644 index 0000000..110653a --- /dev/null +++ b/docs/Development_Setup.md @@ -0,0 +1,70 @@ +# Development Setup + +## Mac OS X + +1. Install Xcode +1. Install Homebrew +1. Install Git +1. Install Rust and Cargo +1. Install ImageMagick + +``` +$ xcode-select --install +$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ brew install git +$ brew install rust +$ brew install imagemagick +``` + +Then build in the usual manner, as shown in the `README.md` file (i.e. `cargo build` and `cargo test`). + +## FreeBSD + +1. Install Git +1. Install Rust +1. Install Cargo +1. Install ImageMagick +1. Install the Clang libraries + +``` +$ sudo pkg install -y git +$ sudo pkg install -y rust +$ sudo pkg install -y cargo +$ sudo pkg install -y ImageMagick-nox11 +$ sudo pkg install -y clang-devel +``` + +### Building + +The rust-bindgen tool (or one of its dependencies) needs a little help finding the Clang library during the build process, so set `LIBCLANG_PATH` to the path of `libclang.so`. The steps below work for FreeBSD 10.2. + +``` +$ setenv LIBCLANG_PATH /usr/local/llvm-devel/lib +$ cargo build +$ cargo test +``` + +## Ubuntu Linux + +1. Install Git +1. Install Rust and Cargo +1. Install ImageMagick +1. Install the Clang libraries + +These steps are known to work for Ubuntu Linux 14.04 LTS. + +``` +$ sudo apt-get install git +$ curl -sSf https://static.rust-lang.org/rustup.sh | sh +$ sudo apt-get build-dep imagemagick +$ wget http://www.imagemagick.org/download/ImageMagick.tar.gz +$ tar zxf ImageMagick.tar.gz +$ cd ImageMagick-* +$ ./configure +$ make +$ sudo make install +$ cd .. +$ sudo apt-get install libclang-dev +``` + +Then build in the usual manner, as shown in the `README.md` file (i.e. `cargo build` and `cargo test`). diff --git a/vagrant/freebsd10/Vagrantfile b/vagrant/freebsd10/Vagrantfile new file mode 100644 index 0000000..6af64f9 --- /dev/null +++ b/vagrant/freebsd10/Vagrantfile @@ -0,0 +1,25 @@ +# +# Vagrantfile for FreeBSD 10.2 test environment. +# +Vagrant.configure(2) do |config| + + config.vm.box = "freebsd/FreeBSD-10.2-RELEASE" + + # this box needs a MAC address + config.vm.base_mac = '0800273E2877' + + # need enough memory to build syntex_syntax crate + config.vm.provider 'virtualbox' do |vb| + vb.memory = 2048 + end + + # bring the system up to date + config.vm.provision "shell", inline: <<-SHELL + sudo freebsd-update fetch install + sudo pkg update + sudo pkg upgrade -y + sudo pkg autoremove -y + sudo pkg clean -y + SHELL + +end diff --git a/vagrant/ubuntu14/Vagrantfile b/vagrant/ubuntu14/Vagrantfile new file mode 100644 index 0000000..75b2f70 --- /dev/null +++ b/vagrant/ubuntu14/Vagrantfile @@ -0,0 +1,20 @@ +# +# Vagrantfile for Ubuntu 14.04 test environment. +# +Vagrant.configure(2) do |config| + + config.vm.box = "ubuntu/trusty64" + + # need enough memory to build syntex_syntax crate + config.vm.provider 'virtualbox' do |vb| + vb.memory = 2048 + end + + # bring the system up to date + config.vm.provision "shell", inline: <<-SHELL + sudo apt-get autoremove + sudo apt-get update + sudo apt-get upgrade + SHELL + +end