From 59c842a5ade5df4bf70e5c9fcd319a8f3ca83c27 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 9 Jun 2024 08:12:45 +0200 Subject: added README.biber.md --- README.biber.md | 237 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++- 2 files changed, 245 insertions(+), 2 deletions(-) create mode 100644 README.biber.md diff --git a/README.biber.md b/README.biber.md new file mode 100644 index 0000000..c64c740 --- /dev/null +++ b/README.biber.md @@ -0,0 +1,237 @@ +biber for OpenBSD — Build Process +================================= + +Perlbrew +-------- +Once installed, [perlbrew](https://perlbrew.pl) can be started as +follows on OpenBSD: + +1. Add a file named `kshrc` in `$HOME/perl5/perlbrew/etc/` with the + following contents: + + ```sh + export PERLBREW_SHELLRC_VERSION=0.98 + export PERLBREW_ROOT=/home/robert/perl5/perlbrew + + + __perlbrew_reinit() { + if [[ ! -d "$PERLBREW_HOME" ]]; then + mkdir -p "$PERLBREW_HOME" + fi + + [ -f "$PERLBREW_HOME/init" ] && rm "$PERLBREW_HOME/init" + echo '# DO NOT EDIT THIS FILE' > "$PERLBREW_HOME/init" + command perlbrew env $1 | \grep PERLBREW_ >> "$PERLBREW_HOME/init" + . "$PERLBREW_HOME/init" + __perlbrew_set_path + } + + __perlbrew_set_path () { + export PATH=${PERLBREW_PATH:-$PERLBREW_ROOT/bin}:$PATH + hash -r + } + + __perlbrew_set_env() { + code= + code="$($perlbrew_command env $@)" || return $? + eval "$code" + } + + __perlbrew_activate() { + [[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null + + if [[ -n "${PERLBREW_PERL:-}" ]]; then + __perlbrew_set_env "${PERLBREW_PERL:-}${PERLBREW_LIB:+@}$PERLBREW_LIB" + fi + + __perlbrew_set_path + } + + __perlbrew_deactivate() { + __perlbrew_set_env + unset PERLBREW_PERL + unset PERLBREW_LIB + __perlbrew_set_path + } + + perlbrew () { + exit_status= + short_option= + export SHELL + + if [[ $1 == -* ]]; then + short_option=$1 + shift + else + short_option="" + fi + + case $1 in + (use) + if [[ -z "$2" ]] ; then + echo -n "Currently using ${PERLBREW_PERL:-system perl}" + [ -n "$PERLBREW_LIB" ] && echo -n "@$PERLBREW_LIB" + echo + else + __perlbrew_set_env "$2" && { __perlbrew_set_path ; true ; } + exit_status="$?" + fi + ;; + + (switch) + if [[ -z "$2" ]] ; then + command perlbrew switch + else + perlbrew use $2 && { __perlbrew_reinit $2 ; true ; } + exit_status=$? + fi + ;; + + (off) + __perlbrew_deactivate + echo "perlbrew is turned off." + ;; + + (switch-off) + __perlbrew_deactivate + __perlbrew_reinit + echo "perlbrew is switched off." + ;; + + (*) + command perlbrew $short_option "$@" + exit_status=$? + ;; + esac + hash -r + return ${exit_status:-0} + } + + [[ -z "${PERLBREW_ROOT:-}" ]] && export PERLBREW_ROOT="$HOME/perl5/perlbrew" + [[ -z "${PERLBREW_HOME:-}" ]] && export PERLBREW_HOME="$HOME/.perlbrew" + + if [[ ! -n "${PERLBREW_SKIP_INIT:-}" ]]; then + if [[ -f "${PERLBREW_HOME:-}/init" ]]; then + . "$PERLBREW_HOME/init" + fi + fi + + if [[ -f "${PERLBREW_ROOT:-}/bin/perlbrew" ]]; then + perlbrew_command="${PERLBREW_ROOT:-}/bin/perlbrew" + else + perlbrew_command="perlbrew" + fi + + __perlbrew_activate + ``` + +2. Put somewhere in your `$PATH` a file named `useperlbrew` with the + following contents: + + ```sh + #!/bin/sh + + # perlbrew + . $HOME/perl5/perlbrew/etc/kshrc + perlbrew use perl-5.36.3 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/perl5/perlbrew/perls/perl-5.36.3/lib + ``` + +As can be seen, the files above assume `perlbrew` v0.98 and +`perl-5.36.3`. Adapt. These two files allow to initialize a perlbrew +session as follows: + +```sh +. useperlbrew +``` + +biber +----- + +0. Prerequisite: `XSLT C Library`. Do as root: + + ```sh + pkg_add libxslt + ``` + +1. Clone the git repository of `biber`: + + ```sh + git clone https://github.com/plk/biber.git + ``` + +2. Proceed with the installation of `biber` as described in the + [documentation available on + CTAN](http://mirrors.ctan.org/biblio/biber/base/documentation/biber.pdf): + + ```sh + cd biber + git checkout vX.YY # eg. v2.20 for biber 2.20 + + cpanm Module::Build + perl Build.PL + ./Build install + ``` + +3. Now build and install `PAR::Packer`: + + ```sh + cpanm PAR::Packer + ``` + +4. Finally, build `biber` executable for OpenBSD as follows: + + ```sh + mkdir dist/openbsd_amd64 && cd dist/openbsd_amd64 + ``` + + Add in this directory a new file named `build.sh` with the + following contents: + + ```sh + #!/bin/sh + + PAR_VERBATIM=1 pp \ + --module=deprecate \ + --module=BibTeX::Parser \ + --module=Text::BibTeX \ + --module=Biber::Input::file::bibtex \ + --module=Biber::Input::file::biblatexml \ + --module=Biber::Output::dot \ + --module=Biber::Output::bbl \ + --module=Biber::Output::bibtex \ + --module=Biber::Output::biblatexml \ + --module=Pod::Simple::TranscodeSmart \ + --module=Pod::Simple::TranscodeDumb \ + --module=List::MoreUtils::XS \ + --module=List::SomeUtils::XS \ + --module=List::MoreUtils::PP \ + --module=HTTP::Status \ + --module=HTTP::Date \ + --module=Encode:: \ + --module=File::Find::Rule \ + --module=IO::Socket::SSL \ + --module=IO::String \ + --module=PerlIO::utf8_strict \ + --module=Text::CSV_XS \ + --module=DateTime \ + --addfile="../../data/biber-tool.conf;lib/Biber/biber-tool.conf" \ + --addfile="../../data/schemata/config.rnc;lib/Biber/config.rnc" \ + --addfile="../../data/schemata/config.rng;lib/Biber/config.rng"\ + --addfile="../../data/schemata/bcf.rnc;lib/Biber/bcf.rnc" \ + --addfile="../../data/schemata/bcf.rng;lib/Biber/bcf.rng" \ + --addfile="../../lib/Biber/LaTeX/recode_data.xml;lib/Biber/LaTeX/recode_data.xml" \ + --addfile="../../data/bcf.xsl;lib/Biber/bcf.xsl" \ + --addfile="$HOME/perl5/perlbrew/perls/perl-5.36.3/lib/libbtparse.so;../libbtparse.so" \ + --cachedeps=scancache \ + --output=biber-openbsd \ + ../../bin/biber + ``` + +5. Finally, to produce `biber-openbsd`, make `build.sh` executable and + run it: + + ```sh + chmod +x build.sh + ./build.sh + ``` diff --git a/README.md b/README.md index 63dfd75..a5632ab 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ for OpenBSD provides the following: - xindy - LuaMetaTeX (ConTeXt) - asymptote -- biber (see [below](#codebibercode)) +- biber (see [below](#biber)) ### TeX Live for OpenBSD at Utah @@ -248,7 +248,7 @@ tlobsd mksymlinks Just as `tlobsd tlmgr`, this command requires the `subversion` package. -### `biber` +### biber A binary version of `biber`, the backend processor for BibLaTeX, is available in TeX Live for OpenBSD. It can be installed or updated @@ -309,6 +309,12 @@ Building the sources ./tl-build.sh ``` +### Special considerations for biber +[For the same reasons as in standard TeX +Live](https://tug.org/texlive/build.html#biber), `biber` is not +incorporated in the TeX Live for OpenBSD build. The various steps of +its build process are described [on a separate page](README.biber.md). + Acknowledgements ---------------- Special thanks go to the following people for their work and kind -- cgit v1.2.3