summary refs log tree commit diff
path: root/pkgs/development/tools/cask/default.nix
blob: f9e7d215f32015643dfd801d41e753e1efde958a (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
53
54
{ lib, stdenv, python3, emacs, bash }:

stdenv.mkDerivation rec {
  pname = "cask";

  inherit (emacs.pkgs.melpaStablePackages.cask) src version;

  doCheck = true;

  nativeBuildInputs = [ emacs ];
  buildInputs = with emacs.pkgs; [
    s f dash ansi ecukes servant ert-runner el-mock
    noflet ert-async shell-split-string git package-build
  ] ++ [
    python3
    bash
  ];

  strictDeps = true;

  buildPhase = ''
    runHook preBuild
    emacs --batch -L . -f batch-byte-compile cask.el cask-cli.el
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    mkdir -p $out/templates
    mkdir -p $out/share/emacs/site-lisp/cask/bin
    install -Dm644 *.el *.elc $out/share/emacs/site-lisp/cask
    install -Dm755 bin/cask $out/share/emacs/site-lisp/cask/bin
    install -Dm644 templates/* $out/templates/
    touch $out/.no-upgrade
    ln -s $out/share/emacs/site-lisp/cask/bin/cask $out/bin/cask
    runHook postInstall
  '';

  meta = with lib; {
    description = "Project management 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://cask.readthedocs.io/en/latest/index.html";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = [ maintainers.flexw ];
  };
}