From 8a809e0996febed9c8e27ca34f45e65da8949793 Mon Sep 17 00:00:00 2001
From: Anthony Mallet <anthony.mallet@laas.fr>
Date: Wed, 7 Mar 2018 14:09:23 +0100
Subject: [PATCH] [wip/py-sot-application] Cleanup and fix a few configure
 issues

* Rename to py-sot-application, as this is a python package. Properly
  preprend PKGTAG.python everywhere. Add conflicts on the previous package
  name.
* Add missing dependency on py-sphinx
* Pass SPHINX_BUILD program name to cmake
* Point MASTER_SITES to the official github distribution site
* Change CATEGORY to scripts
* Add a HOMEPAGE
* Fully define SYSTEM_SEARCH, looking for headers, python files and .pc

Bump PKGREVISION
---
 Makefile                                      |  2 +-
 {sot-application => py-sot-application}/DESCR |  3 +-
 py-sot-application/Makefile                   | 39 +++++++++++++++++++
 {sot-application => py-sot-application}/PLIST |  0
 py-sot-application/depend.mk                  | 30 ++++++++++++++
 .../distinfo                                  |  1 +
 .../patches/patch-aa                          |  0
 py-sot-application/patches/patch-ab           | 13 +++++++
 sot-application/Makefile                      | 25 ------------
 sot-application/depend.mk                     | 26 -------------
 10 files changed, 86 insertions(+), 53 deletions(-)
 rename {sot-application => py-sot-application}/DESCR (91%)
 create mode 100644 py-sot-application/Makefile
 rename {sot-application => py-sot-application}/PLIST (100%)
 create mode 100644 py-sot-application/depend.mk
 rename {sot-application => py-sot-application}/distinfo (82%)
 rename {sot-application => py-sot-application}/patches/patch-aa (100%)
 create mode 100644 py-sot-application/patches/patch-ab
 delete mode 100644 sot-application/Makefile
 delete mode 100644 sot-application/depend.mk

diff --git a/Makefile b/Makefile
index b15dd4bc..89532e9d 100644
--- a/Makefile
+++ b/Makefile
@@ -81,13 +81,13 @@ SUBDIR+=	py-jsbsim
 SUBDIR+=	py-laaswm
 SUBDIR+=	py-mavlink
 SUBDIR+=	py-morse
+SUBDIR+=	py-sot-application
 SUBDIR+=	py-sot-tools-v3
 SUBDIR+= 	qpOASES
 SUBDIR+=	roralink
 SUBDIR+=	robotModelParser-libs
 SUBDIR+=	rqt-dynamic-graph
 SUBDIR+=	simple-humanoid-description
-SUBDIR+=	sot-application
 SUBDIR+=        sot-application-v3
 SUBDIR+=	sot-core-v3
 SUBDIR+=	sot-dynamic-pinocchio-v3
diff --git a/sot-application/DESCR b/py-sot-application/DESCR
similarity index 91%
rename from sot-application/DESCR
rename to py-sot-application/DESCR
index 71303d79..33b98ffd 100644
--- a/sot-application/DESCR
+++ b/py-sot-application/DESCR
@@ -1,6 +1,7 @@
 This package provides python initializations scripts for the Stack of Tasks.
 
-These scripts are aimed at initializing control graphs dependending on the application:
+These scripts are aimed at initializing control graphs dependending on the
+application:
 
     type of control variable (velocity, acceleration, torque)
     type of solver (equality only inequality and equality).
