emacs.pkgs: Get rid of `external` from all-packages.nix

This was a strange construct that made these attrsets more difficult to work with.

It's simpler to just use pkgs.
This commit is contained in:
adisbladis 2021-02-24 14:37:34 +01:00
parent fbecdac147
commit 9647372202
No known key found for this signature in database
GPG Key ID: 110BFAD44C6249B7
4 changed files with 40 additions and 50 deletions

View File

@ -1,4 +1,4 @@
{ lib, external, pkgs }: self: with self; with lib.licenses; { { lib, pkgs }: self: with self; with lib.licenses; {
elisp-ffi = melpaBuild rec { elisp-ffi = melpaBuild rec {
pname = "elisp-ffi"; pname = "elisp-ffi";
@ -9,7 +9,7 @@
rev = version; rev = version;
sha256 = "0z2n3h5l5fj8wl8i1ilfzv11l3zba14sgph6gz7dx7q12cnp9j22"; sha256 = "0z2n3h5l5fj8wl8i1ilfzv11l3zba14sgph6gz7dx7q12cnp9j22";
}; };
buildInputs = [ external.libffi ]; buildInputs = [ pkgs.libffi ];
preBuild = "make"; preBuild = "make";
recipe = pkgs.writeText "recipe" '' recipe = pkgs.writeText "recipe" ''
(elisp-ffi (elisp-ffi
@ -29,15 +29,15 @@
}; };
}; };
agda2-mode = with external; trivialBuild { agda2-mode = trivialBuild {
pname = "agda-mode"; pname = "agda-mode";
version = Agda.version; version = pkgs.haskellPackages.Agda.version;
phases = [ "buildPhase" "installPhase" ]; phases = [ "buildPhase" "installPhase" ];
# already byte-compiled by Agda builder # already byte-compiled by Agda builder
buildPhase = '' buildPhase = ''
agda=`${Agda}/bin/agda-mode locate` agda=`${pkgs.haskellPackages.Agda}/bin/agda-mode locate`
cp `dirname $agda`/*.el* . cp `dirname $agda`/*.el* .
''; '';
@ -47,21 +47,21 @@
Wrapper packages that liberates init.el from `agda-mode locate` magic. Wrapper packages that liberates init.el from `agda-mode locate` magic.
Simply add this to user profile or systemPackages and do `(require 'agda2)` in init.el. Simply add this to user profile or systemPackages and do `(require 'agda2)` in init.el.
''; '';
homepage = Agda.meta.homepage; homepage = pkgs.haskellPackages.Agda.meta.homepage;
license = Agda.meta.license; license = pkgs.haskellPackages.Agda.meta.license;
}; };
}; };
agda-input = self.trivialBuild { agda-input = self.trivialBuild {
pname = "agda-input"; pname = "agda-input";
inherit (external.Agda) src version; inherit (pkgs.haskellPackages.Agda) src version;
postUnpack = "mv $sourceRoot/src/data/emacs-mode/agda-input.el $sourceRoot"; postUnpack = "mv $sourceRoot/src/data/emacs-mode/agda-input.el $sourceRoot";
meta = { meta = {
description = "Standalone package providing the agda-input method without building Agda."; description = "Standalone package providing the agda-input method without building Agda.";
inherit (external.Agda.meta) homepage license; inherit (pkgs.haskellPackages.Agda.meta) homepage license;
}; };
}; };
@ -74,10 +74,10 @@
ghc-mod = melpaBuild { ghc-mod = melpaBuild {
pname = "ghc"; pname = "ghc";
version = external.ghc-mod.version; version = pkgs.haskellPackages.ghc-mod.version;
src = external.ghc-mod.src; src = pkgs.haskellPackages.ghc-mod.src;
packageRequires = [ haskell-mode ]; packageRequires = [ haskell-mode ];
propagatedUserEnvPkgs = [ external.ghc-mod ]; propagatedUserEnvPkgs = [ pkgs.haskellPackages.ghc-mod ];
recipe = pkgs.writeText "recipe" '' recipe = pkgs.writeText "recipe" ''
(ghc-mod :repo "DanielG/ghc-mod" :fetcher github :files ("elisp/*.el")) (ghc-mod :repo "DanielG/ghc-mod" :fetcher github :files ("elisp/*.el"))
''; '';
@ -115,7 +115,7 @@
llvm-mode = trivialBuild { llvm-mode = trivialBuild {
pname = "llvm-mode"; pname = "llvm-mode";
inherit (external.llvmPackages.llvm) src version; inherit (pkgs.llvmPackages.llvm) src version;
dontConfigure = true; dontConfigure = true;
buildPhase = '' buildPhase = ''
@ -123,7 +123,7 @@
''; '';
meta = { meta = {
inherit (external.llvmPackages.llvm.meta) homepage license; inherit (pkgs.llvmPackages.llvm.meta) homepage license;
description = "Major mode for the LLVM assembler language."; description = "Major mode for the LLVM assembler language.";
}; };
}; };
@ -134,13 +134,13 @@
ott-mode = self.trivialBuild { ott-mode = self.trivialBuild {
pname = "ott-mod"; pname = "ott-mod";
inherit (external.ott) src version; inherit (pkgs.ott) src version;
postUnpack = "mv $sourceRoot/emacs/ott-mode.el $sourceRoot"; postUnpack = "mv $sourceRoot/emacs/ott-mode.el $sourceRoot";
meta = { meta = {
description = "Standalone package providing ott-mode without building ott and with compiled bytecode."; description = "Standalone package providing ott-mode without building ott and with compiled bytecode.";
inherit (external.Agda.meta) homepage license; inherit (pkgs.haskellPackages.Agda.meta) homepage license;
}; };
}; };

View File

@ -22,7 +22,7 @@ instantenous and formats commits for you.
*/ */
{ lib, external, pkgs }: variant: self: { lib, pkgs }: variant: self:
let let
dontConfigure = pkg: dontConfigure = pkg:
if pkg != null then pkg.override (args: { if pkg != null then pkg.override (args: {
@ -53,7 +53,7 @@ let
}); });
fix-rtags = pkg: fix-rtags = pkg:
if pkg != null then dontConfigure (externalSrc pkg external.rtags) if pkg != null then dontConfigure (externalSrc pkg pkgs.rtags)
else null; else null;
generateMelpa = lib.makeOverridable ({ archiveJson ? ./recipes-archive-melpa.json generateMelpa = lib.makeOverridable ({ archiveJson ? ./recipes-archive-melpa.json
@ -79,9 +79,9 @@ let
}; };
auto-complete-clang-async = super.auto-complete-clang-async.overrideAttrs (old: { auto-complete-clang-async = super.auto-complete-clang-async.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [ external.llvmPackages.llvm ]; buildInputs = old.buildInputs ++ [ pkgs.llvmPackages.llvm ];
CFLAGS = "-I${external.llvmPackages.clang}/include"; CFLAGS = "-I${pkgs.llvmPackages.clang}/include";
LDFLAGS = "-L${external.llvmPackages.clang}/lib"; LDFLAGS = "-L${pkgs.llvmPackages.clang}/lib";
}); });
# part of a larger package # part of a larger package
@ -132,8 +132,8 @@ let
flycheck-rtags = fix-rtags super.flycheck-rtags; flycheck-rtags = fix-rtags super.flycheck-rtags;
pdf-tools = super.pdf-tools.overrideAttrs (old: { pdf-tools = super.pdf-tools.overrideAttrs (old: {
nativeBuildInputs = [ external.pkg-config ]; nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = with external; old.buildInputs ++ [ autoconf automake libpng zlib poppler ]; buildInputs = with pkgs; old.buildInputs ++ [ autoconf automake libpng zlib poppler ];
preBuild = "make server/epdfinfo"; preBuild = "make server/epdfinfo";
recipe = pkgs.writeText "recipe" '' recipe = pkgs.writeText "recipe" ''
(pdf-tools (pdf-tools
@ -143,7 +143,7 @@ let
}); });
# Build same version as Haskell package # Build same version as Haskell package
hindent = (externalSrc super.hindent external.hindent).overrideAttrs (attrs: { hindent = (externalSrc super.hindent pkgs.haskellPackages.hindent).overrideAttrs (attrs: {
packageRequires = [ self.haskell-mode ]; packageRequires = [ self.haskell-mode ];
}); });
@ -169,7 +169,7 @@ let
dontUseCmakeBuildDir = true; dontUseCmakeBuildDir = true;
doCheck = true; doCheck = true;
packageRequires = [ self.emacs ]; packageRequires = [ self.emacs ];
nativeBuildInputs = [ external.cmake external.llvmPackages.llvm external.llvmPackages.clang ]; nativeBuildInputs = [ pkgs.cmake pkgs.llvmPackages.llvm pkgs.llvmPackages.clang ];
}); });
# tries to write a log file to $HOME # tries to write a log file to $HOME
@ -286,18 +286,18 @@ let
# part of a larger package # part of a larger package
notmuch = dontConfigure super.notmuch; notmuch = dontConfigure super.notmuch;
rtags = dontConfigure (externalSrc super.rtags external.rtags); rtags = dontConfigure (externalSrc super.rtags pkgs.rtags);
rtags-xref = dontConfigure super.rtags; rtags-xref = dontConfigure super.rtags;
shm = super.shm.overrideAttrs (attrs: { shm = super.shm.overrideAttrs (attrs: {
propagatedUserEnvPkgs = [ external.structured-haskell-mode ]; propagatedUserEnvPkgs = [ pkgs.haskellPackages.structured-haskell-mode ];
}); });
# Telega has a server portion for it's network protocol # Telega has a server portion for it's network protocol
telega = super.telega.overrideAttrs (old: { telega = super.telega.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [ pkgs.tdlib ]; buildInputs = old.buildInputs ++ [ pkgs.tdlib ];
nativeBuildInputs = [ external.pkg-config ]; nativeBuildInputs = [ pkgs.pkg-config ];
postBuild = '' postBuild = ''
cd source/server cd source/server
@ -314,12 +314,12 @@ let
treemacs-magit = super.treemacs-magit.overrideAttrs (attrs: { treemacs-magit = super.treemacs-magit.overrideAttrs (attrs: {
# searches for Git at build time # searches for Git at build time
nativeBuildInputs = nativeBuildInputs =
(attrs.nativeBuildInputs or [ ]) ++ [ external.git ]; (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.git ];
}); });
vdiff-magit = super.vdiff-magit.overrideAttrs (attrs: { vdiff-magit = super.vdiff-magit.overrideAttrs (attrs: {
nativeBuildInputs = nativeBuildInputs =
(attrs.nativeBuildInputs or [ ]) ++ [ external.git ]; (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.git ];
}); });
zmq = super.zmq.overrideAttrs (old: { zmq = super.zmq.overrideAttrs (old: {
@ -328,11 +328,11 @@ let
make make
''; '';
nativeBuildInputs = [ nativeBuildInputs = [
external.autoconf pkgs.autoconf
external.automake pkgs.automake
external.pkg-config pkgs.pkg-config
external.libtool pkgs.libtool
(external.zeromq.override { enableDrafts = true; }) (pkgs.zeromq.override { enableDrafts = true; })
]; ];
postInstall = '' postInstall = ''
mv $out/share/emacs/site-lisp/elpa/zmq-*/src/.libs/emacs-zmq.so $out/share/emacs/site-lisp/elpa/zmq-* mv $out/share/emacs/site-lisp/elpa/zmq-*/src/.libs/emacs-zmq.so $out/share/emacs/site-lisp/elpa/zmq-*
@ -415,7 +415,7 @@ let
window-numbering = markBroken super.window-numbering; window-numbering = markBroken super.window-numbering;
editorconfig = super.editorconfig.overrideAttrs (attrs: { editorconfig = super.editorconfig.overrideAttrs (attrs: {
propagatedUserEnvPkgs = [ external.editorconfig-core-c ]; propagatedUserEnvPkgs = [ pkgs.editorconfig-core-c ];
}); });
# missing dependencies # missing dependencies
@ -433,7 +433,7 @@ let
racer = super.racer.overrideAttrs (attrs: { racer = super.racer.overrideAttrs (attrs: {
postPatch = attrs.postPatch or "" + '' postPatch = attrs.postPatch or "" + ''
substituteInPlace racer.el \ substituteInPlace racer.el \
--replace /usr/local/src/rust/src ${external.rustPlatform.rustcSrc} --replace /usr/local/src/rust/src ${pkgs.rustPlatform.rustcSrc}
''; '';
}); });
@ -462,7 +462,7 @@ let
w3m = super.w3m.override (args: { w3m = super.w3m.override (args: {
melpaBuild = drv: args.melpaBuild (drv // { melpaBuild = drv: args.melpaBuild (drv // {
prePatch = prePatch =
let w3m = "${lib.getBin external.w3m}/bin/w3m"; in let w3m = "${lib.getBin pkgs.w3m}/bin/w3m"; in
'' ''
substituteInPlace w3m.el \ substituteInPlace w3m.el \
--replace 'defcustom w3m-command nil' \ --replace 'defcustom w3m-command nil' \

View File

@ -21960,15 +21960,6 @@ in
melpaBuild = callPackage ../build-support/emacs/melpa.nix { melpaBuild = callPackage ../build-support/emacs/melpa.nix {
inherit emacs; inherit emacs;
}; };
external = {
inherit (haskellPackages)
ghc-mod structured-haskell-mode Agda hindent;
inherit
autoconf automake editorconfig-core-c git libffi libpng pkg-config
poppler rtags w3m zlib substituteAll rustPlatform cmake llvmPackages
libtool zeromq openssl ott;
};
}; };
inherit (gnome3) empathy; inherit (gnome3) empathy;

View File

@ -38,7 +38,6 @@
, trivialBuild , trivialBuild
, melpaBuild , melpaBuild
, external
, pkgs , pkgs
}: }:
@ -50,7 +49,7 @@ let
# Contains both melpa stable & unstable # Contains both melpa stable & unstable
melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix { melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit external lib pkgs; inherit lib pkgs;
}; };
mkMelpaStablePackages = melpaGeneric "stable"; mkMelpaStablePackages = melpaGeneric "stable";
mkMelpaPackages = melpaGeneric "unstable"; mkMelpaPackages = melpaGeneric "unstable";
@ -64,7 +63,7 @@ let
}; };
mkManualPackages = import ../applications/editors/emacs-modes/manual-packages.nix { mkManualPackages = import ../applications/editors/emacs-modes/manual-packages.nix {
inherit external lib pkgs; inherit lib pkgs;
}; };
in lib.makeScope newScope (self: lib.makeOverridable ({ in lib.makeScope newScope (self: lib.makeOverridable ({