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