summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs-modes/cask/default.nix
blob: 7d987e73b9133e3f33b83ccdcdca715b8e2e7f1a (plain) (blame)
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
{ stdenv, fetchgit, emacs, python }:

stdenv.mkDerivation rec {
  name = "cask-0.7.2";

  src = fetchgit {
    url = "https://github.com/cask/cask.git";
    rev = "8d667e1ce3f3aa817a7b996f02058b2441f83958";
    sha256 = "08brrdyz7zsw134zwf4dyj6bj2glflszssfq8vya3mh01s38mfri";
  };

  buildInputs = [ emacs python ];

  # byte-compiling emacs files automatically triggers cask's bootstrap
  # mechanism, what we don't want.
  dontBuild = true;

  installPhase = ''
    install -d "$out/share/emacs/site-lisp"
    install cask*.el* "$out/share/emacs/site-lisp"

    install -d "$out/bin"
    install bin/cask "$out/bin"

    # We also need to install cask's templates in order for 'cask
    # init' to work properly.
    install -d "$out/templates"
    install templates/* "$out/templates"

    # In order to work with cask's hard coded file paths (during bootstrap),
    # we have to create these links.
    ln -s "$out/share/emacs/site-lisp/"* "$out"

    # This file disables cask's self-updating function.
    touch "$out/.no-upgrade"
  '';

  meta = with stdenv.lib; {
    description = "Project management tool for Emacs";
    longDescription =
      ''
        Cask is a project management tool for Emacs that helps automate the
        package development cycle; development, dependencies, testing,
        building, packaging and more. Cask can also be used to manage
        dependencies for your local Emacs configuration.
      '';
    homepage = "https://github.com/cask/cask";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = [ maintainers.jgeerds ];
  };
}