Termux-packages: Building biber in Termux perl Dependency Install ERROR

Created on 3 May 2017  ·  13Comments  ·  Source: termux/termux-packages

This is as far as I have gotten building biber http://biblatex-biber.sourceforge.net in Termux:

https://gist.github.com/sdrausty/084637bbe39af54dc6031e65b19bbd98

requires:
! LWP::Protocol::https is not installed
! LWP::Simple is not installed
! Text::BibTeX is not installed
build_requires:
! ExtUtils::LibBuilder is not installed

perl Build installdeps does not install the missing dependancies. Why?

Any suggestions are welcome; Thanks in advance:)

help wanted perl

Most helpful comment

I have added a package biber to the unstable repository which installs biber and dependencies in a postinst script, using @jamesb6626's patch. Please let me know if you run into any problems when installing it!

All 13 comments

cpan reports OALDERS/Net-HTTP-6.14.tar.gz

https://gist.github.com/sdrausty/a8527c4249be592011a510112d26bdbf

And what is this stuff:

/�+� �G�:S2��Kt��E"♰X�����i^�k����b/��2C��Ppi=er��ە�P����F�8�� �`��8�J��ۊ��A���&�3���K

4��}&VJX[��

         ��3-�)��!7�����͂&����~�Q�xy�#b#
                                       v+M  �,#�V9P�ʥܐ���+6� O�RE��ar��*

��

�-���\�/(R* |L[�g6��Tڤ2�f�#{Ś%�3����"�ۜicz��S
                                            �X�`ے�Lޮ�#1[��^tAg��"�J�\#'  �^d�c��5!g<{U�)�g       ;��     �����F�t7��k]�n���=�2B"��iU66�`T�Y):3�      �-�ZrVХ�@�?�1�Z�������*�|�6ug�T���Ņ�yNouV��bb�a\p9t��VNtg]vr}v�

