From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Need some help to remove non-free documentation Date: Mon, 22 Oct 2018 14:32:52 +0200 Message-ID: <87mur6yxe3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEZOF-0001in-VA for help-guix@gnu.org; Mon, 22 Oct 2018 08:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEZOD-00014I-Ai for help-guix@gnu.org; Mon, 22 Oct 2018 08:32:59 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:38327) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gEZOC-00011M-UJ for help-guix@gnu.org; Mon, 22 Oct 2018 08:32:57 -0400 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id A22C7E0007 for ; Mon, 22 Oct 2018 12:32:53 +0000 (UTC) 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: help-guix@gnu.org 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 ;; (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 ;; (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