Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on Perl packages. #1790

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/maintainer/knowledge_base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1518,3 +1518,61 @@ The tl;dr here is that conda sorts as follows:
So make sure that you **tag** your package in such a way that the package name
that conda-build spits out will sort the package uploaded with an ``rc`` label
higher than the package uploaded with the ``dev`` label.

Perl packages
=============

Perl has three standard install locations: **core**, **vendor**, and **site**. Here, **core** is used only for the perl itself, **vendor** is used for installing any other conda-forge packages, and **site** is used for the user to install things locally from sources other than conda-forge.

The most commonly used build system for `perl packages <https://github.com/conda-forge/perl-file-which-feedstock>`__ is ``ExtUtils::MakeMaker``. For typical packaging of packages of this form, you can have a look at `perl-file-which recipe <https://github.com/conda-forge/perl-file-which-feedstock/blob/main/recipe/meta.yaml>`__.
ssurbhi560 marked this conversation as resolved.
Show resolved Hide resolved
ssurbhi560 marked this conversation as resolved.
Show resolved Hide resolved

A few things to note in the `perl-file-which recipe <https://github.com/conda-forge/perl-file-which-feedstock/blob/main/recipe/meta.yaml>`__ are:

* The ``name`` is composed of ``perl-`` **+** the lowercase version of the CPAN name.

.. code-block::

package:
name: perl-{{ name|lower }}
version: {{ version }}

* The requirements section contains ``make`` for build, ``perl`` and ``perl-extutils-makemaker`` for host, and ``perl`` for run, in addition to any other packages that the particular Perl module being bullt may require.

.. code-block::

requirements:
build:
- make
host:
- perl
- perl-extutils-makemaker
run:
- perl

* The test section contains ``imports``, which lists the CPAN module that can be used in perl.
ssurbhi560 marked this conversation as resolved.
Show resolved Hide resolved

.. code-block::

test:
imports:
- File::Which


The build section in the ``meta.yaml`` file should be something like this:

.. code-block::

build:
number: 0
noarch: generic
script:
- perl Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1
- make
- make test
- make install VERBINST=1

Notable here is ``INSTALLDIRS=vendor``, which selects the appropriate install location for a conda-forge package, and the ``NO_PERLLOCAL`` and ``NO_PACKLIST`` switches, which suppress various CPAN tracking files that are unnecessary when the module is being externally packaged via conda.

.. note::

``noarch: generic`` should be used only if the package is a pure Perl package.