aboutsummaryrefslogtreecommitdiff
path: root/README.biber.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.biber.md')
-rw-r--r--README.biber.md237
1 files changed, 237 insertions, 0 deletions
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 @@
1biber for OpenBSD — Build Process
2=================================
3
4Perlbrew
5--------
6Once installed, [perlbrew](https://perlbrew.pl) can be started as
7follows on OpenBSD:
8
91. Add a file named `kshrc` in `$HOME/perl5/perlbrew/etc/` with the
10 following contents:
11
12 ```sh
13 export PERLBREW_SHELLRC_VERSION=0.98
14 export PERLBREW_ROOT=/home/robert/perl5/perlbrew
15
16
17 __perlbrew_reinit() {
18 if [[ ! -d "$PERLBREW_HOME" ]]; then
19 mkdir -p "$PERLBREW_HOME"
20 fi
21
22 [ -f "$PERLBREW_HOME/init" ] && rm "$PERLBREW_HOME/init"
23 echo '# DO NOT EDIT THIS FILE' > "$PERLBREW_HOME/init"
24 command perlbrew env $1 | \grep PERLBREW_ >> "$PERLBREW_HOME/init"
25 . "$PERLBREW_HOME/init"
26 __perlbrew_set_path
27 }
28
29 __perlbrew_set_path () {
30 export PATH=${PERLBREW_PATH:-$PERLBREW_ROOT/bin}:$PATH
31 hash -r
32 }
33
34 __perlbrew_set_env() {
35 code=
36 code="$($perlbrew_command env $@)" || return $?
37 eval "$code"
38 }
39
40 __perlbrew_activate() {
41 [[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null
42
43 if [[ -n "${PERLBREW_PERL:-}" ]]; then
44 __perlbrew_set_env "${PERLBREW_PERL:-}${PERLBREW_LIB:+@}$PERLBREW_LIB"
45 fi
46
47 __perlbrew_set_path
48 }
49
50 __perlbrew_deactivate() {
51 __perlbrew_set_env
52 unset PERLBREW_PERL
53 unset PERLBREW_LIB
54 __perlbrew_set_path
55 }
56
57 perlbrew () {
58 exit_status=
59 short_option=
60 export SHELL
61
62 if [[ $1 == -* ]]; then
63 short_option=$1
64 shift
65 else
66 short_option=""
67 fi
68
69 case $1 in
70 (use)
71 if [[ -z "$2" ]] ; then
72 echo -n "Currently using ${PERLBREW_PERL:-system perl}"
73 [ -n "$PERLBREW_LIB" ] && echo -n "@$PERLBREW_LIB"
74 echo
75 else
76 __perlbrew_set_env "$2" && { __perlbrew_set_path ; true ; }
77 exit_status="$?"
78 fi
79 ;;
80
81 (switch)
82 if [[ -z "$2" ]] ; then
83 command perlbrew switch
84 else
85 perlbrew use $2 && { __perlbrew_reinit $2 ; true ; }
86 exit_status=$?
87 fi
88 ;;
89
90 (off)
91 __perlbrew_deactivate
92 echo "perlbrew is turned off."
93 ;;
94
95 (switch-off)
96 __perlbrew_deactivate
97 __perlbrew_reinit
98 echo "perlbrew is switched off."
99 ;;
100
101 (*)
102 command perlbrew $short_option "$@"
103 exit_status=$?
104 ;;
105 esac
106 hash -r
107 return ${exit_status:-0}
108 }
109
110 [[ -z "${PERLBREW_ROOT:-}" ]] && export PERLBREW_ROOT="$HOME/perl5/perlbrew"
111 [[ -z "${PERLBREW_HOME:-}" ]] && export PERLBREW_HOME="$HOME/.perlbrew"
112
113 if [[ ! -n "${PERLBREW_SKIP_INIT:-}" ]]; then
114 if [[ -f "${PERLBREW_HOME:-}/init" ]]; then
115 . "$PERLBREW_HOME/init"
116 fi
117 fi
118
119 if [[ -f "${PERLBREW_ROOT:-}/bin/perlbrew" ]]; then
120 perlbrew_command="${PERLBREW_ROOT:-}/bin/perlbrew"
121 else
122 perlbrew_command="perlbrew"
123 fi
124
125 __perlbrew_activate
126 ```
127
1282. Put somewhere in your `$PATH` a file named `useperlbrew` with the
129 following contents:
130
131 ```sh
132 #!/bin/sh
133
134 # perlbrew
135 . $HOME/perl5/perlbrew/etc/kshrc
136 perlbrew use perl-5.36.3
137 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/perl5/perlbrew/perls/perl-5.36.3/lib
138 ```
139
140As can be seen, the files above assume `perlbrew` v0.98 and
141`perl-5.36.3`. Adapt. These two files allow to initialize a perlbrew
142session as follows:
143
144```sh
145. useperlbrew
146```
147
148biber
149-----
150
1510. Prerequisite: `XSLT C Library`. Do as root:
152
153 ```sh
154 pkg_add libxslt
155 ```
156
1571. Clone the git repository of `biber`:
158
159 ```sh
160 git clone https://github.com/plk/biber.git
161 ```
162
1632. Proceed with the installation of `biber` as described in the
164 [documentation available on
165 CTAN](http://mirrors.ctan.org/biblio/biber/base/documentation/biber.pdf):
166
167 ```sh
168 cd biber
169 git checkout vX.YY # eg. v2.20 for biber 2.20
170
171 cpanm Module::Build
172 perl Build.PL
173 ./Build install
174 ```
175
1763. Now build and install `PAR::Packer`:
177
178 ```sh
179 cpanm PAR::Packer
180 ```
181
1824. Finally, build `biber` executable for OpenBSD as follows:
183
184 ```sh
185 mkdir dist/openbsd_amd64 && cd dist/openbsd_amd64
186 ```
187
188 Add in this directory a new file named `build.sh` with the
189 following contents:
190
191 ```sh
192 #!/bin/sh
193
194 PAR_VERBATIM=1 pp \
195 --module=deprecate \
196 --module=BibTeX::Parser \
197 --module=Text::BibTeX \
198 --module=Biber::Input::file::bibtex \
199 --module=Biber::Input::file::biblatexml \
200 --module=Biber::Output::dot \
201 --module=Biber::Output::bbl \
202 --module=Biber::Output::bibtex \
203 --module=Biber::Output::biblatexml \
204 --module=Pod::Simple::TranscodeSmart \
205 --module=Pod::Simple::TranscodeDumb \
206 --module=List::MoreUtils::XS \
207 --module=List::SomeUtils::XS \
208 --module=List::MoreUtils::PP \
209 --module=HTTP::Status \
210 --module=HTTP::Date \
211 --module=Encode:: \
212 --module=File::Find::Rule \
213 --module=IO::Socket::SSL \
214 --module=IO::String \
215 --module=PerlIO::utf8_strict \
216 --module=Text::CSV_XS \
217 --module=DateTime \
218 --addfile="../../data/biber-tool.conf;lib/Biber/biber-tool.conf" \
219 --addfile="../../data/schemata/config.rnc;lib/Biber/config.rnc" \
220 --addfile="../../data/schemata/config.rng;lib/Biber/config.rng"\
221 --addfile="../../data/schemata/bcf.rnc;lib/Biber/bcf.rnc" \
222 --addfile="../../data/schemata/bcf.rng;lib/Biber/bcf.rng" \
223 --addfile="../../lib/Biber/LaTeX/recode_data.xml;lib/Biber/LaTeX/recode_data.xml" \
224 --addfile="../../data/bcf.xsl;lib/Biber/bcf.xsl" \
225 --addfile="$HOME/perl5/perlbrew/perls/perl-5.36.3/lib/libbtparse.so;../libbtparse.so" \
226 --cachedeps=scancache \
227 --output=biber-openbsd \
228 ../../bin/biber
229 ```
230
2315. Finally, to produce `biber-openbsd`, make `build.sh` executable and
232 run it:
233
234 ```sh
235 chmod +x build.sh
236 ./build.sh
237 ```