ukaea/UDA

Building conda pacakge and uploading it to conda-forge

Opened this issue · 1 comments

Hello!

Currently, I am trying to create conda packages for IMAS-related libraries.
To retrieve dependencies through the conda-forge repository, I propose providing UDA-related conda packages.

I would like to share configure files I created, which are used by rattler-build conda package build tool:


recipe.yaml
context:
  name: UDA
  version: "2.8.0"
  username: ukaea

recipe:
  name: ${{ name|lower }}
  version: ${{ version }}

source:
  url: https://github.com//${{ username }}/${{ name }}/archive/refs/tags/${{ version }}.tar.gz
  sha256: decfe8af6a6cdf1913695f8ed8ae6eadbe86aa6eaf995af0d665bb7e39bf3650

outputs:
  - package:
      name: ${{ name|lower }}-client-cpp
      version: ${{ version }}
    build:
      number: 0
      script:
        - if: unix
          then: build-client-cpp.sh
        - if: win
          then: build-client-cpp.bat

    requirements:
      build:
        - ${{ compiler("cxx") }}
        - git
        - cmake
        - ninja
        - pkg-config
      host:
        - libxml2
        - libboost-devel
        - fmt
        - openssl
        - capnproto
      run_exports:
        - uda-client-cpp

about:
  homepage: https://ukaea.github.io/UDA/
  summary: Universal Data Access library to provide data over the network in a unified data object.
  description: |
    The UDA can be either run as a client-server API, running as thin client with all functionality
    being handled on a remote server, or as fat-client API where both the client access and plugin
    functionality is run on the local machine.
  license: Apache-2.0
  license_file: LICENCE.txt
  documentation: https://ukaea.github.io/UDA/
  repository: https://github.com/ukaea/UDA

extra:
  feedstock-name: uda-feedstock
  recipe-maintainers:
    - munechika-koyo
build-client-cpp.sh
#!/bin/bash

# CMake extra configuration:
extra_cmake_args=(
    -GNinja
    -DBUILD_SHARED_LIBS=ON
    # SSL/RTL X509 authentication
    -DSSLAUTHENTICATION=ON
    # Build client
    -DCLIENT_ONLY=ON
    -DSERVER_ONLY=OFF
    # Enable Cap’n Proto serialisation
    -DENABLE_CAPNP=ON
    # Wrappers (Only C++)
    -DNO_WRAPPERS=OFF
    -DNO_CXX_WRAPPER=OFF
    -DNO_IDL_WRAPPER=ON
    -DNO_PYTHON_WRAPPER=ON
    -DNO_JAVA_WRAPPER=ON
    -DFAT_IDL=OFF
    -DNO_CLI=OFF
)

mkdir build && cd build

cmake ${CMAKE_ARGS} "${extra_cmake_args[@]}" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_PREFIX_PATH=$PREFIX \
    -DCMAKE_INSTALL_PREFIX=$PREFIX \
    $SRC_DIR

# Build and install
ninja
ninja install
variants.yaml
c_stdlib:
  - if: linux
    then: sysroot
  - if: osx
    then: macosx_deployment_target

c_stdlib_version:
  - if: linux
    then: 2.17
  - if: osx and x86_64
    then: 10.13
  - if: osx and arm64
    then: 11.0

The recipe is designed to reproduce several output packages like

  • Client only / C++ wrapper (that I show here)
  • Client only / Python wrapper
  • Client only / JAVA wrapper
  • Client only / full wrapper
  • Fat client only / ... wrapper
  • Server only
  • etc.

How to build conda package by rattler-build

If you install rattler-build, please run the following commands:

rattler-build build --recipe-dir path/to/directory/contains/recipe.yaml_and_build-client-cpp.sh_and_variants.yaml --experimental

I would appreciate it if you would consider this proposal and share what outputs we should offer.

Hi. Please create a PR with these conda packages and we will have a look at merging them into the code.

It would be good if you could also create a GitHub action to run the packages so we can test them.

Note that we cannot commit to support these packages going forward, though we can keep the version numbers up to date on releases.