summaryrefslogtreecommitdiff
path: root/perl/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'perl/build.sh')
-rw-r--r--perl/build.sh40
1 files changed, 29 insertions, 11 deletions
diff --git a/perl/build.sh b/perl/build.sh
index 3726861..adc7046 100644
--- a/perl/build.sh
+++ b/perl/build.sh
@@ -8,17 +8,22 @@ sources=(
)
build_depends=(
"bzip2"
+ "gdbm"
+ "zlib"
)
depends=(
"bzip2"
- "gdbm"
"readline"
+ "zlib"
)
-
+lib_type=so
function prepare() {
tar xf ${name}-${version}.tar.gz
cd ${name}-${version}
+ if [[ $(uname -s) == Darwin ]]; then
+ lib_type=dylib
+ fi
}
function build() {
@@ -26,8 +31,8 @@ function build() {
-Dusethreads \
-Duseshrplib \
-Dusesitecustomize \
- -Ui_ndbm \
- -Di_gdbm \
+ $([[ $(uname -s) == Linux ]] && echo -Ui_ndbm) \
+ $([[ $(uname -s) == Linux ]] && echo -Di_gdbm) \
-Doptimize="${CFLAGS}" \
-Dprefix=${_prefix} \
-Dvendorprefix=${_prefix} \
@@ -44,17 +49,30 @@ function build() {
-Dinc_version_list=none \
-Dman1ext=1perl \
-Dman3ext=3perl ${arch_opts} \
- -Dlddlflags="-shared ${LDFLAGS}" -Dldflags="${LDFLAGS}"
+ -Dldflags="${LDFLAGS}"
+
+ #-Dccflags="${CFLAGS}" \
+ #-Dlddlflags="-shared ${LDFLAGS}" \
BUILD_BZIP2=0
BZIP2_LIB="${_runtime}/lib"
- export BUILD_BZIP2 BZIP2_LIB
+ BZIP2_INCLUDE="${_runtime}/include"
+ export BUILD_BZIP2 BZIP2_LIB BZIP2_INCLUDE
+
+ BUILD_ZLIB=0
+ ZLIB_LIB="${_runtime}/lib"
+ ZLIB_INCLUDE="${_runtime}/include"
+ export BUILD_ZLIB ZLIB_LIB ZLIB_INCLUDE
make -j${_maxjobs}
}
function package() {
make install DESTDIR="${_pkgdir}"
+
+ # Fix permissions. On Darwin, several files are installed as read-only.
+ find "${_pkgdir}" -type f | xargs chmod u+w
+
cat << EOF > "${_pkgdir}${_prefix}/share/perl5/site_perl/sitecustomize.pl"
@INC = (
"${_prefix}/lib/perl5/${_baseversion}/site_perl",
@@ -67,16 +85,16 @@ function package() {
);
EOF
sed -e '/^man1ext=/ s/1perl/1p/' -e '/^man3ext=/ s/3perl/3pm/' \
- -i "${_pkgdir}${_prefix}/lib/perl5/${_baseversion}/core_perl/Config_heavy.pl"
+ -i'.orig' "${_pkgdir}${_prefix}/lib/perl5/${_baseversion}/core_perl/Config_heavy.pl"
sed -e '/(makepl_arg =>/ s/""/"INSTALLDIRS=site"/' \
-e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
- -i "${_pkgdir}${_prefix}/share/perl5/core_perl/CPAN/FirstTime.pm"
+ -i'.orig' "${_pkgdir}${_prefix}/share/perl5/core_perl/CPAN/FirstTime.pm"
- p5lib="$(find ${_pkgdir}/${_prefix}/lib -type f -name 'libperl.so')"
- mv "${p5lib}" "${_pkgdir}/${_prefix}/lib"
+ p5lib=$(find ${_pkgdir}${_prefix}/lib -type f -name "libperl.${lib_type}")
+ mv "${p5lib}" "${_pkgdir}${_prefix}/lib"
pushd "$(dirname ${p5lib})"
- ln -s ../../../../libperl.so
+ ln -s ../../../../libperl.${lib_type}
popd
rm -f "${_pkgdir}${_prefix}/bin/perl${version}"