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