From 8f96143604b45eb5aadecdc97c6543f079be8826 Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Mon, 29 Jul 2019 14:52:05 +0200
Subject: [PATCH 1/6] Updated cmake/conda for tango package

---
 CMakeLists.txt        | 42 ++++++++++++------------------------------
 conda/tango/bld.bat   |  8 +++++++-
 conda/tango/build.sh  |  5 ++++-
 conda/tango/meta.yaml |  3 +++
 tango/CMakeLists.txt  | 38 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 64 insertions(+), 32 deletions(-)
 create mode 100644 tango/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19513e3..046e9f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 ###########################################################################
 # This file is part of LImA, a Library for Image Acquisition
 #
-#  Copyright (C) : 2009-2017
+#  Copyright (C) : 2009-2019
 #  European Synchrotron Radiation Facility
 #  CS40220 38043 Grenoble Cedex 9
 #  FRANCE
@@ -26,8 +26,6 @@ cmake_minimum_required(VERSION 3.1)
 
 project(eiger)
 
-set(NAME "eiger")
-
 # Include additional modules that are used inconditionnaly
 include(GNUInstallDirs)
 include(GenerateExportHeader)
@@ -52,46 +50,28 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
 endif()
 
 if (CAMERA_MASTER_PROJECT)
-  find_package(Lima REQUIRED)
+  find_package(Lima REQUIRED COMPONENTS devel tools)
 endif()
 
 # CMake additional macros
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
 
+include(LimaTools)
+
 # Set version
 include(project_version)
 
 # Enable python binding code compilation using sip generator
 if (CAMERA_MASTER_PROJECT)
   option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF)
-endif()
+  option(LIMA_ENABLE_PYTANGO_SERVER "install python tango server?" OFF)
 
-
-if (LIMA_ENABLE_PYTHON)
-  # Find python interpreter and libs
-  find_package(PythonInterp)
-  find_package(PythonLibs)
-  if(${PYTHONINTERP_FOUND})
-    # python site-packages folder
-    execute_process(
-      COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())"
-      OUTPUT_VARIABLE _PYTHON_SITE_PACKAGES_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+  if (LIMA_ENABLE_PYTHON)
+    limatools_find_python_and_sip()
   endif()
-
-  set(PYTHON_SITE_PACKAGES_DIR ${_PYTHON_SITE_PACKAGES_DIR} CACHE PATH "where should python modules be installed?")
-
-  find_package(SIP REQUIRED)
-  include(SIPMacros)
-  if(WIN32)
-    set(SIP_TAGS WIN32_PLATFORM)
-  elseif(UNIX)
-    set(SIP_TAGS POSIX_PLATFORM)
-  endif(WIN32)
-  set(SIP_EXTRA_OPTIONS -e -g)
-
-  find_package(NumPy REQUIRED)
 endif()
 
+
 find_package(CURL REQUIRED)
 find_package(LZ4 REQUIRED)
 find_package(ZMQ REQUIRED)
@@ -149,7 +129,6 @@ endif()
 
 # Binding code for python
 if(LIMA_ENABLE_PYTHON)
-  include(LimaTools)
   limatools_run_sip_for_camera(eiger)
 endif()
 
@@ -191,7 +170,10 @@ if(LIMA_ENABLE_PYTHON)
   install(
     DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/
     DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Eiger"
-  )
+    )
+  if (LIMA_ENABLE_PYTANGO_SERVER)
+    add_subdirectory(tango)
+  endif()
 endif()
 
 ## Tests
