Commit 859766f1 authored by Patrick Double's avatar Patrick Double Committed by Daniel Agar

Vagrant qt5.7 5064 (#5169)

* Add resource config for vmware

* Ignore vagrant directory

* Vagrant config use Qt 5.7

* Vagrant support docker provisioner and use Ubuntu 16.04

* Fix paths for Vagrant build

* Update Vagrantfile to match Travis

* Prefer VM providers over docker

* Get apt packages and environment from travis.yml

* Add graphical environment to Vagrantfile

* Use full Qt 5.7.1 download
parent 7efc47f1
...@@ -79,3 +79,8 @@ android/gradle.properties ...@@ -79,3 +79,8 @@ android/gradle.properties
# doxygen # doxygen
src/html/ src/html/
src/latex/ src/latex/
# vagrant
.vagrant/
Qt*-linux*.tar.*
configs: configs:
dev: dev:
'qt_deps_tarball': 'Qt5.5.1-linux.tar.bz2' 'qt_deps_tarball': 'Qt5.7.1-linux-vagrant.tar.bz2'
'qt_deps_unpack_parent_dir': '/tmp' 'qt_deps_unpack_parent_dir': '/tmp'
'qt_deps_unpack_dir': '/tmp/Qt' 'qt_deps_unpack_dir': '/tmp/Qt5.7-vagrant/5.7'
'qt_deps_bin_unpack_dir': '/tmp/Qt/5.5/gcc_64/bin' 'qt_deps_bin_unpack_dir': '/tmp/Qt5.7-vagrant/5.7/gcc_64/bin'
'qt_deps_lib_unpack_dir': '/tmp/Qt/5.5/gcc_64/lib' 'qt_deps_lib_unpack_dir': '/tmp/Qt5.7-vagrant/5.7/gcc_64/lib'
'qt_deps_plugins_unpack_dir': '/tmp/Qt/5.5/gcc_64/plugins' 'qt_deps_plugins_unpack_dir': '/tmp/Qt5.7-vagrant/5.7/gcc_64/plugins'
'qt_deps_qml_unpack_dir': '/tmp/Qt/5.5/gcc_64/qml' 'qt_deps_qml_unpack_dir': '/tmp/Qt5.7-vagrant/5.7/gcc_64/qml'
'project_root_dir': '/vagrant' 'project_root_dir': '/vagrant'
...@@ -20,4 +20,4 @@ configs: ...@@ -20,4 +20,4 @@ configs:
'spec': 'linux-g++-64' 'spec': 'linux-g++-64'
'shadow_build_dir': '/vagrant/shadow-build' 'shadow_build_dir': '/vagrant/shadow-build'
'pro': '/vagrant/qgroundcontrol.pro' 'pro': '/vagrant/qgroundcontrol.pro'
'deps_url': 'https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2' 'deps_url': 'https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.7.1-linux-vagrant.tar.bz2'
...@@ -72,6 +72,7 @@ A Vagrantfile is provided to build QGroundControl using the [Vagrant](https://ww ...@@ -72,6 +72,7 @@ A Vagrantfile is provided to build QGroundControl using the [Vagrant](https://ww
* [Download](https://www.vagrantup.com/downloads.html) Vagrant * [Download](https://www.vagrantup.com/downloads.html) Vagrant
* [Install](https://www.vagrantup.com/docs/getting-started/) Vagrant * [Install](https://www.vagrantup.com/docs/getting-started/) Vagrant
* From the root directory of the QGroundControl repository run "vagrant up" * From the root directory of the QGroundControl repository run "vagrant up"
* To use the graphical environment run "vagrant reload"
#### Additional build notes for all supported OS #### Additional build notes for all supported OS
......
...@@ -6,14 +6,36 @@ ...@@ -6,14 +6,36 @@
require 'yaml' require 'yaml'
current_dir = File.dirname(File.expand_path(__FILE__)) current_dir = File.dirname(File.expand_path(__FILE__))
configfile = YAML.load_file("#{current_dir}/.vagrantconfig.yml") configfile = YAML.load_file("#{current_dir}/.vagrantconfig.yml")
yaml_config = configfile['configs']['dev'] travisfile = YAML.load_file("#{current_dir}/.travis.yml")
yaml_config = configfile['configs']['dev']
Vagrant.configure(2) do |config| Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64" # This trick is used to prefer a VM box over docker
config.vm.provider "virtualbox"
config.vm.provider "vmware_fusion"
config.vm.box = "boxcutter/ubuntu1604"
config.vm.provider :docker do |docker, override|
override.vm.box = "tknerr/baseimage-ubuntu-16.04"
end
config.vm.provider :virtualbox do |vb| config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "4096"] vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--cpus", "1"] vb.customize ["modifyvm", :id, "--cpus", "1"]
vb.gui = true
end
["vmware_fusion", "vmware_workstation"].each do |p|
config.vm.provider p do |v|
v.vmx["memsize"] = "4096"
v.vmx["numvcpus"] = "1"
v.gui = true
end
end
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
config.cache.synced_folder_opts = {
owner: "_apt"
}
end end
# the "dev configuration puts the build products and a suitable # the "dev configuration puts the build products and a suitable
...@@ -22,14 +44,17 @@ Vagrant.configure(2) do |config| ...@@ -22,14 +44,17 @@ Vagrant.configure(2) do |config|
# "cd shadow-build/release; ./qgroundcontrol-start.sh" # "cd shadow-build/release; ./qgroundcontrol-start.sh"
$config_shell = <<-'SHELL' $config_shell = <<-'SHELL'
set -e
export %{build_env}
export JOBS=$((`cat /proc/cpuinfo | grep -c ^processor`+1))
sudo apt-get update -y sudo apt-get update -y
sudo apt-get dist-upgrade -y # we need this long command to keep packages (grub-pc esp.) from prompting for input
sudo apt-get install -y git build-essential sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
sudo apt-get install -y espeak libespeak-dev libudev-dev libsdl2-dev sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install %{apt_pkgs} xubuntu-desktop qtcreator
sudo apt-get install -y doxygen sudo systemctl set-default graphical.target
sudo apt-get install -y gstreamer1.0* libgstreamer1.0*
# taken from travis.yml
echo 'Initialising submodules' echo 'Initialising submodules'
su - vagrant -c 'cd %{project_root_dir}; git submodule init && git submodule update' su - vagrant -c 'cd %{project_root_dir}; git submodule init && git submodule update'
...@@ -39,15 +64,17 @@ Vagrant.configure(2) do |config| ...@@ -39,15 +64,17 @@ Vagrant.configure(2) do |config|
su - vagrant -c 'mkdir -p %{qt_deps_unpack_parent_dir}' su - vagrant -c 'mkdir -p %{qt_deps_unpack_parent_dir}'
su - vagrant -c 'cd %{project_root_dir}; tar jxf "%{qt_deps_tarball}" -C %{qt_deps_unpack_parent_dir}' su - vagrant -c 'cd %{project_root_dir}; tar jxf "%{qt_deps_tarball}" -C %{qt_deps_unpack_parent_dir}'
su - vagrant -c 'rm -rf %{shadow_build_dir}' su - vagrant -c 'rm -rf %{shadow_build_dir}'
# grab latest PX4 parameter and airframe metadata
su - vagrant -c 'wget http://px4-travis.s3.amazonaws.com/Firmware/master/parameters.xml -O %{project_root_dir}/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml'
su - vagrant -c 'wget http://px4-travis.s3.amazonaws.com/Firmware/master/airframes.xml -O %{project_root_dir}/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml'
su - vagrant -c 'mkdir -p %{shadow_build_dir}' su - vagrant -c 'mkdir -p %{shadow_build_dir}'
su - vagrant -c "cd %{shadow_build_dir}; LD_LIBRARY_PATH=%{qt_deps_lib_unpack_dir} PATH=%{qt_deps_bin_unpack_dir}:\$PATH qmake -r %{pro} -spec %{spec}" su - vagrant -c "cd %{shadow_build_dir}; LD_LIBRARY_PATH=%{qt_deps_lib_unpack_dir} PATH=%{qt_deps_bin_unpack_dir}:\$PATH qmake -r %{pro} CONFIG+=\${CONFIG} CONFIG+=WarningsAsErrorsOn -spec %{spec}"
su - vagrant -c "cd %{shadow_build_dir}; LD_LIBRARY_PATH=%{qt_deps_lib_unpack_dir} PATH=%{qt_deps_bin_unpack_dir}:\$PATH make -j4" su - vagrant -c "cd %{shadow_build_dir}; LD_LIBRARY_PATH=%{qt_deps_lib_unpack_dir} PATH=%{qt_deps_bin_unpack_dir}:\$PATH make -j${JOBS}"
su - vagrant -c 'mkdir -p %{qt_deps_dir}' #su - vagrant -c 'mkdir -p %{shadow_build_dir}/release/package'
su - vagrant -c 'cp -a %{qt_deps_bin_unpack_dir} %{qt_deps_bin_dir}' #su - vagrant -c 'cd %{project_root_dir}; ./deploy/create_linux_appimage.sh %{project_root_dir} %{shadow_build_dir}/release %{shadow_build_dir}/release/package'
su - vagrant -c 'cp -a %{qt_deps_lib_unpack_dir} %{qt_deps_lib_dir}'
su - vagrant -c 'cp -a %{qt_deps_plugins_unpack_dir} %{qt_deps_plugins_dir}'
su - vagrant -c 'cp -a %{qt_deps_qml_unpack_dir} %{qt_deps_qml_dir}'
SHELL SHELL
...@@ -57,6 +84,8 @@ Vagrant.configure(2) do |config| ...@@ -57,6 +84,8 @@ Vagrant.configure(2) do |config|
:pro => yaml_config['pro'], :pro => yaml_config['pro'],
:spec => yaml_config['spec'], :spec => yaml_config['spec'],
:deps_url => yaml_config['deps_url'], :deps_url => yaml_config['deps_url'],
:apt_pkgs => (travisfile['addons']['apt']['packages']+['git', 'build-essential', 'fuse']).join(' '),
:build_env => travisfile['env']['global'].select { |item| item.is_a?(String) }.join(' '),
:project_root_dir => yaml_config['project_root_dir'], :project_root_dir => yaml_config['project_root_dir'],
:qt_deps_unpack_parent_dir => yaml_config['qt_deps_unpack_parent_dir'], :qt_deps_unpack_parent_dir => yaml_config['qt_deps_unpack_parent_dir'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment