source: installer/vagrant/Vagrantfile-browser-vbox

qndtest
Last change on this file was d3f623d, checked in by Irina Gómez <irinagomez@…>, 2 years ago

#1066 Changes devel branch name.

  • Property mode set to 100644
File size: 3.0 KB
RevLine 
[28d0df2]1# Vagrantfile to compile OpenGnsys Browser using VirtualBox provider.
2
3VAGRANTFILE_API_VERSION = "2"
4# VM provider: Oracle VM VirtualBox.
5ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox"
6# Language.
7LANGUAGE = "es_ES"
8ENV['LC_ALL'] = LANGUAGE + ".UTF-8"
[b32e00f]9# Amount of virtual memory and virtual CPUs.
[28d0df2]10VMMEM = 2048
11VMCPUS = 2
12# OpenGnsys boot-tools environment provisioning script.
13SCRIPT = <<EOT
14# Set language.
15export LANG="#{LANGUAGE}.UTF-8"
[5f4cfdc]16echo "LANG=\\\"$LANG\\\"" > /etc/default/locale
17echo "LANG=\\\"$LANG\\\"" >> /etc/environment
[28d0df2]18locale-gen --lang #{LANGUAGE}
[5f4cfdc]19sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard
[28d0df2]20dpkg-reconfigure -fnoninteractive console-setup
21# Install main dependencies.
22apt-get update
23apt-get install -y build-essential gettext libssl-dev libucommon-dev libxtst-dev subversion
[34994c7]24# Compile Qt-Embedded 4.8 (accept Open Source license).
25wget http://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
[28d0df2]26tar xvzf qt-everywhere-opensource-src-4.8.7.tar.gz
27cd qt-everywhere-opensource-src-4.8.7
28echo "yes" | ./configure -opensource -embedded x86 -webkit -openssl -qt-gfx-vnc -qvfb -prefix /usr/local/ -nomake demos -nomake examples
29make
30make install
[34994c7]31# Compile the Browser.
[d3f623d]32BRANCH="main"
[279c269]33svn export "https://github.com/opengnsys/ogBrowser/branches/$BRANCH/" ../browser
[34994c7]34cd ../browser
[28d0df2]35qmake browser.pro
36make
37strip browser
[bf7643d]38# Update locale string files.
39xgettext -C --qt --from-code=UTF-8 -o browser.pot src/*.cpp
40msgmerge -U po/en.po browser.pot
41msgmerge -U po/ca.po browser.pot
42rm -f browser.pot
[28d0df2]43# Instructions.
44echo "Browser's code is in /home/vagrant/browser directory."
45echo "To compile a new Browser, run as root user:"
46echo "    cd /home/vagrant/browser && qmake browser.pro && make"
[bf7643d]47echo "To compile new locale files (note that \"xx\" is a locale code, like \"en\" or \"ca\"):"
48echo " - Translate strings by editing each po/xx.po file."
49echo " - Compile each locale file by running as root: msgfmt -o xx.mo po/xx.po"
50echo "Do not forget to copy all Browser's files to the OpenGnsys Server:"
[28d0df2]51echo " - Browser binary to /opt/opengnsys/client/bin directory on server."
52echo " - Qt linked libraries to /opt/opengnsys/client/lib/qtlibs directory."
[80fd30e]53echo " - 64-bit-based ogLive only: libssl and libcrypto to /opt/opengnsys/client/lib/qtlibs directory."
[bf7643d]54echo " - Compiled Locale files, if needed: xx.mo as /opt/opengnsys/client/lib/locale/xx/LC_MESSAGES/browser.mo (\"xx\" is a locale code)."
[28d0df2]55EOT
56
57Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
58
59  # OpenGnsys boot-tools environment VM definition.
60  config.vm.define "ogBrowser" do |br|
61    # Specific VirtualBox configuration.
62    br.vm.provider "virtualbox" do |vb|
63      # VM name, memory and CPUs.
64      vb.name = "ogBrowser"
65      vb.memory = VMMEM
66      vb.cpus = VMCPUS
67    end
68    # VM base and host name.
69    br.vm.box = "ubuntu/trusty32"
70    br.vm.hostname = "ogBrowser"
[b32e00f]71    # Comment out to disable synced folder.
[28d0df2]72    #br.vm.synced_folder ".", "/vagrant", disabled: true
73    # Launch provisioning script.
74    br.vm.provision "shell", inline: SCRIPT
75  end
76
77end
78
Note: See TracBrowser for help on using the repository browser.