diff --git a/py-sot-application/Makefile b/py-sot-application/Makefile
new file mode 100644
index 00000000..b170d417
--- /dev/null
+++ b/py-sot-application/Makefile
@@ -0,0 +1,39 @@
+# robotpkg Makefile for:	scripts/py-sot-application
+# Created:			Aurélie Clodic on Wed, 11 Jun 2014
+#
+
+PKGREVISION=		2
+VERSION=		1.0.0
+PKGNAME=		${PKGTAG.python-}sot-application-${VERSION}
+DISTNAME=		sot-application-${VERSION}
+GH_REPO=		stack-of-tasks/sot-application
+MASTER_SITES=\
+  ${MASTER_SITE_GITHUB:=${GH_REPO}/releases/download/${VERSION}/}
+MASTER_REPOSITORY=	${MASTER_REPOSITORY_GITHUB}${GH_REPO}
+
+CATEGORIES=		scripts
+COMMENT=		Application dependent scripts for the Stack of Tasks
+HOMEPAGE=		https://github.com/stack-of-tasks/sot-application
+LICENSE=		gnu-lgpl-v3
+MAINTAINER=		hpp@laas.fr
+
+# this does not support multiple parallel python version
+CONFLICTS+=		py[0-9][0-9]-${PKGBASE}-[0-9]*
+# old package name
+CONFLICTS+=		sot-application-[0-9]*
+
+DYNAMIC_PLIST_DIRS+=	share/doc/sot-application
+
+CMAKE_ARGS+=		-DSPHINX_BUILD=${SPHINX_BUILD}
+
+include ../../motion/sot-dynamic/depend.mk
+include ../../pkgtools/pkg-config/depend.mk
+include ../../mk/sysdep/cmake.mk
+include ../../mk/sysdep/doxygen.mk
+include ../../mk/sysdep/graphviz.mk
+include ../../mk/sysdep/pdflatex.mk
+include ../../mk/sysdep/py-sphinx.mk
+include ../../mk/sysdep/python.mk
+include ../../mk/language/c.mk
+include ../../mk/language/c++.mk
+include ../../mk/robotpkg.mk
diff --git a/sot-application/PLIST b/py-sot-application/PLIST
similarity index 100%
rename from sot-application/PLIST
rename to py-sot-application/PLIST
diff --git a/py-sot-application/depend.mk b/py-sot-application/depend.mk
new file mode 100644
index 00000000..cbf60f4e
--- /dev/null
+++ b/py-sot-application/depend.mk
@@ -0,0 +1,30 @@
+# robotpkg depend.mk for:	scripts/py-sot-application
+# Created:			Aurélie Clodic on Wed, 10 Jun 2014
+#
+
+DEPEND_DEPTH:=			${DEPEND_DEPTH}+
+PY_SOT_APPLICATION_DEPEND_MK:=	${PY_SOT_APPLICATION_DEPEND_MK}+
+
+ifeq (+,${DEPEND_DEPTH})
+DEPEND_PKG+=			py-sot-application
+endif
+
+ifeq (+,${PY_SOT_APPLICATION_DEPEND_MK}) # ---------------------------------
+
+PREFER.py-sot-application?=	robotpkg
+
+SYSTEM_SEARCH.py-sot-application=\
+  'include/sot/application/config.h:/PACKAGE_VERSION/s/[^0-9.]//gp'	\
+  '${PYTHON_SYSLIBSEARCH}/dynamic_graph/sot/application/__init__.py'	\
+  'lib/pkgconfig/sot-application.pc:/Version/s/[^0-9.]//gp'
+
+DEPEND_USE+=			py-sot-application
+
+DEPEND_ABI.py-sot-application?=	${PKGTAG.python-}sot-application>=1.0.0
+DEPEND_DIR.py-sot-application?=	../../wip/py-sot-application
+
+include ../../mk/sysdep/python.mk
+
+endif # PY_SOT_APPLICATION_DEPEND_MK ---------------------------------------
+
+DEPEND_DEPTH:=			${DEPEND_DEPTH:+=}
diff --git a/sot-application/distinfo b/py-sot-application/distinfo
similarity index 82%
rename from sot-application/distinfo
rename to py-sot-application/distinfo
index 6a0ec8fa..099bed84 100644
--- a/sot-application/distinfo
+++ b/py-sot-application/distinfo
@@ -2,3 +2,4 @@ SHA1 (sot-application-1.0.0.tar.gz) = 2437ba960fad682b838e0f91602e5a2c616050e5
 RMD160 (sot-application-1.0.0.tar.gz) = 1240285688ff10f97ebc9df5568ac4a1832cfaf9
 Size (sot-application-1.0.0.tar.gz) = 85203 bytes
 SHA1 (patch-aa) = af2e3fd8e1b2c47f16a0affde3f3e006a14e3052
