text_bibtex: new perl module recipe (#11589)

This commit is contained in:
Joachim Mairböck
2025-01-06 15:41:47 +01:00
committed by GitHub
parent 27d1b1493c
commit 56d7a0716f
2 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
From 4ad702485dfdfd7a259c90217bdd2f393674251d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= <j.mairboeck@gmail.com>
Date: Sun, 5 Jan 2025 23:42:32 +0100
Subject: Haiku build support
Set installation paths to Haiku conventions.
Set LIBRARY_PATH for tests.
diff --git a/Build.PL b/Build.PL
index 3ec4ef8..488b985 100644
--- a/Build.PL
+++ b/Build.PL
@@ -87,6 +87,15 @@ if ( $^O =~ /mswin32/i ) {
unlink catfile( $libdir, $target );
}
}
+elsif ( $^O =~ /haiku/i ) {
+ $libdir =~ s/\bbin\b/lib/;
+ $hdrdir = $libdir;
+ $hdrdir =~ s!\blib\b!develop/headers!;
+ if ( $Config{archname} =~ /BePC/ ) {
+ $libdir .= "/x86";
+ $hdrdir .= "/x86";
+ }
+}
else {
if ( $Config{archname} =~ /^x86_64|^ppc64|^s390x|^aarch64|^riscv64/ ) {
$libdir =~ s/\bbin\b/lib64/;
diff --git a/inc/MyBuilder.pm b/inc/MyBuilder.pm
index 8c6f6f9..926ddf4 100644
--- a/inc/MyBuilder.pm
+++ b/inc/MyBuilder.pm
@@ -385,6 +385,10 @@ sub ACTION_test {
my $oldlibpath = $ENV{LIBPATH} || '/lib:/usr/lib';
$ENV{LIBPATH} = catdir($self->blib, "usrlib").":$oldlibpath";
}
+ elsif ($^O =~ /haiku/i) {
+ my $oldlibpath = $ENV{LIBRARY_PATH} || '/boot/system/lib:/boot/system/lib/x86';
+ $ENV{LIBRARY_PATH} = catdir($self->blib, "usrlib").":$oldlibpath";
+ }
elsif ($^O =~ /cygwin/i) {
# cygwin uses windows lib searching (PATH instead of LD_LIBRARY_PATH)
my $oldpath = $ENV{PATH};
--
2.45.2

View File

@@ -0,0 +1,86 @@
SUMMARY="Interface to read and parse BibTeX files"
DESCRIPTION="Text::BibTeX is a Perl library for reading, parsing, and processing BibTeX files. \
It is the Perl half of btOOL, a pair of libraries for dealing with BibTeX data.
Text::BibTeX gives you access to the data at many different levels: you may work with BibTeX \
entries as simple \"field -> string\" mappings, or get at the original form of the data as a list \
of simple values (strings, macros, or numbers) pasted together. You can choose not to impose any \
restrictions on the allowed/expected entry types or fields, or you can use the structure defined \
by BibTeX 0.99's standard style files, or you can invent your own.
The library is copiously documented. After installing the module, see the Text::BibTeX man page \
for a comprehensive introduction to the system. If you wish to dive straight in without regards \
for niceties such as splitting and formatting names, defining or imposing database structures, \
getting access to unprocessed field values, and other nifty features, then you can probably get \
away with just reading the Text::BibTeX::Entry man page. Comments/criticism of the documentation \
are welcome."
HOMEPAGE="https://metacpan.org/pod/Text::BibTeX"
COPYRIGHT="1997-2000 by Gregory P. Ward
2005-2023 Alberto Simões"
LICENSE="Artistic
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/A/AM/AMBS/Text-BibTeX-$portVersion.tar.gz"
CHECKSUM_SHA256="88a78ebf088ec7502f401c5a2b138c862cf5458534b773223bbf3aaf41224196"
SOURCE_DIR="Text-BibTeX-$portVersion"
PATCHES="text_bibtex-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
text_bibtex$secondaryArchSuffix = $portVersion
cmd:biblex
cmd:bibparse
cmd:dumpnames
lib:libbtparse$secondaryArchSuffix
"
if [ -n "$secondaryArchSuffix" ]; then
PROVIDES+="
text_bibtex = $portVersion
"
fi
REQUIRES="
haiku$secondaryArchSuffix
vendor_perl
"
PROVIDES_devel="
text_bibtex${secondaryArchSuffix}_devel = $portVersion
devel:libbtparse$secondaryArchSuffix
"
REQUIRES_devel="
text_bibtex$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
config_autoconf
extutils_libbuilder
module_build
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:perl
"
BUILD()
{
perl Build.PL --installdirs vendor --prefix $prefix
./Build
}
INSTALL()
{
./Build pure_install
prepareInstalledDevelLib libbtparse
packageEntries devel \
$developDir
}
TEST()
{
./Build test
}