From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] gnu: asymptote: Install Emacs data Date: Sat, 07 May 2016 14:50:12 +0200 Message-ID: <871t5eav7f.fsf@saiph.selenimh> References: <87inyqbvf2.fsf@saiph.selenimh> <87posy7089.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1az1gg-0007E8-HT for guix-devel@gnu.org; Sat, 07 May 2016 08:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1az1ge-0005eD-VD for guix-devel@gnu.org; Sat, 07 May 2016 08:50:26 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:46288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1az1ge-0005dc-Nr for guix-devel@gnu.org; Sat, 07 May 2016 08:50:24 -0400 In-Reply-To: <87posy7089.fsf@gmail.com> (Alex Kost's message of "Sat, 07 May 2016 11:15:18 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Hello, Alex Kost writes: > Thanks! Sorry I didn't build asymptote (as I don't have a wish to build > gigabytes of texlive), but I looked at the source and I see there are > "autoloads" cookies in "/base/asy-mode.el", so it would also > be good to generate "asymptote-autoloads.el" file. Indeed. > For example, you may look at (gnu packages emacs) module to see how > "autoloads" file are generated using 'emacs-generate-autoloads' > procedure. I write some notes below, that seems appropriate to me, but > I'm not going to test the patch because of texlive (sorry again). I > hope other people will do. Fair enough. Here is an updated patch with suggested changes. Thank you for the review. Regards, -- Nicolas Goaziou 0x80A93738 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnu-asymptote-Install-Emacs-data.patch Content-Description: asymptote: install Emacs data (take 2) >From bc0ade21f50a9c6b2f063e8043abe72a61fa9328 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 4 May 2016 00:43:36 +0200 Subject: [PATCH] gnu: asymptote: Install Emacs data * gnu/packages/plotutils.scm (asymptote)[arguments]: Add a phase to install Emacs-Lisp files in an appropriate place. --- gnu/packages/plotutils.scm | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm index 3fdd539..fc0436b 100644 --- a/gnu/packages/plotutils.scm +++ b/gnu/packages/plotutils.scm @@ -25,6 +25,7 @@ #:use-module (guix build-system gnu) #:use-module (gnu packages algebra) #:use-module (gnu packages bdw-gc) + #:use-module (gnu packages emacs) #:use-module (gnu packages xorg) #:use-module (gnu packages image) #:use-module (gnu packages ghostscript) @@ -190,7 +191,8 @@ colors, styles, options and details.") ("texlive" ,texlive) ;For tests and documentation ("perl" ,perl))) (inputs - `(("fftw" ,fftw) + `(("emacs" ,emacs-no-x) + ("fftw" ,fftw) ("freeglut" ,freeglut) ("gsl" ,gsl) ("libgc" ,libgc) @@ -198,7 +200,13 @@ colors, styles, options and details.") ("readline" ,readline) ("zlib" ,zlib))) (arguments - `(#:configure-flags + `(#:modules ((guix build emacs-utils) + (guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:imported-modules (,@%gnu-build-system-modules + (guix build emacs-utils)) + #:configure-flags (list (string-append "--enable-gc=" (assoc-ref %build-inputs "libgc")) (string-append "--with-latex=" (assoc-ref %outputs "out") @@ -210,15 +218,26 @@ colors, styles, options and details.") (modify-phases %standard-phases (add-before 'build 'patch-pdf-viewer (lambda _ - ;; Default to a free pdf viewer + ;; Default to a free pdf viewer. (substitute* "settings.cc" (("defaultPDFViewer=\"acroread\"") - "defaultPDFViewer=\"gv\"")))) + "defaultPDFViewer=\"gv\"")) + #t)) (add-before 'check 'set-HOME ;; Some tests require write access to $HOME, otherwise leading to ;; "failed to create directory /homeless-shelter/.asy" error. (lambda _ - (setenv "HOME" "/tmp")))))) + (setenv "HOME" "/tmp") + #t)) + (add-after 'install 'install-Emacs-data + (lambda* (#:key outputs #:allow-other-keys) + ;; Install related Emacs libraries into an appropriate location. + (let* ((out (assoc-ref outputs "out")) + (lisp-dir (string-append out "/share/emacs/site-lisp"))) + (for-each (cut install-file <> lisp-dir) + (find-files "." "\\.el$")) + (emacs-generate-autoloads ,name lisp-dir)) + #t))))) (home-page "http://asymptote.sourceforge.net") (synopsis "Script-based vector graphics language") (description -- 2.7.4 --=-=-=--