buildout.cfg 4.49 KB
Newer Older
1 2
[buildout]
extends =
Łukasz Nowak's avatar
Łukasz Nowak committed
3 4
  ../gdbm/buildout.cfg
  ../patch/buildout.cfg
5
  ../xz-utils/buildout.cfg
6 7 8 9
parts =
  perl

[perl]
10
recipe = slapos.recipe.cmmi
11
shared = true
12 13 14
version = 5.28.1
url = http://www.cpan.org/src/5.0/perl-${:version}.tar.xz
md5sum = fbb590c305f2f88578f448581b8cf9c4
15
siteprefix =@@LOCATION@@/site_${:_buildout_section_name_}
16 17
patch-options = -p1
patches =
18
  ${:_profile_base_location_}/perl-keep-linker-flags-in-ldflags.patch#4e8e0c59d7176eafb0c7402dea17bef1
19
  ${:_profile_base_location_}/0001-Fix-missing-build-dependency-for-pods.patch#85aff81f3bea34fcd6ce9a611ee1cdb2
20 21 22
  ${:_profile_base_location_}/0002-prereq1.patch#c9bf3b521a39134d044eaa2c2312174f
  ${:_profile_base_location_}/0003-prereq2.patch#5268ff6dd06718cff34e6fb758045996
  ${:_profile_base_location_}/0004-disable-probing.patch#e68446ccd155c2282639e495a5be612b
23 24
configure-command =
  sh Configure -des \
25
    -Dprefix=@@LOCATION@@ \
26
    -Dsiteprefix=${:siteprefix} \
27
    -Dcflags=-I${gdbm:location}/include \
28
    -Dldflags="-L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib" \
29
    -Ui_db \
30 31
    -Dnoextensions=ODBM_File \
    -Dusethreads
32
environment =
33
  PATH=${patch:location}/bin:${xz-utils:location}/bin:%(PATH)s
34
post-make-hook = ${:_profile_base_location_}/perl-create-libs-symlink.py#943453b7d3ff8d49ed12d44a7f7076ee:post_make_hook
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62


[perl-CPAN-package]
# Macro to install a perl package from CPAN
# This macro will generate a perl wrapper as {:perl-bin} and rewrite all
# scripts installed by the package to use this perl. Executable scripts are
# installed in ${:perl-PATH}

# Inputs:
#  - module name, ie. Category/Category-Name
module = (required)
#  - module version
version = (required)
#  - checksum of module
md5sum = (required)

#  - colon (:) separated site perl of runtime dependencies, for example
#  ${perl-X-Y:site_perl}:${perl-X-Z:site_perl} these paths will be included in
#  the generated wrappers
inc =
#  - colon (:) separated site perl of install dependencies, for example
#  ${perl-X-Y:site_perl}:${perl-X-Z:site_perl} these paths will be used only
#  for installation. A typical use case is to add current directory (.) for
#  packages using a local version of Module::Install.
install-inc =
#  - extra arguments passed to perl Makefile.PL
extra-configure-args =

63 64 65
# - extra environ varialbles for configure and make
extra-env =

66 67 68 69 70 71 72 73 74 75
# Outputs:
#  - site_perl, to use in inc in dependent packages
site_perl=${:location}/lib/site_perl/${perl:version}:${:location}:${:inc}

#  - a $PATH that contain the perl wrapper
perl-PATH = ${:location}/bin/
#  - the path for a perl wrapper with @INC set to this CPAN package and all the
#  dependencies
perl-bin = ${:perl-PATH}/perl

76
perl-PERL5LIB = 
77 78 79

# Implementation
recipe = slapos.recipe.cmmi
80
shared = true
81 82
url = https://www.cpan.org/modules/by-module/${:module}-${:version}.tar.gz
configure-command =
83 84
  ${:extra-env}
  PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" \
85 86 87 88
  ${perl:location}/bin/perl \
  Makefile.PL \
  PREFIX=${:location} \
  ${:extra-configure-args}
89
location = @@LOCATION@@
90 91 92 93 94
# Install scripts in "perl-bin", but create wrappers in ./bin/
make-options =
  INSTALLSITESCRIPT=${:location}/perl-bin/

make-binary=
95
  ${:extra-env} PERL5LIB="${:inc}:${:install-inc}:${:perl-PERL5LIB}" make
96 97

# this post-make-hook is same for all users of the macro.
98
post-make-hook = ${:_profile_base_location_}/../../component/perl/perl-CPAN-package-create-wrapper.py#f28c45a0f473ae050ca3ebaed5c39a4e:post_make_hook
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

perl_location = ${perl:location}


[perl-wrapper]
# Macro to generate a perl wrapper with @INC set as ${:inc}
# The wrapper will be named as the section name, in buildout's bin directory.
#
# Note that this is usually not needed, because each part installed with
# perl-CPAN-package generates its own wrapper with the package and all
# dependencies available.
# This macro is useful to build a wrapper with several independent package
# available.
# It also takes care of executing perl with -I argument and not with $PERL5LIB
# environment variable, because the later is ignored when perl runs in tainted
# mode ( with -T argument )
#
# Inputs:
#  - inc : colon (:) separated site perl of modules to include in @INC
# Outputs:
#  - perl-bin : an executable perl
recipe = slapos.recipe.template:jinja2
template = inline: 
  #!/bin/sh
  {% set inc = "${:inc}".split(':') %} {# XXX we could remove duplicates from inc #}
  exec ${perl:location}/bin/perl \
  {% for item in inc -%}{% if item %}  -I "{{ item }}" \
  {% endif %}{% endfor %}  "$@"
mode = 0755
rendered = ${buildout:bin-directory}/${:_buildout_section_name_}
perl-bin = ${:rendered}