Skip to content
Permalink
Browse files
Vagrant: add a PROJ6 build
  • Loading branch information
rouault committed Oct 1, 2019
1 parent cce4556 commit 6327340edd9183d13f7f9b106ba54a918ba60a45
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
@@ -7,14 +7,17 @@ require 'socket'
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vm_ram = ENV['VAGRANT_VM_RAM'] || 1024
vm_cpu = ENV['VAGRANT_VM_CPU'] || 2

config.vm.box = "ubuntu/trusty64"

config.vm.hostname = "mapserver-vagrant"

config.vm.network :forwarded_port, guest: 80, host: 8080

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 1024, "--cpus", 2]
v.customize ["modifyvm", :id, "--memory", vm_ram, "--cpus", vm_cpu]
v.customize ["modifyvm", :id, "--ioapic", "on", "--largepages", "off", "--vtxvpid", "off"]
v.name = "mapserver-vagrant"
end
@@ -31,6 +34,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", path: "scripts/vagrant/virtualbox-fix.sh"
config.vm.provision "shell", path: "scripts/vagrant/packages.sh"
config.vm.provision "shell", path: "scripts/vagrant/postgis.sh"
config.vm.provision "shell", path: "scripts/vagrant/proj6.sh"
config.vm.provision "shell", path: "scripts/vagrant/mapserver.sh"

end
@@ -1,6 +1,6 @@
#!/bin/sh
#!/bin/bash

NUMTHREADS=2 # we have 2 cpus configured
NUMTHREADS=$(nproc)
export NUMTHREADS

cd /vagrant
@@ -24,3 +24,18 @@ cmake -G "Unix Makefiles" -DWITH_CLIENT_WMS=1 \

make -j $NUMTHREADS
sudo make install
cd ..

mkdir build_vagrant_proj6
cd build_vagrant_proj6
cmake -G "Unix Makefiles" -DWITH_CLIENT_WMS=1 \
-DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_PHP=1 \
-DWITH_PYTHON=1 -DWITH_JAVA=0 -DWITH_THREAD_SAFETY=1 \
-DWITH_FCGI=0 -DWITH_EXEMPI=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWITH_RSVG=1 -DWITH_CURL=1 -DWITH_FRIBIDI=1 -DWITH_HARFBUZZ=1 \
-DPROJ_INCLUDE_DIR=/vagrant/install-vagrant-proj-6/include -DPROJ_LIBRARY=/vagrant/install-vagrant-proj-6/lib/libproj.so.15 \
-DCMAKE_C_FLAGS="-DPROJ_RENAME_SYMBOLS" -DCMAKE_CXX_FLAGS="-DPROJ_RENAME_SYMBOLS" \
..

make -j $NUMTHREADS
cd ..
@@ -18,4 +18,5 @@ apt-get install -q -y git build-essential pkg-config cmake libgeos-dev rake \
librsvg2-dev libpng12-dev libjpeg-dev libgif-dev \
libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev \
libgdal1-dev libfribidi-dev libexempi-dev \
libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler libharfbuzz-dev gdal-bin
libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler libharfbuzz-dev gdal-bin \
curl sqlite3
@@ -0,0 +1,14 @@
#!/bin/bash

set -eu

NUMTHREADS=$(nproc)
export NUMTHREADS

cd /vagrant
curl -s http://download.osgeo.org/proj/proj-6.1.1.tar.gz > proj-6.1.1.tar.gz
tar xzf proj-6.1.1.tar.gz
rm -rf vagrant-proj
mv proj-6.1.1 vagrant-proj
(cd vagrant-proj/data && curl -s http://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz > proj-datumgrid-1.8.tar.gz && tar xvzf proj-datumgrid-1.8.tar.gz)
(cd vagrant-proj; CFLAGS='-DPROJ_RENAME_SYMBOLS -O2' CXXFLAGS='-DPROJ_RENAME_SYMBOLS -O2' ./configure --disable-static --prefix=/vagrant/install-vagrant-proj-6 && make -j $NUMTHREADS && make -j $NUMTHREADS install)

0 comments on commit 6327340

Please sign in to comment.