unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob bce9f734081892eedef02a8206d42dd537e358e0 6956 bytes (raw)
name: gnu/packages/spacemacs.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 David Craven <david@craven.ch>
;;;
;;; This file is part of 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 (gnu packages spacemacs)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages compression)

  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils))

(define-public spacemacs-rolling-release
  (let ((commit "1e278a3cb9cd4730ee17416b55fb778b62da2fd0"))
    (package
      (name "spacemacs-rolling-release")
      (version (git-version "0.3.0" "0" commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/syl20bnr/spacemacs")
                      (commit commit)))
                (sha256 (base32 "17yxgchj7qilgljpjai3ad0pzj7k6sq6gqbnxrvcizvkvcnv10z5"))
                (file-name (string-append name "-" version))
                (patches (search-patches
                          "spacemacs-rolling-release-add-data-dir.patch"
                          "spacemacs-rolling-release-inhibit-read-only.patch"
                          "spacemacs-rolling-release-quelpa-permissions.patch"))))
      (build-system trivial-build-system)
      (native-inputs `(("tar" ,tar) ("xz" ,xz)))
      (arguments (list
                  #:modules '((guix build utils))
                  #:builder '(begin (use-modules (guix build utils))
                                    (setenv "PATH" (string-append (getenv "PATH") ":"
                                                                  (assoc-ref %build-inputs
                                                                             "xz")
                                                                  "/bin"))
                                    (mkdir-p (assoc-ref %outputs "out"))
                                    (system* (string-append
                                               (assoc-ref %build-inputs "tar") "/bin/tar")
                                             "xf" (assoc-ref %build-inputs "source")
                                             "-C" (assoc-ref %outputs "out")
                                             "--strip-components" "1"))))
      (synopsis "Automatically configured emacs for both emacs and vim users")
      (description "Spacemacs is a configuration framework for emacs designed to work well for people with experience using either emacs or vim.  It has 4 driving principles: mnemonics, discoverability, consistency, and crowd configuration.  Mnemonics mean that key bindings use letters that stand for the action they take, making the easier to remember.  Discoverability means that help is displayed when partial keybindings are entered, and prepared configuration units are searchable.  Consistency means that bindings for different use-cases (eg, different programming languages) use the same keybindings for similar actions.  And crowd-configuration means that the spacemacs community collaborates to provide the best default experience for new and expert users alike.")
      (home-page "https://spacemacs.org")
      (license license:gpl3))))

(define* (generate-wrapped-emacs-spacemacs emacs spacemacs #:optional (name "emacs-spacemacs"))
  "Given an emacs package and a spacemacs package, create wrappers that allow the use of spacemacs without conflicting with the base emacs."
  (package
    (name name)
    (version (string-append (package-version emacs) "_" (package-version spacemacs)))
    (source #f)
    (build-system trivial-build-system)
    (inputs `(("sh" ,bash)
              ("emacs" ,emacs)
              ("spacemacs" ,spacemacs)))
    (arguments `(#:modules ((guix build spacemacs-utils) (guix build utils) (srfi srfi-1))
                 #:builder (begin (use-modules (guix build spacemacs-utils) (guix build utils) (srfi srfi-1))
                                  (let* ((shell (string-append
                                                 (assoc-ref %build-inputs "sh")
                                                 "/bin/sh"))
                                         (emacs (string-append
                                                 (assoc-ref %build-inputs "emacs")
                                                 "/bin/emacs"))
                                         (spacemacs
                                          (assoc-ref %build-inputs "spacemacs"))
                                         (out (string-append (assoc-ref %outputs "out")
                                                             "/bin"))

                                         (init-code (create-init-string spacemacs)))
                                    (mkdir-p out)

                                    (generate-wrapper shell
                                                      (string-append out "/spacemacs")
                                                      emacs " --no-init-file" "--eval"
                                                      init-code)

                                    (generate-wrapper shell
                                                      (string-append out
                                                                     "/spacemacsdaemon")
                                                      (string-append out "/spacemacs")
                                                      "--daemon=spacemacs")

                                    (generate-wrapper shell
                                                      (string-append out
                                                                     "/spacemacsclient")
                                                      (string-append emacs "client")
                                                      "--socket-name" "spacemacs")))))
    (home-page (package-home-page spacemacs))
    (synopsis (package-synopsis spacemacs))
    (description (package-description spacemacs))
    (license (package-license spacemacs))))

(define-public emacs-spacemacs
  (generate-wrapped-emacs-spacemacs (@ (gnu packages emacs) emacs) spacemacs-rolling-release))

debug log:

solving bce9f73408 ...
found bce9f73408 in https://yhetil.org/guix-patches/mS425o3U--g_ZZemWqvuUgtTHvBroyNZvJUCP6Dy2ABWdMTmgI1CweiSpOj40xlg1LXarBqJE0krzRh4J-DhzoWQ_jofFDDgxUXg1cvjZUA=@protonmail.com/

applying [1/1] https://yhetil.org/guix-patches/mS425o3U--g_ZZemWqvuUgtTHvBroyNZvJUCP6Dy2ABWdMTmgI1CweiSpOj40xlg1LXarBqJE0krzRh4J-DhzoWQ_jofFDDgxUXg1cvjZUA=@protonmail.com/
diff --git a/gnu/packages/spacemacs.scm b/gnu/packages/spacemacs.scm
new file mode 100644
index 0000000000..bce9f73408

Checking patch gnu/packages/spacemacs.scm...
Applied patch gnu/packages/spacemacs.scm cleanly.

index at:
100644 bce9f734081892eedef02a8206d42dd537e358e0	gnu/packages/spacemacs.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).