~bandali/guix-bandali

6f83bdcd3bb3715d53083551ef8b08ce072e0264 — Amin Bandali 9 months ago a70449d
bandali: Add emacs-next-xyz.scm and move emacs-next packages there.

* bandali/packages/emacs-next-xyz.scm (with-emacs-next): Override the
make-autoloads phase to generate proper names for autoloads files.
2 files changed, 66 insertions(+), 20 deletions(-)

A bandali/packages/emacs-next-xyz.scm
M bandali/packages/emacs-xyz.scm
A bandali/packages/emacs-next-xyz.scm => bandali/packages/emacs-next-xyz.scm +65 -0
@@ 0,0 1,65 @@
;;; Copyright © 2020 Amin Bandali <mab@gnu.org>
;;;
;;; This file is not part of GNU Guix, but extends it and is
;;; distributed under the same license as GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (bandali packages emacs-next-xyz)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define (with-emacs-next p)
  "Return a version of package P built using `emacs-next'."
  (package
    (inherit p)
    (name (let ((name (package-name p)))
            (string-append "emacs-next-"
                           (if (string-prefix? "emacs-" name)
                               (substring name
                                          (string-length "emacs-"))
                               name))))
    (arguments
     (let* ; see the (guix build emacs-build-system) module for the
           ; original version of the following functions
         ((my-emacs-package?
           '(lambda (name)
              "See `emacs-package?'."
              (string-prefix? "emacs-next-" name)))
          (my-package-name->name+version
           '(lambda* (name-ver)
              "See `package-name->name+version'."
              (if (my-emacs-package? name-ver) ; checks for "emacs-next-" prefix
                  (string-drop name-ver (string-length "emacs-next-"))
                  name-ver)))
          (my-make-autoloads
           '(lambda* (#:key outputs inputs #:allow-other-keys)
              "See `make-autoloads'."
              (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs"))
                     (out (assoc-ref outputs "out"))
                     (site-lisp (string-append out %install-dir))
                     (elpa-name-ver (store-directory->elpa-name-version out))
                     (elpa-name (my-package-name->name+version elpa-name-ver)))
                (parameterize ((%emacs emacs))
                  (emacs-generate-autoloads elpa-name site-lisp))))))
       (substitute-keyword-arguments (package-arguments p)
         ((#:emacs _ emacs-minimal) emacs-next)
         ((#:phases phases)
          `(modify-phases ,phases
             (replace 'make-autoloads ,my-make-autoloads))))))))

(define-public emacs-next-delight
  (with-emacs-next emacs-delight))

M bandali/packages/emacs-xyz.scm => bandali/packages/emacs-xyz.scm +1 -20
@@ 17,32 17,13 @@
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (bandali packages emacs-xyz)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages sqlite)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system emacs)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define (with-emacs-next p)
  "Return a version of package P built using `emacs-next'."
  (package
    (inherit p)
    (name (let ((name (package-name p)))
            (string-append "emacs-next-"
                           (if (string-prefix? "emacs-" name)
                               (substring name
                                          (string-length "emacs-"))
                               name))))
    (arguments
     (substitute-keyword-arguments (package-arguments p)
       ((#:emacs _ emacs-minimal) emacs-next)))))

(define-public emacs-next-delight
  (with-emacs-next emacs-delight))
  #:use-module (guix packages))

(define-public emacs-shrink-path-git
  (let ((commit "c14882c8599aec79a6e8ef2d06454254bb3e1e41")