Skip to content

Commit dfeab3a

Browse files
committed
Add documentation on perl packages
1 parent 6253160 commit dfeab3a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Diff for: src/maintainer/knowledge_base.rst

+58
Original file line numberDiff line numberDiff line change
@@ -1518,3 +1518,61 @@ The tl;dr here is that conda sorts as follows:
15181518
So make sure that you **tag** your package in such a way that the package name
15191519
that conda-build spits out will sort the package uploaded with an ``rc`` label
15201520
higher than the package uploaded with the ``dev`` label.
1521+
1522+
Perl packages
1523+
=============
1524+
1525+
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.
1526+
1527+
The most commonly used build system for `perl packages <https://github.com/conda-forge/perl-file-which-feedstock>`__ is ``ExtUtils::MakeMaker``. For the archetypical 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>`__.
1528+
1529+
A few things to note in `perl-file-which recipe <https://github.com/conda-forge/perl-file-which-feedstock/blob/main/recipe/meta.yaml>`__ are:
1530+
1531+
* The ``name`` is composed of ``perl-`` **+** the lower-cased version of the CPAN name.
1532+
1533+
.. code-block::
1534+
1535+
package:
1536+
name: perl-{{ name|lower }}
1537+
version: {{ version }}
1538+
1539+
* The requirements section contain ``make`` for build directive, ``perl`` and ``perl-extutils-makemaker`` for host directive, and ``perl`` for run directive.
1540+
1541+
.. code-block::
1542+
1543+
requirements:
1544+
build:
1545+
- make
1546+
host:
1547+
- perl
1548+
- perl-extutils-makemaker
1549+
run:
1550+
- perl
1551+
1552+
* The test section contains ``imports`` which lists the CPAN module that can be used in perl.
1553+
1554+
.. code-block::
1555+
1556+
test:
1557+
imports:
1558+
- File::Which
1559+
1560+
1561+
The build section in the ``meta.yaml`` file should be something like this :
1562+
1563+
.. code-block::
1564+
1565+
build:
1566+
number: 0
1567+
noarch: generic
1568+
script:
1569+
- perl Makefile.PL INSTALLDIRS=vendor NO_PERLLOCAL=1 NO_PACKLIST=1
1570+
- make
1571+
- make test
1572+
- make install VERBINST=1
1573+
1574+
here the line with ``Makefile.PL`` is important as it guarantees installation into the vendor section, and it also helps in non-interference with the standard files by the ``NO_PERLLOCAL`` and ``NO_PACKLIST`` switches.
1575+
1576+
.. note::
1577+
1578+
``noarch: generic`` should be used only if the package is a pure perl package.

0 commit comments

Comments
 (0)