From 825e3fc6b74780753dde80f3f23072bb968c840c Mon Sep 17 00:00:00 2001 From: svenper Date: Mon, 26 Aug 2019 00:44:43 +0200 Subject: [PATCH] New package: perl-Text-BibTeX-0.88 --- .../patches/FORTIFY_SOURCE.patch | 14 ++++++++ srcpkgs/perl-Text-BibTeX/patches/lib64.patch | 20 +++++++++++ srcpkgs/perl-Text-BibTeX/template | 36 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 srcpkgs/perl-Text-BibTeX/patches/FORTIFY_SOURCE.patch create mode 100644 srcpkgs/perl-Text-BibTeX/patches/lib64.patch create mode 100644 srcpkgs/perl-Text-BibTeX/template diff --git a/srcpkgs/perl-Text-BibTeX/patches/FORTIFY_SOURCE.patch b/srcpkgs/perl-Text-BibTeX/patches/FORTIFY_SOURCE.patch new file mode 100644 index 00000000000..2681effd326 --- /dev/null +++ b/srcpkgs/perl-Text-BibTeX/patches/FORTIFY_SOURCE.patch @@ -0,0 +1,14 @@ +Void Linux uses -D_FORTIFY_SOURCE=2. Remove the flag to not interfere (just in case). + +--- inc/MyBuilder.pm.orig 2019-04-29 17:02:41.000000000 +0200 ++++ inc/MyBuilder.pm 2019-11-24 08:35:16.561126918 +0100 +@@ -208,7 +208,7 @@ + $object =~ s/\.c/.o/; + next if $self->up_to_date($file, $object); + $cbuilder->compile(object_file => $object, +- extra_compiler_flags=>["-D_FORTIFY_SOURCE=1",@EXTRA_FLAGS], ++ extra_compiler_flags=>[@EXTRA_FLAGS], + source => $file, + include_dirs => ["btparse/src"]); + } + diff --git a/srcpkgs/perl-Text-BibTeX/patches/lib64.patch b/srcpkgs/perl-Text-BibTeX/patches/lib64.patch new file mode 100644 index 00000000000..9d499f5ca69 --- /dev/null +++ b/srcpkgs/perl-Text-BibTeX/patches/lib64.patch @@ -0,0 +1,20 @@ +--- Build.PL ++++ Build.PL +@@ -88,17 +88,7 @@ if ( $^O =~ /mswin32/i ) { + } + } + else { +- if ( $Config{archname} =~ /^x86_64|^ppc64|^s390x|^aarch64|^riscv64/ ) { +- $libdir =~ s/\bbin\b/lib64/; +- if ( !-d $libdir ) { +- my $test = $libdir; +- $test =~ s/lib64/lib/; +- $libdir = $test if -d $test; +- } +- } +- else { + $libdir =~ s/\bbin\b/lib/; +- } + $hdrdir = $libdir; + $hdrdir =~ s!/[^/]+/?$!/include! + } diff --git a/srcpkgs/perl-Text-BibTeX/template b/srcpkgs/perl-Text-BibTeX/template new file mode 100644 index 00000000000..83a934093aa --- /dev/null +++ b/srcpkgs/perl-Text-BibTeX/template @@ -0,0 +1,36 @@ +# Template file for 'perl-Text-BibTeX' +pkgname=perl-Text-BibTeX +version=0.88 +revision=1 +wrksrc="${pkgname/perl-/}-${version}" +build_style=perl-ModuleBuild +hostmakedepends="perl-ExtUtils-LibBuilder perl-Config-AutoConf" +makedepends="perl perl-Capture-Tiny" +depends="${makedepends}" +short_desc="Text::BibTeX - interface to read and parse BibTeX files" +maintainer="svenper " +license="Artistic-1.0-Perl, GPL-1.0-or-later" +homepage="https://metacpan.org/release/Text-BibTeX/" +distfiles="${CPAN_SITE}/Text/${pkgname/perl-/}-${version}.tar.gz" +checksum=b014586e68bdbcafb0a2cfa0401eb0a04ea5de8c4d5bc36dd0f7faeab6acf42c + +if [ "$CROSS_BUILD" ]; then + _perlprefix=${XBPS_STATEDIR}/perlprefix-${XBPS_TARGET_MACHINE} + export PERL5LIB=$_perlprefix + + do_build() { + mkdir -p $_perlprefix + cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Config"*.p? $_perlprefix + cp "$XBPS_CROSS_BASE/usr/lib/perl5/core_perl/Errno.pm" $_perlprefix + sed -i -e "s;archlibexp => '\(.*\)';archlibexp => '${XBPS_CROSS_BASE}\1';" \ + ${_perlprefix}/Config.pm + sed -i -e "s;^archlibexp='\(.*\)';archlibexp='${XBPS_CROSS_BASE}\1';" \ + ${_perlprefix}/Config_heavy.pl + + LD="$CC" ./Build ${make_build_args} + } +fi + +do_install() { + LD="$CC" ./Build ${make_install_args} install +}