From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [HELP] Packaging mupdf Date: Sat, 02 Mar 2019 23:15:16 +0100 Message-ID: <87mumcx6rv.fsf@elephly.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Cv6-00013h-SR for help-guix@gnu.org; Sat, 02 Mar 2019 17:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0Cv5-0004Ir-Mo for help-guix@gnu.org; Sat, 02 Mar 2019 17:15:48 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21041) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0Cv4-0004CW-Lj for help-guix@gnu.org; Sat, 02 Mar 2019 17:15:47 -0500 In-reply-to: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: "Pierre-Henry F." Cc: "help-guix@gnu.org" 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 x= org-dev libxcursor-dev libxrandr-dev libxinerama-dev > make prefix=3D~/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 =E2=80=9Cinherit=E2=80=9D to avoid duplication) that includes the patch =E2= =80=94 or maybe it would make sense to patch freeglut for all its users, I don=E2=80=99t 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=E2=80=99s =E2=80=9Csource=E2=80=9D 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 "=E2=80=A6the result of guix hash -rx . in the checkout=E2= =80=A6")))) Let=E2=80=99s not do the recursive clone here, because we don=E2=80=99t act= ually want to include all of the submodules which bundle third party code. > cd mupdf We can ignore this. The =E2=80=9Cunpack=E2=80=9D build phase takes care of= this already. > git submodule update --init We don=E2=80=99t 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=E2=80=99t using Debian we don=E2=80=99t run this ;) Instead, we express this through the =E2=80=9Cinputs=E2=80=9D and =E2=80=9C= native-inputs=E2=80=9D fields. > make prefix=3D~/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 =E2=80=9Cbuild-system=E2=80=9D 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 =E2=80=9Carguments=E2=80=9D field (e.g. to pass extra opt= ions to =E2=80=9Cmake=E2=80=9D, to delete build phases that don=E2=80=99t make sens= e here, to disable tests, etc). Hope this helps! -- Ricardo