From 4b753e792ac0b2445eacfc31ba069026823521d9 Mon Sep 17 00:00:00 2001
From: Eloy Retamino <retamino@ugr.es>
Date: Tue, 21 Jul 2020 16:20:31 +0200
Subject: [PATCH] [NRRPLT-7942] updated scripts to build gzbridge in ubuntu
 20.04

---
 CMakeLists.txt         | 2 +-
 deploy-gzbridge-nrp.sh | 4 ++++
 gzbridge/binding.gyp   | 1 +
 package.json           | 4 ++--
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e647f6..64a09f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,7 @@ else()
 endif()
 
 include(FindBoost)
-find_package(Boost ${MIN_BOOST_VERSION} REQUIRED system filesystem regex thread)
+find_package(Boost ${MIN_BOOST_VERSION} REQUIRED system filesystem regex thread program_options iostreams date_time)
 find_package(Protobuf REQUIRED)
 
 # Find tinyxml. Only debian distributions package tinyxml with a pkg-config
diff --git a/deploy-gzbridge-nrp.sh b/deploy-gzbridge-nrp.sh
index 42aed7e..12d459d 100755
--- a/deploy-gzbridge-nrp.sh
+++ b/deploy-gzbridge-nrp.sh
@@ -33,6 +33,10 @@ make -j `nproc`
 
 cd ../gzbridge
 $DIR/node_modules/.bin/node-gyp configure
+
+# gazebo pkg-config in binding.gyp adds some weird -lBoost::* dependencies to the build command that can't be found. Manually replacing them with the right boost library names
+sed -i 's/Boost::/boost_/g' build/gzbridge.target.mk
+
 $DIR/node_modules/.bin/node-gyp build -r
 
 RETVAL=$?
diff --git a/gzbridge/binding.gyp b/gzbridge/binding.gyp
index 2f0c490..c788491 100644
--- a/gzbridge/binding.gyp
+++ b/gzbridge/binding.gyp
@@ -7,6 +7,7 @@
         "pb2json.cc", "pb2json.hh",
         "ConfigLoader.cc", "ConfigLoader.hh",
         "OgreMaterialParser.cc", "OgreMaterialParser.hh"],
+      'cflags_cc': [ '-std=c++17' ],
       'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
       'cflags!': [ '-fno-exceptions' ],
       "include_dirs": [
diff --git a/package.json b/package.json
index cb918c1..2db342e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "gzweb",
-  "version": "3.0.5",
+  "version": "3.0.0",
   "description": "WebGL client for Gazebo",
   "repository": {
     "type": "mercurial",
@@ -23,7 +23,7 @@
   "dependencies": {
     "debug": "^2.6.1",
     "http-server": "",
-    "node-gyp": "3.8.0",
+    "node-gyp": "5.0.5",
     "websocket": "",
     "wide-align": "1.1.0",
     "request": "2.81.0"
-- 
GitLab