all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: help-guix@gnu.org
Subject: Need some help to remove non-free documentation
Date: Mon, 22 Oct 2018 14:32:52 +0200	[thread overview]
Message-ID: <87mur6yxe3.fsf@nicolasgoaziou.fr> (raw)

Hello,

I'm trying to remove non-free documentation from "giac-xcas" package. 

It involves removing some files from "doc/" subdirectory in source and
updating "Makefile.am". As a consequence, "Makefile.in" has to be
updated accordingly. Pain ensues.

I tried to first remove "configure" script, so as to let GNU build
system call "autoreconf -vfi". It fails due to a missing "libtoolize",
even though "libtool" is in the native inputs. I then used the
workaround implemented in "gnome-keyring" package, which consists in
calling various reconfigure steps manually. The "invoke" command still
fails, though the error is not obvious.

Not updating "Makefile.am" prevents the package from building properly,
too.

Here is the current modified package, in all its glory. I'm not sure
about what to try next, so feedback welcome.

--8<---------------cut here---------------start------------->8---
(define-public giac-xcas
  (package
    (name "giac-xcas")
    (version "1.5.0-3")
    (source (origin
              (method url-fetch)
              ;; "~parisse/giac" is not used because the maintainer regularly
              ;; overwrites the release tarball there, introducing a checksum
              ;; mismatch every time.  See
              ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
              (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
                                  "~parisse/debian/dists/stable/main/"
                                  "source/giac_" version ".tar.gz"))
              (sha256
               (base32
                "02c2x4bkjffp9c5qz3npbnvhpqhqq253nbb61wg3l6ch61r71g9x"))
              (modules '((guix build utils)
                         (ice-9 ftw)))
              (snippet
               ;; With the exception of "algo.tex", French documentation is
               ;; released under a license that prohibits distribution for
               ;; commercial purposes, making it non-free.  Remove it.
               '(begin
                  (with-directory-excursion "doc/fr"
                    (for-each
                     (lambda (f)
                       (unless (member f '("." ".."
                                           "algo.tex" "ellipse.png" "keywords"
                                           "Makefile.am" "Makefile.in"))
                         (delete-file-recursively f)))
                     (scandir "."))
                    ;; Create new Makefile.  See
                    ;; <https://salsa.debian.org/science-team/giac/blob/master/debian/upstream-doc-fr/Makefile.am.Debian>
                    (call-with-output-file "Makefile.am"
                      (lambda (port)
                        (display "
TEX_LOCAL = algo.tex
PDF_LOCAL = algo.pdf
HTML_LOCAL = algo.html
FIGURES = ellipse*
EXTRA_DIST = $(TEX_LOCAL) $(HTML_LOCAL) $(FIGURES) $(PDF_LOCAL)

the_LANG = fr
thelangdocdir = $(docdir)/$(the_LANG)
dist_thelangdoc_DATA = keywords

all-local: $(PDF_LOCAL) $(HTML_LOCAL)

install-data-local: all-local
	$(install_sh) -d $(DESTDIR)$(prefix)/share/giac/doc/$(the_LANG)
	$(INSTALL_DATA) $(PDF_LOCAL) $(DESTDIR)$(prefix)/share/giac/doc/$(the_LANG)
	$(INSTALL_DATA) $(HTML_LOCAL) $(DESTDIR)$(prefix)/share/giac/doc/$(the_LANG)
	$(INSTALL_DATA) $(dist_thelangdoc_DATA) $(DESTDIR)$(prefix)/share/giac/doc/$(the_LANG)

install-exec-hook:
	mkdir -p $(DESTDIR)$(prefix)/share/giac/doc/fr/
	ln -sf ../giac.js $(DESTDIR)$(prefix)/share/giac/doc/fr/giac.js

giacfr.tex: ../giacfr.tex
	cp \"$<\" \"$@\"

%.pdf %.html: %.tex giacfr.tex
	xvfb-run -a env XCAS_ROOT=../../ ../../src/icas \"$<\"
	set -e; for i in $@; do test -e $$i; done"
                                 port))))
                  ;; Re-generate "Makefile.in".  Due to missing "libtoolize",
                  ;; "autoreconf -vfi" refuses to proceed.  FIXME: the
                  ;; following doesn't work either.
                  (invoke "autoconf")
                  (invoke "aclocal")
                  (invoke "automake" "-ac")))))
    (build-system gnu-build-system)
    (outputs '("out" "doc"))            ;77MiB of documentation
    (arguments
     `(#:modules ((ice-9 ftw)
                  (guix build utils)
                  (guix build gnu-build-system))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-bin-cp
           ;; Some Makefiles contain hard-coded "/bin/cp".
           (lambda _
             (substitute* (find-files "doc" "^Makefile")
               (("/bin/cp") (which "cp")))
             #t))
         (add-after 'unpack 'disable-failing-test
           ;; FIXME: Test failing.  Not sure why.
           (lambda _
             (substitute* "check/Makefile.in"
               (("chk_fhan11") ""))
             #t))
         (add-after 'install 'install-doc
           ;; Setting --docdir to "doc" output isn't sufficient as
           ;; documentation and examples are scattered throughout the source.
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (doc (assoc-ref outputs "doc"))
                    (docdir (string-append doc
                                           "/share/doc/"
                                           (string-append ,name "-" ,version))))
               ;; For some reason, the install process moves
               ;; "share/giac/examples" instead of "share/giac/doc" to
               ;; "$(docdir)".  Clean up the mess and start over.
               (delete-file-recursively (string-append doc "/share"))
               (mkdir-p docdir)
               (with-directory-excursion out
                 (for-each (lambda (f)
                             (unless (member f '("." ".."))
                               (copy-recursively (string-append "share/giac/" f)
                                                 (string-append docdir "/" f))))
                           (scandir "share/giac"))
                 (delete-file-recursively "share/giac")))
             #t)))))
    (inputs
     `(("fltk" ,fltk)
       ("gmp" ,gmp)
       ("gsl" ,gsl)
       ("lapack" ,lapack)
       ("libao" ,ao)
       ("libjpeg" ,libjpeg)
       ("libpng" ,libpng)
       ("libx11" ,libx11)
       ("libxinerama" ,libxinerama)
       ("libxft" ,libxft)
       ("libxt" ,libxt)
       ("mesa" ,mesa)
       ("mpfi" ,mpfi)
       ("mpfr" ,mpfr)
       ("ntl" ,ntl)
       ("perl" ,perl)
       ("pari-gp" ,pari-gp)
       ("tcsh" ,tcsh)
       ("texlive" ,texlive-tiny)))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("libtool" ,libtool)
       ("readline" ,readline)))
    (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
    (synopsis "Computer algebra system")
    (description
     "Giac/Xcas is a computer algebra system.  It has a compatibility mode for
maple, mupad and the TI89.  It is available as a standalone program (graphic
or text interfaces) or as a C++ library.")
    (license license:gpl3+)))
--8<---------------cut here---------------end--------------->8---

Regards,

-- 
Nicolas Goaziou

             reply	other threads:[~2018-10-22 12:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 12:32 Nicolas Goaziou [this message]
2018-10-24 14:24 ` Need some help to remove non-free documentation Ludovic Courtès
2018-10-25  7:28   ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mur6yxe3.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.