Em Thu, 25 Aug 2016 15:03:16 +0200
Markus Heiser <markus.hei...@darmarit.de> escreveu:

> Hi Jon, Mauro, Jani,
> 
> today I tested imgmath, it worked well, but needs an
> additional dvipng installation ...
> 
> What do you think, should we document the prerequisites
> on different linux distributions to build documentation
> with sphinx.ext.imgmath and PDF output?
> 
> What I mean, in the meantime we have two PDF applications,
> the imgmath uses "latex" (plus dvipng) and the PDF output 
> uses "xetex".
> 
> I tested on a ubuntu 16.04 sandbox, so my experience is,
> on a debian based system it should be enough to install 
> *base*, *xetex* and *recommended* -TeX packages, the 
> imgmath extensions needs an additional dvipng package::
> 
>    sudo apt-get install \
>          dvipng texlive-base texlive-xetex \
>          texlive-latex-recommended
> 
> Jon and Mauro made there own experience with fedora, where
> the installation procedure seems much more complex.
> 
> Might it be good, to document these experiences, to preserve
> your experience?

Yes, IMHO we should document it somehow. What I do when I want to check the
minimum amount of packages to be installed is to create a LXC image
using the lxc-create scripts. This way, we can be sure that the
environment will be the bare minimum one.

On such environment, before the math extension, I had to install
those packages on Ubuntu Xenial, and on Debian Jessie, in order to
build the docs:

        texlive-xetex python3-sphinx python3-sphinx-rtd-theme ttf-dejavu make 
gcc python3-sphinx-rtd-theme

As the environment is the bare minimum, you'll notice that it also
required "make".

I didn't track the minimal requirements for Fedora, but I had to
install those patchages on my Fedora 24 server yesterday, for it to build
for PDF:

        texlive-amsmath.noarch texlive-mathtools.noarch
        texlive-anyfontsize.noarch texlive-xelatex
        texlive-xetex texlive-xecolor.noarch
        texlive-titlesec.noarch texlive-framed texlive-threeparttable
        texlive-wrapfig texlive-upquote texlive-capt-of eqparbox

With regards to documenting it, I would actually prefer to write a
shell or perl script (as it should require a bare minimum environment,
I would not write it in Python) that would be downloading what's needed,
based on the distribution type. I wrote one such script to allow building
the media drivers out of the tree:

        https://git.linuxtv.org/media_build.git/tree/build

It checks for the type of distribution using this logic:

        $system_release = qx(lsb_release -d) if which("lsb_release");
        $system_release =~ s/Description:\s*// if ($system_release);
        $system_release = catcheck("/etc/system-release") if !$system_release;
        $system_release = catcheck("/etc/redhat-release") if !$system_release;
        $system_release = catcheck("/etc/lsb-release") if !$system_release;
        $system_release = catcheck("/etc/gentoo-release") if !$system_release;
        $system_release = catcheck("/etc/issue") if !$system_release;
        $system_release =~ s/\s+$//;

and checks if the prereqs are available. If not, it displays a hint
with the distro-specific command needed to install the dependencies:

        sub need_program($)
        {
                my $prog = shift;

                return if findprog($prog);

                push @missing, $prog;

                $need++;
        }

        need_program "make";
        ...

        give_hints if ($need);

        die "Build can't procceed as $need dependency is missing" if ($need == 
1);
        die "Build can't procceed as $need dependencies are missing" if ($need);

The give_hints use the system_release to print the required needs:

        sub give_hints()
        {

                # Distro-specific hints
                if ($system_release =~ /Red Hat Enterprise Linux/) {
                        give_redhat_hints;
                        return;
                }
                ...
        }

        sub give_redhat_hints()
        {
                my $install;

                my %map = (
                        "wget"                  => "wget",
                        "lsdiff"                => "patchutils",
                        "Digest::SHA"           => "perl-Digest-SHA",
                        "Proc::ProcessTable"    => "perl-Proc-ProcessTable",
                );

                foreach my $prog (@missing) {
                        print "ERROR: please install \"$prog\", otherwise, 
build won't work.\n";
                        if (defined($map{$prog})) {
                                $install .= " " . $map{$prog};
                        } else {
                                $install .= " " . $prog;
                        }
                }

                printf("You should run:\n\tyum install -y $install\n");
        }



Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to