source: installer/vagrant/Vagrantfile-browser-vbox

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

#1066 Changes devel branch name.

  • Property mode set to 100644
File size: 3.0 KB
Line 
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"
9# Amount of virtual memory and virtual CPUs.
10VMMEM = 2048
11VMCPUS = 2
12# OpenGnsys boot-tools environment provisioning script.
13SCRIPT = <<EOT
14# Set language.
15export LANG="#{LANGUAGE}.UTF-8"
16echo "LANG=\\\"$LANG\\\"" > /etc/default/locale
17echo "LANG=\\\"$LANG\\\"" >> /etc/environment
18locale-gen --lang #{LANGUAGE}
19sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard
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
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
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
31# Compile the Browser.
32BRANCH="main"
33svn export "https://github.com/opengnsys/ogBrowser/branches/$BRANCH/" ../browser
34cd ../browser
35qmake browser.pro
36make
37strip browser
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
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"
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:"
51echo " - Browser binary to /opt/opengnsys/client/bin directory on server."
52echo " - Qt linked libraries to /opt/opengnsys/client/lib/qtlibs directory."
53echo " - 64-bit-based ogLive only: libssl and libcrypto to /opt/opengnsys/client/lib/qtlibs directory."
54echo " - Compiled Locale files, if needed: xx.mo as /opt/opengnsys/client/lib/locale/xx/LC_MESSAGES/browser.mo (\"xx\" is a locale code)."
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"
71    # Comment out to disable synced folder.
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.