You are not logged in.

#1 2025-08-12 15:44:46

stefano
Member
Registered: 2011-04-09
Posts: 287

How to install bibtool on a TeXLive native installation? [SOLVED]

Problem: I need to use the  bibtool package, but the package in the extra repo relies on libkpathsea, which the native TeXlive installation does NOT provide as a self-standing library. And it seems is not possible to install kpathsea with a TexLive native installation

I am in a double bind, it seems, because:

a. TexLive native does not provide libkpathsea

b. the texlive-bin package DOES provide it, but it conflicts with texlive-dummy

c. texlive-dummy is required by lyx and kile (rather, texlive dummy provides texlive-basic and texlive-core that lyx and kile require)

In short, the bibtool package in extra is not and apparently cannot be made compatible with a TeX Live native installation.


I tried to download bibtool's source and compile it myself with the config option --without-kpathsea (as per docs), which I think would solve my issue, but compilation fails with the following errors:

stefano@gorgias BibTool $ make
gcc -g -O2   -Iinclude  -DREGEX -Iregex-0.12 -I..  -c main.c
main.c: In function ‘usage’:
main.c:172:13: warning: old-style function definition [-Wold-style-definition]
  172 | static void usage(fullp)                           /*                        */
      |             ^~~~~
main.c: In function ‘keep_selected’:
main.c:240:13: warning: old-style function definition [-Wold-style-definition]
  240 | static bool keep_selected(db, rec)                 /*                        */
      |             ^~~~~~~~~~~~~
main.c: In function ‘write_macros’:
main.c:308:13: warning: old-style function definition [-Wold-style-definition]
  308 | static void write_macros(m_file, the_db)           /*                        */
      |             ^~~~~~~~~~~~
main.c: In function ‘read_in_files’:
main.c:335:13: warning: old-style function definition [-Wold-style-definition]
  335 | static void read_in_files(db)                      /*                        */
      |             ^~~~~~~~~~~~~
main.c: In function ‘write_output’:
main.c:356:13: warning: old-style function definition [-Wold-style-definition]
  356 | static void write_output(db)                       /*                        */
      |             ^~~~~~~~~~~~
main.c: In function ‘main’:
main.c:405:5: warning: old-style function definition [-Wold-style-definition]
  405 | int main(argc,argv)                                /*                        */
      |     ^~~~
main.c:564:33: error: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(struct rECORD *, struct rECORD *)’ [-Wincompatible-pointer-types]
  564 |     { if (rsc_sort_reverse) fct = rec_lt_cased;    /*                        */
      |                                 ^
main.c:93:13: note: ‘rec_lt_cased’ declared here
   93 |  static int rec_lt_cased _ARG((Record r1,Record r2));/* main.c               */
      |             ^~~~~~~~~~~~
main.c:565:33: error: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(struct rECORD *, struct rECORD *)’ [-Wincompatible-pointer-types]
  565 |       else                  fct = rec_gt_cased;    /*                        */
      |                                 ^
main.c:91:13: note: ‘rec_gt_cased’ declared here
   91 |  static int rec_gt_cased _ARG((Record r1,Record r2));/* main.c               */
      |             ^~~~~~~~~~~~
main.c:568:33: error: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(struct rECORD *, struct rECORD *)’ [-Wincompatible-pointer-types]
  568 |     { if (rsc_sort_reverse) fct = rec_lt;          /*                        */
      |                                 ^
main.c:92:13: note: ‘rec_lt’ declared here
   92 |  static int rec_lt _ARG((Record r1,Record r2));    /* main.c                 */
      |             ^~~~~~
main.c:569:33: error: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(struct rECORD *, struct rECORD *)’ [-Wincompatible-pointer-types]
  569 |       else                  fct = rec_gt;          /*                        */
      |                                 ^
main.c:90:13: note: ‘rec_gt’ declared here
   90 |  static int rec_gt _ARG((Record r1,Record r2));    /* main.c                 */
      |             ^~~~~~
main.c:571:21: error: passing argument 2 of ‘db_sort’ from incompatible pointer type [-Wincompatible-pointer-types]
  571 |     db_sort(the_db, fct);                          /*                        */
      |                     ^~~
      |                     |
      |                     int (*)(void)
In file included from include/bibtool/expand.h:32,
                 from include/bibtool/bibtool.h:46,
                 from main.c:64:
include/bibtool/database.h:173:33: note: expected ‘int (*)(struct rECORD *, struct rECORD *)’ but argument is of type ‘int (*)(void)’
  173 |  void db_sort _ARG((DB db,int (*less)_ARG((Record, Record))));/*             */
      |                                 ^
include/bibtool/database.h:158:17: note: in definition of macro ‘_ARG’
  158 | #define _ARG(A) A
      |                 ^
main.c: In function ‘rec_gt’:
main.c:624:12: warning: old-style function definition [-Wold-style-definition]
  624 | static int rec_gt(r1, r2)                          /*                        */
      |            ^~~~~~
main.c: In function ‘rec_lt’:
main.c:641:12: warning: old-style function definition [-Wold-style-definition]
  641 | static int rec_lt(r1, r2)                          /*                        */
      |            ^~~~~~
main.c: In function ‘rec_gt_cased’:
main.c:658:12: warning: old-style function definition [-Wold-style-definition]
  658 | static int rec_gt_cased(r1, r2)                    /*                        */
      |            ^~~~~~~~~~~~
main.c: In function ‘rec_lt_cased’:
main.c:675:12: warning: old-style function definition [-Wold-style-definition]
  675 | static int rec_lt_cased(r1, r2)                    /*                        */
      |            ^~~~~~~~~~~~
main.c: In function ‘do_keys’:
main.c:689:13: warning: old-style function definition [-Wold-style-definition]
  689 | static bool do_keys(db, rec)                       /*                        */
      |             ^~~~~~~
main.c: In function ‘do_no_keys’:
main.c:709:13: warning: old-style function definition [-Wold-style-definition]
  709 | static bool do_no_keys(db, rec)                    /*                        */
      |             ^~~~~~~~~~
main.c: In function ‘update_crossref’:
main.c:731:13: warning: old-style function definition [-Wold-style-definition]
  731 | static bool update_crossref(db, rec)               /*                        */
      |             ^~~~~~~~~~~~~~~
make: *** [makefile:477: main.o] Error 1

The latest version of the bibtool code is 6 years old (the latest commit is from 2019), so perhaps it is an issue with the gcc compiler?

Help greatly appreciated

Last edited by stefano (2025-08-12 18:00:04)

Offline

#2 2025-08-12 17:59:48

stefano
Member
Registered: 2011-04-09
Posts: 287

Re: How to install bibtool on a TeXLive native installation? [SOLVED]

Solving my own problem was actually trivial, but for future ref

a. force remove of texlive-dummy (pacman -Rdd texlive-dummy)
b. install texlive-bin (pacman -S texlive-bin)
c. Install bibtool (pacman -S bibtool)
d. reinstall texlive-dummy (pacman -S texlive-dummy)
e. finally enjoy bibtool!

Offline

Board footer

Powered by FluxBB