merv
merv

Reputation: 77098

How to copy license from host package

When compiling software that makes use of a header-only library, licensing can require a copy of the library's license to be distributed with the compiled software. Moreover, Conda Forge is explicit (see PR template) that packages must include the original licenses of statically-linked dependencies, which is ipso facto the case for header-only libraries. However, I am unable to find documentation on how to resolve the license file for host-level packages.

How does one specify in a meta.yaml recipe to copy the license(s) from a particular package?

Minimal Example

Here's a minimal example using the tsl_robin_map header-only library. I know that the tsl_robin_map package tarball has the license in info/licenses/LICENSE. However, I don't know how to specify that path in the recipe.

meta.yaml

package:
  name: hello-robin
  version: 0.1

source:
  path: .

build:
  number: 0

requirements:
  build:
    - {{ compiler('cxx') }}
  host:
    - tsl_robin_map

test:
  commands:
    - hello-robin

# about:
#   license_file:   
#     - <path_to_tsl_robin_map>/info/licenses/LICENSE  # <- how should this be specified?

hello.cpp

#include <iostream>
#include <tsl/robin_map.h>

int main()
{
  std::cout << "Hello, Robin!";
}

build.sh

#!/bin/bash
${CXX} ${CPPFLAGS} -o hello-robin hello.cpp
mkdir -p ${PREFIX}/bin
mv hello-robin ${PREFIX}/bin/hello-robin

Upvotes: 5

Views: 160

Answers (1)

isuruf
isuruf

Reputation: 2753

There's no such way in conda-build yet. It's a good feature to have. Can you open an issue in conda/conda-build?

Upvotes: 3

Related Questions