Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { stdenv, fetchFromGitHub, emacs }:
- let
- spacemacsVersion = "v0.200.9";
- spacemacsFuncsVersion = "0.2";
- version = "${spacemacsFuncsVersion}";
- in stdenv.mkDerivation {
- name = "spacemacs-funcs-${version}";
- srcs = [
- (fetchFromGitHub {
- owner = "syl20bnr";
- repo = "spacemacs";
- rev = "${spacemacsVersion}";
- sha256 = "0ks39xricv1b3qkdhghwj2gzqn0ljx9w15l4i9k0hdc4i2s96i6i";
- })
- (fetchFromGitHub {
- owner = "WhittlesJr";
- repo = "spacemacs-functions";
- rev = "${spacemacsFuncsVersion}";
- sha256 = "1zf1bp546a8mwzyjpmzqkm8wlhdw2mi47720vp3lk7yml2mlfqqd";
- })
- ];
- sourceRoot = "spacemacs-functions-${spacemacsFuncsVersion}-src";
- buildInputs = [ emacs ];
- # The following is ported from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs-spacemacs-funcs.
- buildPhase = ''
- emacs -q --no-splash -batch -L . -f batch-byte-compile spacemacs-funcs.el
- cd ../spacemacs-${spacemacsVersion}-src
- shopt -s globstar
- shopt -s extglob
- emacs -q --no-splash -batch -L . -f batch-byte-compile {core,layers}/**/*funcs*.el
- '';
- preInstall = ''
- install -d $out/share/emacs/site-lisp
- '';
- installPhase = ''
- dest="$out/share/emacs/site-lisp"
- install -m644 spacemacs-funcs.el{c,} $dest
- cd ../spacemacs-${spacemacsVersion}-src
- shopt -s globstar
- shopt -s extglob
- find {core,layers}/ -name *funcs.el* -exec bash -c 'file=''${1#./}; install -m644 "$file" "$dest''${file//\//_}"' _ '{}' \;
- '';
- meta = {
- description = "Useful functions from the Spacemacs project";
- homepage = https://github.com/WhittlesJr/spacemacs-functions;
- license = stdenv.lib.licenses.gpl3;
- platforms = stdenv.lib.platforms.all;
- maintainers = [ stdenv.lib.maintainers.WhittlesJr ];
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement