[Top][All Lists]

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

Need some help to remove non-free documentation

From: Nicolas Goaziou
Subject: Need some help to remove non-free documentation
Date: Mon, 22 Oct 2018 14:32:52 +0200


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

It involves removing some files from "doc/" subdirectory in source and
updating "". As a consequence, "" 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 "" prevents the package from building properly,

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
    (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
              (uri (string-append "";
                                  "source/giac_" version ".tar.gz"))
              (modules '((guix build utils)
                         (ice-9 ftw)))
               ;; 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.
                  (with-directory-excursion "doc/fr"
                     (lambda (f)
                       (unless (member f '("." ".."
                                           "algo.tex" "ellipse.png" "keywords"
                                           "" ""))
                         (delete-file-recursively f)))
                     (scandir "."))
                    ;; Create new Makefile.  See
                    (call-with-output-file ""
                      (lambda (port)
                        (display "
TEX_LOCAL = algo.tex
PDF_LOCAL = algo.pdf
HTML_LOCAL = algo.html
FIGURES = ellipse*

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) $(dist_thelangdoc_DATA) 

        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 \"$<\" \"address@hidden"

%.pdf %.html: %.tex giacfr.tex
        xvfb-run -a env XCAS_ROOT=../../ ../../src/icas \"$<\"
        set -e; for i in $@; do test -e $$i; done"
                  ;; Re-generate "".  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
     `(#:modules ((ice-9 ftw)
                  (guix build utils)
                  (guix build gnu-build-system))
       (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")))
         (add-after 'unpack 'disable-failing-test
           ;; FIXME: Test failing.  Not sure why.
           (lambda _
             (substitute* "check/"
               (("chk_fhan11") ""))
         (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
                                           (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")))
     `(("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)))
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("libtool" ,libtool)
       ("readline" ,readline)))
    (home-page "";)
    (synopsis "Computer algebra system")
     "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---


Nicolas Goaziou

reply via email to

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