1#!/bin/bash
2
3# The cp/rm steps are so that the packed biber main script is not
4# called "biber" as on case-insensitive file systems, this clashes with
5# the Biber lib directory and generates a (harmless) warning on first run
6# Also, pp resolves symlinks and copies the symlink targets of linked libs
7# which then don't have the right names and so things that link to them
8# through the link name break. So, we copy them to the link names first and
9# and package those. This is because OSX is not ELF object format, unlike Linux
10# and so PAR::Packer doesn't understand how to follow the links.
11
12# Don't try to build 32-bit 10.5 binaries on >10.5 by manipulating macports
13# flags and SDKs. It doesn't work. You need a real 10.5 box/VM.
14#
15# Have to explicitly include the Input* modules as the names of these are dynamically
16# constructed in the code so Par::Packer can't auto-detect them.
17# Same with some of the output modules.
18
19cp /opt/local/libexec/perl5.20/sitebin/biber /tmp/biber-darwin
20cp /opt/local/lib/libz.1.2.7.dylib /tmp/libz.1.dylib
21
22PAR_VERBATIM=1 pp --compress=6 \
23  --module=deprecate \
24  --module=Biber::Input::file::bibtex \
25  --module=Biber::Input::file::biblatexml \
26  --module=Biber::Input::file::ris \
27  --module=Biber::Input::file::zoterordfxml \
28  --module=Biber::Input::file::endnotexml \
29  --module=Biber::Output::dot \
30  --module=Biber::Output::bbl \
31  --module=Biber::Output::bibtex \
32  --module=Biber::Output::biblatexml \
33  --module=Pod::Simple::TranscodeSmart \
34  --module=Pod::Simple::TranscodeDumb \
35  --module=List::MoreUtils::XS \
36  --module=List::MoreUtils::PP \
37  --module=Encode::Byte \
38  --module=Encode::CN \
39  --module=HTTP::Status \
40  --module=HTTP::Date \
41  --module=Encode::Locale \
42  --module=Encode::CJKConstants \
43  --module=Encode::EBCDIC \
44  --module=Encode::Encoder \
45  --module=Encode::GSM0338 \
46  --module=Encode::Guess \
47  --module=Encode::JP \
48  --module=Encode::KR \
49  --module=Encode::MIME::Header \
50  --module=Encode::Symbol \
51  --module=Encode::TW \
52  --module=Encode::Unicode \
53  --module=Encode::Unicode::UTF7 \
54  --module=Encode::EUCJPASCII \
55  --module=Encode::JIS2K \
56  --module=Encode::HanExtra \
57  --module=IO::Socket::SSL \
58  --module=File::Find::Rule \
59  --link=/tmp/libz.1.dylib \
60  --link=/opt/local/lib/libiconv.2.dylib \
61  --link=/opt/local/libexec/perl5.20/sitebin/libbtparse.dylib \
62  --link=/opt/local/lib/libxml2.2.dylib \
63  --link=/opt/local/lib/libxslt.1.dylib \
64  --link=/opt/local/lib/libssl.1.0.0.dylib \
65  --link=/opt/local/lib/libcrypto.1.0.0.dylib \
66  --link=/opt/local/lib/libgdbm.4.dylib \
67  --link=/opt/local/lib/libexslt.0.dylib \
68  --link=/opt/local/lib/liblzma.5.dylib \
69  --link=/opt/local/lib/libintl.8.dylib \
70  --addlist=biber.files \
71  --cachedeps=scancache \
72  --output=biber-darwin_x86_i386 \
73  /tmp/biber-darwin
74
75\rm -f /tmp/biber-darwin
76\rm -f /tmp/libz.1.dylib
77