help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HELP] Packaging mupdf


From: Ricardo Wurmus
Subject: Re: [HELP] Packaging mupdf
Date: Sat, 02 Mar 2019 23:15:16 +0100
User-agent: mu4e 1.0; emacs 26.1

Hi Pierre-Henry,

> The problem with the way mupdf is package today[2] is that it
> does not include the patched version of freeglut that is
> necessary for the copy-pasting functionality[3].
>
> What does work is to follow the build instructions of mupdf[4]
> which boils down to:
>
>   git clone --recursive git://git.ghostscript.com/mupdf.git
>   cd mupdf
>   git submodule update --init
>   sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev 
> xorg-dev libxcursor-dev libxrandr-dev libxinerama-dev
>   make prefix=~/bin/mupdf install
>
> So, I guess that the objective is to somehow make guix execute
> the above script.

No, this would not work and would not be desirable.

Our mupdf package is already built with freeglut.  Instead of bundling a
patched version of freeglut with your variant of mupdf it would better
to keep the packages separate.

Your first step would be to create a package variant of freeglut (use
“inherit” to avoid duplication) that includes the patch — or maybe it
would make sense to patch freeglut for all its users, I don’t know.

Once that is done you can refer to the new freegut variant in your mupdf
variant package.

Let me get back to the snippet you showed us:

>   git clone --recursive git://git.ghostscript.com/mupdf.git

We express this with the package’s “source” field.

    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "git://git.ghostscript.com/mupdf.git")
                    (commit the-commit-you-need)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "…the result of guix hash -rx . in the checkout…"))))

Let’s not do the recursive clone here, because we don’t actually want
to include all of the submodules which bundle third party code.

>   cd mupdf

We can ignore this.  The “unpack” build phase takes care of this
already.

>   git submodule update --init

We don’t do that.  If we really wanted to fetch submodules we would
specify in the origin above that we want a recursive clone.

>   sudo apt-get install mesa-common-dev libgl1-mesa-dev
>   libglu1-mesa-dev xorg-dev libxcursor-dev libxrandr-dev
>   libxinerama-dev

Since we aren’t using Debian we don’t run this ;)
Instead, we express this through the “inputs” and “native-inputs”
fields.

>   make prefix=~/bin/mupdf install

The usual steps of the GNU build system (configure, make, make check,
make install) are implemented in the gnu-build-system, which we specify
as the value for the “build-system” field.

I encourage you to take a look at gnu/packages/pdf.scm, which contains a
definition for mupdf.  It uses the gnu-build-system and changes its
behaviour via the “arguments” field (e.g. to pass extra options to
“make”, to delete build phases that don’t make sense here, to disable
tests, etc).

Hope this helps!

--
Ricardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]