ftilmann / latexdiff

Compares two latex files and marks up significant differences between them. Releases on www.ctan.org and mirrors
GNU General Public License v3.0
506 stars 72 forks source link

Issues compiling from source Ubuntu 22.04 #296

Closed vincferr closed 4 months ago

vincferr commented 4 months ago

We are currently bound to Ubuntu 22.04 for our production machine (this is the latest version supported by Azure Dev Ops).

sudo apt-get install -y latexdiff gives only the version 1.3.1-a.

In order to use the latest version, we wanted to compile the package from source.

After cloning the master branch, I execute, from a fresh, minimal ubuntu 22.04

sudo apt update && sudo apt upgrade -y
sudo apt-get upgrade -y perl
sudo apt-get install -y libalgorithm-diff-perl
sudo apt-get install -y make
sudo apt-get install -y libpod-latex-perl
sudo make distribution

and I get the following:

sudo make distribution
[ ! -e dist ] || rm dist
ln -s latexdiff-1.3.3-16-g535c dist
mkdir -p dist/doc
mkdir -p dist/example
pod2latex latexdiff; sed 's/--/-{}-/g' latexdiff.tex > tmp$.tex ; mv tmp$.tex latexdiff.tex
pod2latex latexdiff-vc; sed 's/--/-{}-/g' latexdiff-vc.tex > tmp$.tex ; mv tmp$.tex latexdiff-vc.tex
pod2latex latexrevise ; sed 's/--/-{}-/g' latexrevise.tex > tmp$.tex ; mv tmp$.tex latexrevise.tex
latexdiff -t UNDERLINE example-draft.tex example-rev.tex > example-diff.tex
/bin/sh: 1: latexdiff: not found
make: *** [Makefile:97: example-diff.tex] Error 127

How can I fix that? Is there some package that I am missing? On my personal, latest Ubunt 23.10 It seems to work just fine.

ftilmann commented 4 months ago

make distribution will generate the directory which is meant for upload to CTAN or downloaded as a tar file for manual installation. It will not install latexdiff itself. Once you have the distribution directory, you can go into the distribution directory and then execute make install (which would install the stand alone version, which does not even need algorithm-diff module to be installed. Actually no compilation is necessary, as latexdiff is written in interpreted perl. So the installation is more or less trivial, mostly just copying files into the right directories so they can be found, and you might be better off copying the necessary files yourself. The Makefile is very simplistic and might not be appropriate for your linux distribution. I am not sure where the ln command is coming from. This is not from the included Makefile for sure, and it seems is related to the package. I cannot help with that, you would need to contact the package maintainer.
I am surprised, 1.3.1a was selected for the packaging. The "a" designates alpha and is not really meant for production use, though generally OK, as it's mostly used for accumulating minor changes prior to the next release. The last release version is 1.3.3. I hope this clarifies matters.

vincferr commented 4 months ago

It is a bit weird, I agree. Also the latest Ubuntu gets the 1.3.2 package, not the 1.3.3. I see that the make distribution generates a dist folder (without the make file), but it should have all the necessary parts to make it work. Will try. Thanks!