···
19
+
formatLoadPath = x: ''"${x}/share/emacs/site-lisp/elpa/${x.ename}-${x.melpaVersion or x.version}"'';
20
+
formatNativeLoadPath = x: ''"${x}/share/emacs/native-lisp"'';
21
+
getAllDependenciesOfPkg =
24
+
direct = builtins.filter (x: x != null) (pkg.packageRequires or [ ]);
25
+
indirect = builtins.concatLists (map getAllDependenciesOfPkg direct);
27
+
lib.unique (direct ++ indirect);
32
+
nixpkgDependencies = getAllDependenciesOfPkg finalAttrs.finalPackage;
33
+
loadPaths = builtins.concatStringsSep " " (map formatLoadPath nixpkgDependencies);
34
+
nativeLoadPaths = builtins.concatStringsSep " " (
35
+
map formatNativeLoadPath (nixpkgDependencies ++ [ (placeholder "out") ])
37
+
emacsBuiltinDeps = [
41
+
depsMod = builtins.concatStringsSep " " ((map (x: x.ename) nixpkgDependencies) ++ emacsBuiltinDeps);
18
-
melpaBuild (finalAttrs: {
47
+
src = fetchFromGitHub {
48
+
name = "cask-source-${finalAttrs.version}";
51
+
rev = "v${finalAttrs.version}";
52
+
hash = "sha256-/vinpQ51AuaTbXW4L4MnVonyfzTMvHUF4HViSPBKZxs=";
22
-
src = fetchFromGitHub {
23
-
name = "cask-source-${finalAttrs.version}";
26
-
rev = "v${finalAttrs.version}";
27
-
hash = "sha256-91rJFsp2SLk/JY+v6G5JmXH5bg9QnT+qhI8ccNJlI4A=";
55
+
nativeBuildInputs = [ installShellFiles ];
31
-
# Uses LISPDIR substitution var
32
-
./0000-cask-lispdir.diff
58
+
# Uses LISPDIR substitution var
59
+
./0000-cask-lispdir.diff
60
+
# Use Nix provided dependencies instead of letting Cask bootstrap itself
61
+
./0001-cask-bootstrap.diff
48
-
# use melpaVersion so that it works for unstable releases too
50
-
lispdir=$out/share/emacs/site-lisp/elpa/cask-${finalAttrs.melpaVersion} \
51
-
substituteAllInPlace bin/cask
78
+
# use melpaVersion so that it works for unstable releases too
79
+
substituteInPlace bin/cask \
80
+
--replace-fail @lispdir@ $out/share/emacs/site-lisp/elpa/$ename-$melpaVersion
54
-
# TODO: use installBin as soon as installBin arrives Master branch
56
-
install -D -t $out/bin bin/cask
82
+
# using `replaceVars` results in wrong result of `placeholder "out"`
83
+
substituteInPlace cask-bootstrap.el \
84
+
--replace-fail @depsMod@ '${depsMod}' \
85
+
--replace-fail @loadPaths@ '${loadPaths}' \
86
+
--replace-fail @nativeLoadPaths@ '${nativeLoadPaths}'
60
-
homepage = "https://github.com/cask/cask";
61
-
description = "Project management for Emacs";
62
-
longDescription = ''
63
-
Cask is a project management tool for Emacs that helps automate the
64
-
package development cycle; development, dependencies, testing, building,
67
-
license = lib.licenses.gpl3Plus;
68
-
mainProgram = "cask";
69
-
maintainers = with lib.maintainers; [ ];
94
+
homepage = "https://github.com/cask/cask";
95
+
description = "Project management for Emacs";
96
+
longDescription = ''
97
+
Cask is a project management tool for Emacs that helps automate the
98
+
package development cycle; development, dependencies, testing, building,
101
+
license = lib.licenses.gpl3Plus;
102
+
mainProgram = "cask";
103
+
maintainers = with lib.maintainers; [ ];