From 03da6f172e3c5777e85c0c17f1b5c0321798e855 Mon Sep 17 00:00:00 2001
From: Anthony Mallet <anthony.mallet@laas.fr>
Date: Fri, 10 Apr 2020 14:49:42 +0200
Subject: [PATCH] [mk] Detect PAL robotics distributions

PAL distributions are vanilla Ubuntu, with a few custom packages in /opt/pal.
The OS_VERSION is set to the Ubuntu version suffixed with .PAL.

Adapt the few locations where a test on OS_VERSION == 16.04 or 18.04 is made,
to include 16.04% or 18.04% and match the .PAL suffix.
---
 pal-gazebo-plugins/Makefile     | 2 +-
 pal-gazebo-plugins/depend.mk    | 2 +-
 pal-hardware-gazebo/Makefile    | 2 +-
 pal-hardware-gazebo/depend.mk   | 2 +-
 play-motion/Makefile            | 2 +-
 py-prf-gazebo-ros-pkgs/Makefile | 2 +-
 ros-aicp-mapping/depend.mk      | 2 +-
 ros-universal-robot/depend.mk   | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pal-gazebo-plugins/Makefile b/pal-gazebo-plugins/Makefile
index e1250012..743db96d 100644
--- a/pal-gazebo-plugins/Makefile
+++ b/pal-gazebo-plugins/Makefile
@@ -24,7 +24,7 @@ LICENSE=		2-clause-bsd
 
 # According to PAL instructions, we stay on the kinetic branch on 16.04
 include ../../mk/robotpkg.prefs.mk
-ifeq (16.04,${OS_VERSION})
+ifneq (,$(filter 16.04%,${OS_VERSION}))
   VERSION=		1.1.9
   DISTINFO_FILE=	${ROBOTPKG_DIR}/${CATEGORIES}/${NAME}/distinfo.${OS_VERSION}
 endif
diff --git a/pal-gazebo-plugins/depend.mk b/pal-gazebo-plugins/depend.mk
index 278f086e..6314b541 100644
--- a/pal-gazebo-plugins/depend.mk
+++ b/pal-gazebo-plugins/depend.mk
@@ -16,7 +16,7 @@ include ../../mk/robotpkg.prefs.mk  # for OS_VERSION
 PREFER.pal-gazebo-plugins?=	robotpkg
 
 DEPEND_USE+=			pal-gazebo-plugins
-ifneq (,$(filter 16.04,${OS_VERSION}))
+ifneq (,$(filter 16.04%,${OS_VERSION}))
   DEPEND_ABI.pal-gazebo-plugins?=	pal-gazebo-plugins>=1.1.4<2.0.0
 else
   DEPEND_ABI.pal-gazebo-plugins?=	pal-gazebo-plugins>=2.0.0
diff --git a/pal-hardware-gazebo/Makefile b/pal-hardware-gazebo/Makefile
index 00026040..a6aee2e8 100644
--- a/pal-hardware-gazebo/Makefile
+++ b/pal-hardware-gazebo/Makefile
@@ -30,7 +30,7 @@ CMAKE_PREFIX_PATH+=	${PREFIX}
 
 # According to PAL instructions, we stay on the kinetic branch on 16.04
 include ../../mk/robotpkg.prefs.mk
-ifeq (16.04,${OS_VERSION})
+ifneq (,$(filter 16.04%,${OS_VERSION}))
   VERSION=		0.1.3
   DISTINFO_FILE=	${ROBOTPKG_DIR}/${CATEGORIES}/${NAME}/distinfo.${OS_VERSION}
 endif
diff --git a/pal-hardware-gazebo/depend.mk b/pal-hardware-gazebo/depend.mk
index e0fea523..7597412c 100644
--- a/pal-hardware-gazebo/depend.mk
+++ b/pal-hardware-gazebo/depend.mk
@@ -16,7 +16,7 @@ include ../../mk/robotpkg.prefs.mk  # for OS_VERSION
 PREFER.pal-hardware-gazebo?=		robotpkg
 
 DEPEND_USE+=				pal-hardware-gazebo
-ifneq (,$(filter 16.04,${OS_VERSION}))
+ifneq (,$(filter 16.04%,${OS_VERSION}))
   DEPEND_ABI.pal-hardware-gazebo?=	pal-hardware-gazebo>=0.0.9<1.0.0
 else
   DEPEND_ABI.pal-hardware-gazebo?=	pal-hardware-gazebo>=1.0.0
diff --git a/play-motion/Makefile b/play-motion/Makefile
index 0a53850a..7136c77a 100644
--- a/play-motion/Makefile
+++ b/play-motion/Makefile
@@ -27,7 +27,7 @@ LICENSE=		2-clause-bsd
 ROS_METAPKG=		yes
 USE_BOOST_LIBS=		thread
 
-ifeq (,$(filter 16.04,${OS_VERSION}))
+ifeq (,$(filter 16.04%,${OS_VERSION}))
   include ../../wip/ros-moveit/depend.mk
 endif
 include ../../wip/py-prf-ros-control/depend.mk
diff --git a/py-prf-gazebo-ros-pkgs/Makefile b/py-prf-gazebo-ros-pkgs/Makefile
index fa1166b9..3dd84370 100644
--- a/py-prf-gazebo-ros-pkgs/Makefile
+++ b/py-prf-gazebo-ros-pkgs/Makefile
@@ -37,7 +37,7 @@ CMAKE_PREFIX_PATH+=	${PREFIX}
 
 # According to PAL instructions, we stay on the kinetic branch on 16.04
 include ../../mk/robotpkg.prefs.mk
-ifeq (16.04,${OS_VERSION})
+ifneq (,$(filter 16.04%,${OS_VERSION}))
   VERSION=		2.6.9
   DISTINFO_FILE=	${ROBOTPKG_DIR}/${CATEGORIES}/py-${PRFNAME}/distinfo.${OS_VERSION}
   PATCHDIR=		${ROBOTPKG_DIR}/${CATEGORIES}/py-${PRFNAME}/patches.${OS_VERSION}
diff --git a/ros-aicp-mapping/depend.mk b/ros-aicp-mapping/depend.mk
index 5489c1dc..7ded9029 100644
--- a/ros-aicp-mapping/depend.mk
+++ b/ros-aicp-mapping/depend.mk
@@ -13,7 +13,7 @@ ifeq (+,$(ROS_AICP_MAPPING_DEPEND_MK)) # --------------------------------------
 
 include ../../meta-pkgs/ros-base/depend.common
 include ../../mk/robotpkg.prefs.mk
-ifeq (18.04,${OS_VERSION})
+ifneq (,$(filter 18.04%,${OS_VERSION}))
   PREFER.ros-aicp-mapping?=		robotpkg
 else
   PREFER.ros-aicp-mapping?=		${PREFER.ros-base}
diff --git a/ros-universal-robot/depend.mk b/ros-universal-robot/depend.mk
index 4eac820e..8e728971 100644
--- a/ros-universal-robot/depend.mk
+++ b/ros-universal-robot/depend.mk
@@ -13,7 +13,7 @@ ifeq (+,$(ROS_UNIVERSAL_ROBOT_DEPEND_MK)) # ------------------------------------
 
 include ../../meta-pkgs/ros-base/depend.common
 include ../../mk/robotpkg.prefs.mk
-ifeq (18.04,${OS_VERSION})
+ifneq (,$(filter 18.04%,${OS_VERSION}))
   PREFER.ros-universal-robot?=		robotpkg
 else
   PREFER.ros-universal-robot?=		${PREFER.ros-base}
-- 
GitLab