Merge pull request #132937 from adisbladis/emacs-elpa-fetcher
emacs: Add custom elpa fetcher
This commit is contained in:
commit
13f1f5dde6
|
@ -41,7 +41,10 @@ self: let
|
|||
}: let
|
||||
|
||||
imported = import generated {
|
||||
inherit (self) callPackage;
|
||||
callPackage = pkgs: args: self.callPackage pkgs (args // {
|
||||
# Use custom elpa url fetcher with fallback/uncompress
|
||||
fetchurl = buildPackages.callPackage ./fetchelpa.nix { };
|
||||
});
|
||||
};
|
||||
|
||||
super = removeAttrs imported [ "dash" ];
|
||||
|
|
21
pkgs/applications/editors/emacs/elisp-packages/fetchelpa.nix
Normal file
21
pkgs/applications/editors/emacs/elisp-packages/fetchelpa.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Elpa only serves the latest version of a given package uncompressed.
|
||||
# Once that release is no longer the latest & greatest it gets archived and compressed
|
||||
# meaning that both the URL and the hash changes.
|
||||
#
|
||||
# To work around this issue we fall back to the URL with the .lz suffix and if that's the
|
||||
# one we downloaded we uncompress the file to ensure the hash matches regardless of compression.
|
||||
|
||||
{ fetchurl, lzip }:
|
||||
|
||||
{ url, ... }@args: fetchurl ((removeAttrs args [ "url" ]) // {
|
||||
urls = [
|
||||
url
|
||||
(url + ".lz")
|
||||
];
|
||||
postFetch = ''
|
||||
if [[ $url == *.lz ]]; then
|
||||
${lzip}/bin/lzip -c -d $out > uncompressed
|
||||
mv uncompressed $out
|
||||
fi
|
||||
'';
|
||||
})
|
|
@ -10,7 +10,7 @@ To update the list of packages from nongnu (ELPA),
|
|||
|
||||
*/
|
||||
|
||||
{ lib }:
|
||||
{ lib, buildPackages }:
|
||||
|
||||
self: let
|
||||
|
||||
|
@ -19,7 +19,10 @@ self: let
|
|||
}: let
|
||||
|
||||
imported = import generated {
|
||||
inherit (self) callPackage;
|
||||
callPackage = pkgs: args: self.callPackage pkgs (args // {
|
||||
# Use custom elpa url fetcher with fallback/uncompress
|
||||
fetchurl = buildPackages.callPackage ./fetchelpa.nix { };
|
||||
});
|
||||
};
|
||||
|
||||
super = imported;
|
||||
|
|
|
@ -35,7 +35,8 @@ let
|
|||
inherit lib;
|
||||
};
|
||||
|
||||
mkNongnuPackages = { lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
|
||||
mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
|
||||
inherit (pkgs) buildPackages;
|
||||
inherit lib;
|
||||
};
|
||||
|
||||
|
@ -62,7 +63,7 @@ in makeScope pkgs'.newScope (self: makeOverridable ({
|
|||
pkgs ? pkgs'
|
||||
, lib ? pkgs.lib
|
||||
, elpaPackages ? mkElpaPackages { inherit pkgs lib; } self
|
||||
, nongnuPackages ? mkNongnuPackages { inherit lib; } self
|
||||
, nongnuPackages ? mkNongnuPackages { inherit pkgs lib; } self
|
||||
, melpaStablePackages ? melpaGeneric { inherit pkgs lib; } "stable" self
|
||||
, melpaPackages ? melpaGeneric { inherit pkgs lib; } "unstable" self
|
||||
, orgPackages ? mkOrgPackages { inherit lib; } self
|
||||
|
|
Loading…
Reference in a new issue