-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathVagrantfile
More file actions
110 lines (83 loc) · 2.92 KB
/
Vagrantfile
File metadata and controls
110 lines (83 loc) · 2.92 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# -*- mode: ruby -*-
# vi: set ft=ruby :
required_plugins = %w( vagrant-vbguest )
required_plugins.each do |plugin|
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end
Vagrant.configure(2) do |config|
config.vm.box = "janihur/ubuntu-1404-desktop"
config.vm.synced_folder "C:/HostFolder", "/home/vagrant/inkscape/", disabled: true
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "3000"
vb.cpus = 4
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
vb.customize ["modifyvm", :id, "--vram", "12"]
end
# PROVISION SCRIPT
$script = <<-SHELL
# Break on any error
set -e
# US keyboard not Finnish!
sudo echo "setxkbmap -layout us" >>/home/vagrant/.bashrc
# SE .deb source instead of FI
sudo sed -e 's/fi.archive/se.archive/' -i /etc/apt/sources.list
# Add Inkscape trunk PPA
sudo add-apt-repository -y ppa:inkscape.dev/trunk
sudo apt-get update
# Source control
sudo apt-get -y install git
# Get the source!
cd /home/vagrant
echo "Fetching Inkscape source..."
git clone https://gitlab.com/inkscape/inkscape.git --single-branch
# Old Bazaar based source checkout
#bzr checkout lp:inkscape
# Install Google Test Framework
cd /home/vagrant/inkscape
sudo ./download-gtest.sh
# Minimal Inkscape dependencies
sudo apt-get -y build-dep inkscape
# Extra Inkscape dependencies: cdr, visio file format support
sudo apt-get -y install libcdr-dev libvisio-dev
# Extra Inkscape dependency for bitmap tracing and paintbucket
sudo apt-get -y install libpotrace-dev
# Build tools
sudo apt-get -y install ccache autopoint
# Couple of editors
sudo apt-get -y install gedit vim
# cmake build system
sudo apt-get -y install cmake cmake-curses-gui
# GTK3.0 experimental building
sudo apt-get -y install libgtk-3-dev libgdl-3-dev libgtkmm-3.0-dev libgtkspell3-3-dev
# Create Makefiles with cmake build system
mkdir /home/vagrant/build-inkscape
cd /home/vagrant/build-inkscape
export CFLAGS="-g -O0 -Wall"
export CC="ccache gcc"
export CXXFLAGS="-g -O0 -Wall -std=c++11"
export CXX="ccache g++"
cmake -D CMAKE_CXX_FLAGS:STRING="$CXXFLAGS" -D WITH_GTK3_EXPERIMENTAL:BOOL=YES -D CMAKE_BUILD_TYPE:STRING=Debug ../inkscape
# To enable rebuilding inside VM (file modifications)
sudo chown vagrant /home/vagrant/inkscape/ -R
sudo chown vagrant /home/vagrant/build-inkscape/ -R
# Old build system
#./autogen.sh
#./configure -enable-gtk3-experimental
# Compile & install Inkscape
cd /home/vagrant/build-inkscape
make -j 2
sudo make install
# Finished!
echo "Inkscape built successfully. To run inkscape:"
echo "1. Login to the VM with user vagrant, password vagrant"
echo "2. Make some changes in /home/vagrant/inkscape/src"
echo "3. Re-build Inkscape*"
echo "4. Run the binary /home/vagrant/build-inkscape/bin/inkscape"
echo ""
echo "*To build inkscape showing only errors (no warnings):"
echo ""
echo " make -j 2>&1 >/dev/null | grep error"
SHELL
config.vm.provision "shell", inline: $script
end