+SHA1 (patch-ab) = 865deb152aead18d82b8a9e4cc10ec42ab46090a
diff --git a/sot-application/patches/patch-aa b/py-sot-application/patches/patch-aa
similarity index 100%
rename from sot-application/patches/patch-aa
rename to py-sot-application/patches/patch-aa
diff --git a/py-sot-application/patches/patch-ab b/py-sot-application/patches/patch-ab
new file mode 100644
index 00000000..8b01ea91
--- /dev/null
+++ b/py-sot-application/patches/patch-ab
@@ -0,0 +1,13 @@
+Use cmake's idea of the "make" program, so that it can be tuned by robotpkg
+
+--- cmake/sphinx.cmake~	2013-12-12 10:41:29.000000000 +0100
++++ cmake/sphinx.cmake	2018-03-07 13:33:04.785563519 +0100
+@@ -27,7 +27,7 @@
+   ENDIF(NOT SPHINX_BUILD)
+ 
+   IF(UNIX)
+-    SET(MAKE make)
++    SET(MAKE ${CMAKE_MAKE_PROGRAM})
+   ELSEIF(WIN32)
+     SET(MAKE nmake)
+   ELSE(UNIX)
diff --git a/sot-application/Makefile b/sot-application/Makefile
deleted file mode 100644
index 030f94b3..00000000
--- a/sot-application/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# robotpkg Makefile for:	robots/sot-application
-# Created:			Aurélie Clodic on Wed, 11 Jun 2014
-#
-DISTNAME=		sot-application-1.0.0
-MASTER_SITES=		${MASTER_SITE_OPENROBOTS:=sot-application/}
-MASTER_REPOSITORY=	${MASTER_REPOSITORY_GITHUB}stack-of-tasks/sot-application
-PKGREVISION=           1
-
-CATEGORIES=		robots
-COMMENT=		This packages provides a generic Stack Of Tasks library for the humanoid robot Romeo.
-LICENSE=		gnu-lgpl-v3
-MAINTAINER=		hpp@laas.fr
-
-DYNAMIC_PLIST_DIRS+=	share/doc/sot-application
-
-include ../../motion/sot-dynamic/depend.mk
-include ../../pkgtools/pkg-config/depend.mk
-include ../../mk/sysdep/cmake.mk
-include ../../mk/sysdep/doxygen.mk
-include ../../mk/sysdep/graphviz.mk
-include ../../mk/sysdep/pdflatex.mk
-include ../../mk/sysdep/python.mk
-include ../../mk/language/c.mk
-include ../../mk/language/c++.mk
-include ../../mk/robotpkg.mk
diff --git a/sot-application/depend.mk b/sot-application/depend.mk
deleted file mode 100644
index 2ba201b6..00000000
--- a/sot-application/depend.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# robotpkg depend.mk for:	robots/sot-application
-# Created:			Aurélie Clodic on Wed, 10 Jun 2014
-#
-
-DEPEND_DEPTH:=		${DEPEND_DEPTH}+
-SOT_APPLICATION_DEPEND_MK:=	${SOT_APPLICATION_DEPEND_MK}+
-
-ifeq (+,$(DEPEND_DEPTH))
-DEPEND_PKG+=		sot-application
-endif
-
-ifeq (+,$(SOT_APPLICATION_DEPEND_MK)) # -------------------------------------------
-
-PREFER.sot-application?=	robotpkg
-
-SYSTEM_SEARCH.sot-application=\
-	'lib/pkgconfig/sot-application.pc:/Version/s/[^0-9.]//gp'
-
-DEPEND_USE+=		sot-application
-
-DEPEND_ABI.sot-application?=	sot-application>=1.0.0
-DEPEND_DIR.sot-application?=	../../wip/sot-application
-
-endif # SOT_ROMEO_DEPEND_MK -------------------------------------------------
-
-DEPEND_DEPTH:=		${DEPEND_DEPTH:+=}
-- 
GitLab