Unverified Commit b873fed1 authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 4999ae57 4dd008c9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -7919,6 +7919,12 @@
    name = "Elis Hirwing";
    keys = [ { fingerprint = "67FE 98F2 8C44 CF22 1828  E12F D57E FA62 5C9A 925F"; } ];
  };
  etwas = {
    email = "ein@etwas.me";
    github = "eetwas";
    githubId = 74488187;
    name = "etwas";
  };
  eu90h = {
    email = "stefan@eu90h.com";
    github = "eu90h";
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ in
      };

      systemd.services.apache-kafka.serviceConfig.StateDirectory = "apache-kafka";

      virtualisation.memorySize = 1024 * 2;
    };
  };

+85 −0
Original line number Diff line number Diff line
diff --git a/cask-bootstrap.el b/cask-bootstrap.el
--- a/cask-bootstrap.el
+++ b/cask-bootstrap.el
@@ -27,41 +27,18 @@
 
 ;;; Code:
 
-(require 'package)
+;; Add nix store paths for dependencies to the load-path.
+(let ((paths '(@loadPaths@)))
+  (dolist (path paths)
+    (push path load-path)))
 
-(defvar cask-directory)
+(let ((paths '(@nativeLoadPaths@)))
+  (dolist (path paths)
+    (push path native-comp-eln-load-path)))
 
-(defconst cask-bootstrap-dir
-  (expand-file-name
-   (locate-user-emacs-file
-    (format ".cask/%s.%s/bootstrap" emacs-major-version emacs-minor-version)))
-  "Path to Cask bootstrap directory.")
-
-;; Restore several package- variables and `load-path` after let-scope.
-(let (package-alist
-      package-archive-contents
-      package--initialized
-      (load-path (add-to-list
-                  'load-path (expand-file-name "package-build" cask-directory)))
-      (package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
-                          ("melpa" . "https://melpa.org/packages/")))
-      (package-user-dir cask-bootstrap-dir)
-      (deps '(s f commander git epl shut-up cl-lib cl-generic eieio ansi)))
-  (package-initialize)
-  (setq package-archive-contents nil) ;; force refresh, cask#573, cask#559
-  (unless (package-installed-p 'cl-lib)
-    ;; package-build depends on cl-lib
-    (unless package-archive-contents
-      (package-refresh-contents))
-    (package-install 'cl-lib))
-  (require 'package-build)
+(let ((deps '(@depsMod@)))
   (dolist (pkg deps)
-    (unless (featurep pkg)
-      (unless (package-installed-p pkg)
-        (unless package-archive-contents
-          (package-refresh-contents))
-        (package-install pkg))
-      (require pkg))))
+    (require pkg)))
 
 (provide 'cask-bootstrap)
 
diff --git a/cask-cli.el b/cask-cli.el
--- a/cask-cli.el
+++ b/cask-cli.el
@@ -129,25 +129,8 @@ already is installed, it will not be installed again."
     (cask-install (cask-cli--bundle))))
 
 (defun cask-cli/upgrade-cask ()
-  "Upgrade Cask itself and its dependencies.
-
-This command requires that Cask is installed using Git and that
-Git is available in `exec-path'."
-  (unless (f-exists? (f-expand ".no-upgrade" cask-directory))
-    (unwind-protect
-        (progn
-          (epl-change-package-dir cask-bootstrap-dir)
-          (epl-initialize)
-          (epl-add-archive "gnu" "https://elpa.gnu.org/packages/")
-          (epl-add-archive "melpa" "https://melpa.org/packages/")
-          (epl-refresh)
-          (epl-upgrade))
-      (epl-reset))
-    (require 'git)
-    (let ((git-repo cask-directory))
-      (if (s-present? (git-run "status" "--porcelain"))
-          (error "Cannot update Cask because of dirty tree")
-        (git-pull)))))
+  "Disabled in Nixpkgs as this function requires that Cask is installed using Git."
+  (princ "Upgrade not available when installed via Nixpkgs.\n"))
 
 (defun cask-cli/exec (&rest _args)
   "Execute ARGS with correct `exec-path' and `load-path'.")
+83 −48
Original line number Diff line number Diff line
@@ -4,32 +4,61 @@
  cl-generic,
  cl-lib,
  commander,

  epl,
  f,
  fetchFromGitHub,
  installShellFiles,
  git,
  melpaBuild,
  package-build,
  replaceVars,
  s,
  shut-up,
}:

melpaBuild (finalAttrs: {
let
  formatLoadPath = x: ''"${x}/share/emacs/site-lisp/elpa/${x.ename}-${x.melpaVersion or x.version}"'';
  formatNativeLoadPath = x: ''"${x}/share/emacs/native-lisp"'';
  getAllDependenciesOfPkg =
    pkg:
    let
      direct = builtins.filter (x: x != null) (pkg.packageRequires or [ ]);
      indirect = builtins.concatLists (map getAllDependenciesOfPkg direct);
    in
    lib.unique (direct ++ indirect);
in
melpaBuild (
  finalAttrs:
  let
    nixpkgDependencies = getAllDependenciesOfPkg finalAttrs.finalPackage;
    loadPaths = builtins.concatStringsSep " " (map formatLoadPath nixpkgDependencies);
    nativeLoadPaths = builtins.concatStringsSep " " (
      map formatNativeLoadPath (nixpkgDependencies ++ [ (placeholder "out") ])
    );
    emacsBuiltinDeps = [
      "cl-lib"
      "eieio"
    ];
    depsMod = builtins.concatStringsSep " " ((map (x: x.ename) nixpkgDependencies) ++ emacsBuiltinDeps);
  in
  {
    pname = "cask";
  version = "0.9.0";
    version = "0.9.1";

    src = fetchFromGitHub {
      name = "cask-source-${finalAttrs.version}";
      owner = "cask";
      repo = "cask";
      rev = "v${finalAttrs.version}";
    hash = "sha256-91rJFsp2SLk/JY+v6G5JmXH5bg9QnT+qhI8ccNJlI4A=";
      hash = "sha256-/vinpQ51AuaTbXW4L4MnVonyfzTMvHUF4HViSPBKZxs=";
    };

    nativeBuildInputs = [ installShellFiles ];

    patches = [
      # Uses LISPDIR substitution var
      ./0000-cask-lispdir.diff
      # Use Nix provided dependencies instead of letting Cask bootstrap itself
      ./0001-cask-bootstrap.diff
    ];

    packageRequires = [
@@ -45,15 +74,20 @@ melpaBuild (finalAttrs: {
      shut-up
    ];

  # use melpaVersion so that it works for unstable releases too
    postPatch = ''
    lispdir=$out/share/emacs/site-lisp/elpa/cask-${finalAttrs.melpaVersion} \
      substituteAllInPlace bin/cask
      # use melpaVersion so that it works for unstable releases too
      substituteInPlace bin/cask \
        --replace-fail @lispdir@ $out/share/emacs/site-lisp/elpa/$ename-$melpaVersion

      # using `replaceVars` results in wrong result of `placeholder "out"`
      substituteInPlace cask-bootstrap.el \
        --replace-fail @depsMod@ '${depsMod}' \
        --replace-fail @loadPaths@ '${loadPaths}' \
        --replace-fail @nativeLoadPaths@ '${nativeLoadPaths}'
    '';

  # TODO: use installBin as soon as installBin arrives Master branch
    postInstall = ''
    install -D -t $out/bin bin/cask
      installBin bin/cask
    '';

    meta = {
@@ -68,4 +102,5 @@ melpaBuild (finalAttrs: {
      mainProgram = "cask";
      maintainers = with lib.maintainers; [ ];
    };
})
  }
)
+825 −825

File changed.

Preview size limit exceeded, changes collapsed.

Loading