diff --git a/conda/tango/bld.bat b/conda/tango/bld.bat
index adc93a7..856a28f 100644
--- a/conda/tango/bld.bat
+++ b/conda/tango/bld.bat
@@ -1 +1,7 @@
-xcopy tango\*.* %SP_DIR%\Lima\Server\camera\
+cd tango
+
+cmake -Bbuild -H. -G"%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
+IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
+
+cmake --build build --config Release --target install
+IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
diff --git a/conda/tango/build.sh b/conda/tango/build.sh
index 662827a..d02fde0 100644
--- a/conda/tango/build.sh
+++ b/conda/tango/build.sh
@@ -1 +1,4 @@
-mkdir -p $SP_DIR/Lima/Server/camera && cp tango/*.* $SP_DIR/Lima/Server/camera
+#!/bin/bash
+cd tango/
+cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
+cmake --build build --target install
diff --git a/conda/tango/meta.yaml b/conda/tango/meta.yaml
index 3867de8..0a207c7 100644
--- a/conda/tango/meta.yaml
+++ b/conda/tango/meta.yaml
@@ -12,6 +12,9 @@ build:
   noarch: python
 
 requirements:
+  build:
+    - cmake
+    - git
   run:
     - lima-tango-server
     - lima-camera-eiger
diff --git a/tango/CMakeLists.txt b/tango/CMakeLists.txt
new file mode 100644
index 0000000..8ff9601
--- /dev/null
+++ b/tango/CMakeLists.txt
@@ -0,0 +1,38 @@
+###########################################################################
+# This file is part of LImA, a Library for Image Acquisition
+#
+#  Copyright (C) : 2009-2019
+#  European Synchrotron Radiation Facility
+#  CS40220 38043 Grenoble Cedex 9
+#  FRANCE
+#
+#  Contact: lima@esrf.fr
+#
+#  This is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This software is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, see <http://www.gnu.org/licenses/>.
+############################################################################
+
+cmake_minimum_required(VERSION 3.1)
+
+project(eiger_tango NONE)
+
+# use lima toolbox function,
+# if cmake is ran out of camera mother project, check python environment  
+if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+  find_package(Lima REQUIRED COMPONENTS tools)
+  set(CMAKE_MODULE_PATH
+    ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
+  include(LimaTools)
+endif()
+
+limatools_install_camera_tango("Eiger.py")
-- 
GitLab


From 784badfdd52134dbdb5e1e1502d6a199f89388eb Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Tue, 30 Jul 2019 09:35:43 +0200
Subject: [PATCH 2/6] conda build need lima-core of course

---
 conda/tango/meta.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/conda/tango/meta.yaml b/conda/tango/meta.yaml
index 0a207c7..4d1babf 100644
--- a/conda/tango/meta.yaml
+++ b/conda/tango/meta.yaml
@@ -15,6 +15,7 @@ requirements:
   build:
     - cmake
     - git
+    - lima-core
   run:
     - lima-tango-server
     - lima-camera-eiger
-- 
GitLab


From ac1fc1fc5e54464a79f27e8f77757d2513c69763 Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Wed, 31 Jul 2019 08:32:20 +0200
Subject: [PATCH 3/6] fixed conda recipe meta files when no git tag

---
 conda/camera/meta.yaml | 7 ++++++-
 conda/tango/meta.yaml  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/conda/camera/meta.yaml b/conda/camera/meta.yaml
index 91db5f7..924d943 100644
--- a/conda/camera/meta.yaml
+++ b/conda/camera/meta.yaml
@@ -1,4 +1,9 @@
-{% set version = GIT_DESCRIBE_TAG[1:] %}
+# Strip the 'v' from the version tag
+{% if GIT_DESCRIBE_TAG is defined %}
+{%   set version = GIT_DESCRIBE_TAG[1:] %}
+{% else %}
+{%   set version = "0.0.0" %}
+{% endif %}
 
 package:
   name: lima-camera-eiger
diff --git a/conda/tango/meta.yaml b/conda/tango/meta.yaml
index 4d1babf..aa7191e 100644
--- a/conda/tango/meta.yaml
+++ b/conda/tango/meta.yaml
@@ -1,4 +1,9 @@
-{% set version = GIT_DESCRIBE_TAG[1:] %}
+# Strip the 'v' from the version tag
+{% if GIT_DESCRIBE_TAG is defined %}
+{%   set version = GIT_DESCRIBE_TAG[1:] %}
+{% else %}
+{%   set version = "0.0.0" %}
+{% endif %}
 
 package:
   name: lima-camera-eiger-tango
-- 
GitLab


From e8ef3ab705050ad19a666558490bd69688c8965e Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Wed, 31 Jul 2019 09:22:25 +0200
Subject: [PATCH 4/6] fixed master branch name

---
 .gitlab-ci.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index df5d306..30a97b2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,7 +43,7 @@ deploy-devel:
   only:
     - branches
   except:
-    - stable
+    - master
   when: manual
 
 deploy-stable:
@@ -62,4 +62,3 @@ deploy-stable:
     - linux
   only:
     - tags
-    - stable
-- 
GitLab


From 3b15ccb4b7603b35a2d24d00090e180833dc13a6 Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Wed, 31 Jul 2019 15:49:48 +0200
Subject: [PATCH 5/6] fixed conda tango recipe for windows CI running

---
 conda/tango/bld.bat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conda/tango/bld.bat b/conda/tango/bld.bat
index 856a28f..74bfc20 100644
--- a/conda/tango/bld.bat
+++ b/conda/tango/bld.bat
@@ -1,6 +1,6 @@
 cd tango
 
-cmake -Bbuild -H. -G"%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
+cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
 IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
 
 cmake --build build --config Release --target install
-- 
GitLab


From cec5828e30691337478773287c858fcb11627ba5 Mon Sep 17 00:00:00 2001
From: Laurent Claustre <claustre@lid00limace.esrf.fr>
Date: Fri, 16 Aug 2019 13:04:36 +0200
Subject: [PATCH 6/6] Update conda channel to tango-controls for pytango
 package

---
 .gitignore     | 2 ++
 .gitlab-ci.yml | 2 +-
 README.md      | 5 +++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index c4711d4..7db0c3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,3 +29,5 @@
 
 target
 *~
+build/
+tango/build/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 30a97b2..e8a1c81 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,7 +22,7 @@ build-noarch:
   <<: *build-conda
   stage: build-noarch
   script:
-    - conda build ./conda/tango --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
+    - conda build ./conda/tango --prefix-length=80 --output-folder=dist/ -c tango-controls --channel=http://bcu-ci.esrf.fr/stable
   dependencies:
     - build-linux
 
diff --git a/README.md b/README.md
index 0d4fc75..a5b8c3f 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ conda install -c esrf-bcu lima-camera-eiger
 
 ### Camera tango device server
 
-conda install -c esrf-bcu lima-camera-eiger-tango
+conda install -c tango-controls -c esrf-bcu lima-camera-andor3-tango
 
 # LImA
 
@@ -26,5 +26,6 @@ Lima is a C++ library which can be used with many different cameras. The library
 
 ## Documentation
 
-The documentation is available [here](https://lima1.readthedocs.io/)
+The documentation is available [here](https://lima.blissgarden.org)
+
 
-- 
GitLab