>YeLP%��?����D�.�U�A4' E*y�P�"�IK�Si�>�\�Z�hWX$#����W�]�N �Զx�`N�8V4$�u�2>��i�[����Y�J�n��}.PK

                               �tP�H˼h�1��-w�(�|����U�2�H8 !*�����*�c�;�qbQ�j�.~�Q'NiC���エ��e�*K�ٰA�ek:iF�~��t0Q�E       7Ֆ���:Gu[

[What is this stuff ^^ this ^^ cruft] Doing in the output? Any suggestion?
btw I am using https://github.com/sdrausty/biber forked from https://github.com/plk/biber I also tried building 1.0 and a couple other versions from sourceforge: These perl modules simply failto install onDevice

Try with cpanm instead of cpan (do cpan install App::cpanminus to install it). It seems to be a bit more forgiving.

There's a couple of threads reporting previous cpan problems, @evandeaubl gives some tips in https://github.com/termux/termux-packages/issues/59, namely that

export LDLOADLIBS=/data/data/com.termux/files/usr/lib/libperl.so:/data/data/com.termux/files/usr/lib/libcurl.so
export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libperl.so:/data/data/com.termux/files/usr/lib/libcurl.so

or similar hacks might be needed for building some perl modules.

I have revisited this issue on aarch64 with slightly better success:

Files=22, Tests=1, 15 wallclock secs ( 0.51 usr  0.08 sys + 11.64 cusr  0.81 csys = 13.04 CPU)
Result: FAIL                                                                                      Failed 19/22 test programs. 0/1 subtests failed.
make: *** [Makefile:1048: test_dynamic] Error 255                                                   SHLOMIF/XML-LibXSLT-1.95.tar.gz
  /data/data/com.termux/files/usr/bin/make test -- NOT OK                                         //hint// to see the cpan-testers results for installing this module, try:
  reports SHLOMIF/XML-LibXSLT-1.95.tar.gz                                                         $ cpanm reports SHLOMIF/XML-LibXSLT-1.95.tar.gz                                                   ! Finding reports on cpanmetadb failed.                                                           ! Finding reports () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution reports                                                  --> Working on SHLOMIF/XML-LibXSLT-1.95.tar.gz                                                    Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.95.tar.gz ... OK               Configuring XML-LibXSLT-1.95 ... OK
Building and testing XML-LibXSLT-1.95 ... FAIL                                                    ! Installing SHLOMIF/XML-LibXSLT-1.95.tar.gz failed. See /data/data/com.termux/files/home/.cpanm/work/1497719334.16066/build.log for details. Retry with --force to force install it.

https://sdrausty.github.io/logs/cpanmbuild.log

I'm using https://github.com/plk/biber for building.

perl Build installdeps fails to install modules​ required to build biber

@sdrausty, libxslt can be obtained with pkg install libxslt-dev, install it and try again

@Grimler91 It's already installed:

$ apt list |grep libxslt

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libxslt/stable,now 1.1.29-1 aarch64 [installed]
libxslt-dev/stable,now 1.1.29-1 aarch64 [installed]

@sdrausty Ah :(

$ cd biber/
$ perl Build installdeps
https://sdrausty.github.io/logs/50549755926966buildbiber.log
.
.
.
CANNOT LINK EXECUTABLE: library "libbar.so" not found
page record for 0x7f7efe2010 was not found (block_size=64)
.
.
.
---- Unsatisfied dependencies detected during ----
.
.
.
$ locate libbar.so
$ dpkg -S libbar.so
dpkg-query: no path found matching pattern libbar.so

Biber almost builds on device in Termux Arch https://sdrausty.github.io/TermuxArch/

screenshot_20171127-033303
After installing Arch Linux in Termux:

gcl https://github.com/plk/biber
cd biber
pacman -S base-devel perl-xml-libxslt                                                     
cpan inc::latest Module::Build YAML Log::Log4perl                                         
perl Build.PL                                                                             
perl Build installdeps

One missing dependency is still wanting of install:

[09:19 biber ]$ cpan Encode::JIS2K
Reading '/root/.cpan/Metadata'                                                              
Database was generated on Mon, 27 Nov 2017 03:41:02 GMT
Running install for module 'Encode::JIS2K'                                                
Checksum for /root/.cpan/sources/authors/id/D/DA/DANKOGAI/Encode-JIS2K-0.03.tar.gz ok
Configuring D/DA/DANKOGAI/Encode-JIS2K-0.03.tar.gz with Makefile.PL
enc2xs not found! at Makefile.PL line 35.
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
  DANKOGAI/Encode-JIS2K-0.03.tar.gz                                                         
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK

Any suggestions how to install enc2xs in Arch Linux in Termux are welcome.

I also wasn't able to install ExtUtils::LibBuilder and Text::BibTeX. Building btparse (Text::BibTeX dependency) from source has also not been successfull. See this issue. Without biber texlive is pretty much useless to me.

I got a working build!

Everything was on-device, with aarch64.

This wasn't a clean termux install, so quite a few programs would already have been installed. You might need some other dependencies to get this to work. I also installed some stuff when setting up cpan.

First I attempted to install Text::BibTeX with cpanm, this failed (along with ExtUtils::LibBuilder), though some dependencies were installed.
I then had a look in the directory given for build.log in the output (~/.cpanm/work/<long number>/build.log).

The ExtUtils::LibBuilder test fail for 01-simple.t, where linking libbar.so fails, turns out to be a false alarm. The relevant file (online here) is t/01-simple.t in the folder ~/.cpanm/work/<long number>/ExtUtils-LibBuilder-0.08/ (cd here). It seems to just test if it can do its build thing using a dummy library (libbar as in foo and bar). To do this, it attempts to explicitly set the library path to the test directory, but this fails.
The offending part seems to be

# ...
elsif ($^O =~ /(?:linux|bsd|sun|sol|dragonfly|hpux|irix)/i) {
    $ENV{LD_LIBRARY_PATH} = ".";
    # ...
}
# ...

On termux's perl, $^O is set (I think at compile time) to android, so the regex fails. The program has no idea it should set the environment variable LD_LIBRARY_PATH for android.
However, if we add android to the list and run the ./Build test then everything passes, so install it anyway (I think I did cpanm --force ExtUtils::LibBuilder, but ./Build install might work too).

The next step is Text::BibTeX. After getting LibBuilder installed, I tried this one again with cpanm. It failed.
Now, cd to the new folder ~/.cpanm/work/<new number>/Text-BibTex-0.88/ (the new number is in the output). Again, there seems to be some library path problem for the test, as it can't find libbtparse.so.
It seems to build though, so this time we copy it, either from btparse/src/libbtparse.so or blib/usrlib/libbtparse.so (from find -name libbtparse.so output), into $PREFIX/lib. Then, try ./Build test and everything should work. As before, install it either by cpanm (no need to force it now) or ./Build install.

Now, we just want http://biblatex-biber.sourceforge.net/. I downloaded and extracted the biblatex-biber.tar.gz file to get a biblatex-biber-2.14/ folder, cd to it. There was no Build executable script yet, just a Build.PL, so I did perl Build.PL to create the script, then ran it with ./Build. It failed due to missing dependencies. I set them installing with ./Build installdeps, this took a very long time, probably around 30mins or more. Apparently you can also do cpanm --installdeps . to do this with cpanm (not sure if it does this anyway). This may or may not be faster, I haven't tried.

The only failed modules this time were due to missing libraries. I had to do apt install libxslt openssl-tool to get XML::LibXSLT, Net::SSLeay and LWP::Protocol::https to install.

Finally, we just have to build biblatex-biber. If I remember correctly, this went fine with ./Build then ./Build test then ./Build install. :tada:

To summarise:
ExtUtils::LibBuilder can be installed with --force. If it is possible/sensible (I don't know much about perl), changing $^O to something like linux-android might make this work on its own.
Text::BibTeX just needs its libbtparse.so copied to $PREFIX/lib.
The rest just needs the right libraries and dependencies installed.

I think I've installed it all with cpan in local::lib mode, so the programs are in the ~/perl5/ directory, including the man pages (man biber doesn't work, I'll need to copy these over). I get a working executable biber though.

@jamesb6626 wrote:

I think I've installed it all with cpan in local::lib mode, so the programs are in the ~/perl5/ directory, including the man pages (man biber doesn't work, I'll need to copy these over). I get a working executable biber though.

When I tried with this source, it installed in $PREFIX, so man biber etc should work....

I have added a package biber to the unstable repository which installs biber and dependencies in a postinst script, using @jamesb6626's patch. Please let me know if you run into any problems when installing it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neitsab picture neitsab  ·  3Comments

bkdwt picture bkdwt  ·  3Comments

StephanBeer picture StephanBeer  ·  3Comments

roalyr picture roalyr  ·  3Comments

roycebank picture roycebank  ·  3Comments