Advertisement
WhittlesJr

Untitled

Aug 23rd, 2017
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. { stdenv, fetchFromGitHub, emacs }:
  2.  
  3. let version = "0.2";
  4.  
  5. in stdenv.mkDerivation {
  6.   name = "spacemacs-funcs-${version}";
  7.  
  8.   srcs = [
  9.     (fetchFromGitHub {
  10.       owner = "syl20bnr";
  11.       repo = "spacemacs";
  12.       rev = "200.9";
  13.       sha256 = "81e8fc56421e00405cba2d78f8b5e14b1d9e8e23803dcf43eb8e89b72273ea1b";
  14.      })
  15.     (fetchFromGitHub {
  16.       owner = "WhittlesJr";
  17.       repo = "spacemacs-functions";
  18.       rev = "0.2";
  19.       sha256 = "e653e96a7aea92762841bc5eed968ce514e2e4e8ee1a919abb85e427f04bd27c";
  20.      })
  21.   ];
  22.  
  23.   buildInputs = [ emacs ];
  24.  
  25.   # The following is ported from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs-spacemacs-funcs.
  26.   buildPhase = ''
  27.     emacs -q --no-splash -batch -L . -f batch-byte-compile spacemacs-funcs.el
  28.  
  29.     cd "spacemacs-$version"
  30.     shopt -s globstar
  31.     shopt -s extglob
  32.     emacs -q --no-splash -batch -L . -f batch-byte-compile {core,layers}/**/*funcs*.el
  33.   '';
  34.  
  35.   installPhase = ''
  36.     dest="$out/share/emacs/site-lisp"
  37.  
  38.     install -d $dest
  39.  
  40.     install -m644 spacemacs-funcs.el{c,} $dest
  41.  
  42.     cd "spacemacs-$version"
  43.     shopt -s globstar
  44.     shopt -s extglob
  45.     find {core,layers}/ -name *funcs.el* -exec bash -c 'file=${1#./}; install -m644 "$file" "$dest${file//\//_}"' _ '{}' \;
  46.   '';
  47.  
  48.   meta = {
  49.     description = "Useful functions from the Spacemacs project";
  50.     homepage = https://github.com/WhittlesJr/spacemacs-functions;
  51.     license = stdenv.lib.licenses.gpl3;
  52.     platforms = stdenv.lib.platforms.all;
  53.   };
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement