Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Apr 14, 2022
1 parent e428f9f commit b3cb498
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/generate-conda-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ jobs:
# see https://github.com/mamba-org/boa/issues/117
# We also manually delete the recipe directory to avoid that it is built again,
# specifically because we can't use --skip-existing as these packages are part of the robotology channel
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml robot-log-visualizer
rm -rf robot-log-visualizer
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp
rm -rf yarp
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml gazebo-yarp-plugins
Expand Down
4 changes: 0 additions & 4 deletions cmake/RobSupPurePythonYCMEPHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,4 @@ function(ROB_SUP_PURE_PYTHON_YCM_EP_HELPER _name)
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${Python3_EXECUTABLE} -m pip install --upgrade --no-deps --target=${YCM_EP_INSTALL_DIR}/${ROBSUB_PYTHON_INSTALL_DIR} -VV <SOURCE_DIR>)

# Set this variable so that RobotologySuperbuildGenerateCondaRecipes.cmake pass this information to the
# Python scripts that generates the conda recipes
set(${_name}_CONDA_BUILD_TYPE "pure_python")
endfunction()
34 changes: 30 additions & 4 deletions conda/cmake/RobotologySuperbuildGenerateCondaRecipes.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright (C) Fondazione Istituto Italiano di Tecnologia
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT

# Redefine find_or_build_package and ycm_ep_helper
# functions to extract metadata necessary for conda recipe
# generation from the RobotologySuperbuildLogic file
# Redefine find_or_build_package, ycm_ep_helper and rob_sup_pure_python_ycm_ep_helper
# as macros to extract metadata necessary for conda recipe
# generation from the RobotologySuperbuildLogic file.
# Note that these were originally functions, but they are re-defined as macros so that
# all the variables that they create are placed in the global scope, and in this script
# we can access variables such as ${_YH_${_cmake_pkg}_CMAKE_ARGS}
macro(ycm_ep_helper _name)
# Check arguments
set(_options )
Expand Down Expand Up @@ -44,6 +47,30 @@ macro(ycm_ep_helper _name)
set_property(GLOBAL PROPERTY YCM_PROJECTS ${_projects})
endmacro()

macro(ROB_SUP_PURE_PYTHON_YCM_EP_HELPER _name)
# Check arguments
set(_options)
set(_oneValueArgs COMPONENT
FOLDER
REPOSITORY
TAG)
set(_multiValueArgs DEPENDS)

cmake_parse_arguments(_PYH_${_name} "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" "${ARGN}")

ycm_ep_helper(${_name} TYPE GIT
STYLE GITHUB
REPOSITORY ${_PYH_${_name}_REPOSITORY}
DEPENDS ${_PYH_${_name}_DEPENDS}
TAG ${_PYH_${_name}_TAG}
COMPONENT ${_PYH_${_name}_COMPONENT}
FOLDER ${_PYH_${_name}_FOLDER})

# Set this variable so that RobotologySuperbuildGenerateCondaRecipes.cmake pass this information to the
# Python scripts that generates the conda recipes
set(${_name}_CONDA_BUILD_TYPE "pure_python")
endmacro()

macro(find_or_build_package _pkg)
get_property(_superbuild_pkgs GLOBAL PROPERTY YCM_PROJECTS)
if(NOT ${_pkg} IN_LIST _superbuild_pkgs)
Expand Down Expand Up @@ -223,7 +250,6 @@ macro(generate_conda_recipes)
set(python_generation_script_additional_options "")
endif()
execute_process(COMMAND python ${python_generation_script} -i ${metametadata_file} -o ${generated_conda_recipes_dir} ${python_generation_script_additional_options} RESULT_VARIABLE CONDA_GENERATION_SCRIPT_RETURN_VALUE)
message(STATUS "CONDA_GENERATION_SCRIPT_RETURN_VALUE: ${CONDA_GENERATION_SCRIPT_RETURN_VALUE}")
if(CONDA_GENERATION_SCRIPT_RETURN_VALUE STREQUAL "0")
message(STATUS "conda recipes correctly generated in ${generated_conda_recipes_dir}.")
message(STATUS "To build the generated conda recipes, navigate to the directory and run conda build . in it.")
Expand Down
2 changes: 1 addition & 1 deletion conda/pure_python_recipe_template/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source:

build:
number: {{ conda_build_number }}
script: {{ PYTHON }} -m pip install . --no-deps -vv
{% raw %} script: {{ PYTHON }} -m pip install . --no-deps -vv {% endraw %}

requirements:
build:
Expand Down

0 comments on commit b3cb498

Please sign in to comment.