help-guix
[Top][All Lists]
Advanced

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

Re: [HELP] Packaging mupdf


From: Pierre-Henry F.
Subject: Re: [HELP] Packaging mupdf
Date: Mon, 04 Mar 2019 17:09:58 +0000

Hi Ricardo,

With your help and a little of headbanging, it finally works !

Here are the relevant parts of the code.
I wrote my journey too, if it's of any help, I will gladly send it here.

Best,
PH


freeGLUT:
    (define-module (freeglut-for-mupdf)
      #:use-module (guix packages)
      #:use-module (guix download)
      #:use-module (gnu packages gl))

    (define-public freeglut-for-mupdf
      (package
       (inherit freeglut)
       (name "freeglut-for-mupdf")
       (version "1.14.0")
       (source (origin
                (method url-fetch)
                (uri (string-append 
"https://mupdf.com/downloads/archive/mupdf-"; version "-source.tar.gz"))
                (sha256
                 (base32
                  "093p7lv6pgyymagn28n58fs0np928r0i5p2az9cc4gwccwx4hhy4"))
                (modules '((guix build utils)))
                (snippet
                 '(begin
                    (for-each
                     (lambda (dir)
                       (delete-file-recursively (string-append "thirdparty/" 
dir)))
                     '("curl" "freetype" "harfbuzz" "jbig2dec" "lcms2"
                       "libjpeg" "mujs" "openjpeg" "zlib"))
                    #t))))
       (arguments
        '(#:tests? #f ; there are none
                   #:phases
                   (modify-phases %standard-phases
                                  (add-after 'unpack 'chdir
                                             (lambda _ (chdir 
"thirdparty/freeglut") #t)))))))

mupdf:
    (define-module (my-mupdf)
      #:use-module (guix packages)
      #:use-module (guix download)
      #:use-module (freeglut-for-mupdf)
      #:use-module (gnu packages pdf)
      #:use-module (gnu packages curl)
      #:use-module (gnu packages fontutils)
      #:use-module (gnu packages gtk)
      #:use-module (gnu packages image)
      #:use-module (gnu packages xorg)
      #:use-module (gnu packages javascript)
      #:use-module (gnu packages tls)
      #:use-module (gnu packages compression))

    (define-public my-mupdf
      (package
       (inherit mupdf)
       (name "my-mupdf")
       (inputs
        `(("curl" ,curl)
          ("freeglut" ,freeglut-for-mupdf)
          ("freetype" ,freetype)
          ("harfbuzz" ,harfbuzz)
          ("jbig2dec" ,jbig2dec)
          ("libjpeg" ,libjpeg)
          ("libx11" ,libx11)
          ("libxext" ,libxext)
          ("mujs" ,mujs)
          ("openjpeg" ,openjpeg)
          ("openssl" ,openssl)
          ("zlib" ,zlib)))))





Cordialement,
Pierre-Henry FRÖHRING
+33 6 34 48 17 57
address@hidden
Skype: pierre.henry.frohring

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, March 3, 2019 3:30 PM, Ricardo Wurmus <address@hidden> wrote:

>
>
> Hi Pierre-Henry,
>
> the mupdf release tarball includes the freeglut sources. We can reuse
> the mupdf package’s “source” field and add a build phase after 'unpack
> to change directories.
>
> Here’s how (untested):
>
> --8<---------------cut here---------------start------------->8---
> (define freeglut-for-mupdf
> (package
> (inherit freeglut)
> (source (origin
> (method url-fetch)
> (uri (string-append "https://mupdf.com/downloads/archive/";
> name "-" version "-source.tar.xz"))
> (sha256
> (base32
> "1psnz02w5p7wc1s1ma7vvjmkjfy641xvsh9ykaqzkk84dflnjgk0"))
> (modules '((guix build utils)))
> (snippet
> '(begin
> (for-each
> (lambda (dir)
> (delete-file-recursively (string-append "thirdparty/" dir)))
> '("curl" "freetype" "harfbuzz" "jbig2dec" "lcms2"
> "libjpeg" "mujs" "openjpeg" "zlib"))
> #t))))
> (arguments
> '(#:tests? #f ; there are none
> #:phases
> (modify-phases %standard-phases
> (add-after 'unpack 'chdir
> (lambda _ (chdir "thirdparty/freeglut") #t)))))))
> --8<---------------cut here---------------end--------------->8---
>
> Hope that helps!
>
> -------------------
>
> Ricardo





reply via email to

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