mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 03:30:45 +00:00
emacs: factor out common overrides for elpa and nongnu packages (#341745)
This commit is contained in:
commit
dfc36088ba
|
@ -0,0 +1,55 @@
|
|||
pkgs:
|
||||
|
||||
self: super:
|
||||
|
||||
let
|
||||
libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in
|
||||
{
|
||||
# TODO delete this when we get upstream fix https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73241
|
||||
eglot = super.eglot.overrideAttrs (old: {
|
||||
postInstall =
|
||||
old.postInstall or ""
|
||||
+ ''
|
||||
local info_file=eglot.info
|
||||
pushd $out/share/emacs/site-lisp/elpa/eglot-*
|
||||
# specify output info file to override the one defined in eglot.texi
|
||||
makeinfo --output=$info_file eglot.texi
|
||||
install-info $info_file dir
|
||||
popd
|
||||
'';
|
||||
});
|
||||
|
||||
# native compilation for tests/seq-tests.el never ends
|
||||
# delete tests/seq-tests.el to workaround this
|
||||
seq = super.seq.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
postUnpack =
|
||||
old.postUnpack or ""
|
||||
+ "\n"
|
||||
+ ''
|
||||
local content_directory=$(echo seq-*)
|
||||
rm --verbose $content_directory/tests/seq-tests.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
'';
|
||||
});
|
||||
|
||||
xeft = super.xeft.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
buildInputs = old.buildInputs or [ ] ++ [ pkgs.xapian ];
|
||||
buildPhase =
|
||||
old.buildPhase or ""
|
||||
+ ''
|
||||
$CXX -shared -o xapian-lite${libExt} xapian-lite.cc $NIX_CFLAGS_COMPILE -lxapian
|
||||
'';
|
||||
postInstall =
|
||||
old.postInstall or ""
|
||||
+ "\n"
|
||||
+ ''
|
||||
outd=$out/share/emacs/site-lisp/elpa/xeft-*
|
||||
install -m444 -t $outd xapian-lite${libExt}
|
||||
rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile
|
||||
'';
|
||||
});
|
||||
}
|
|
@ -47,52 +47,16 @@ self: let
|
|||
|
||||
super = imported;
|
||||
|
||||
overrides = {
|
||||
eglot = super.eglot.overrideAttrs (old: {
|
||||
postInstall = (old.postInstall or "") + ''
|
||||
local info_file=eglot.info
|
||||
pushd $out/share/emacs/site-lisp/elpa/eglot-*
|
||||
# specify output info file to override the one defined in eglot.texi
|
||||
makeinfo --output=$info_file eglot.texi
|
||||
install-info $info_file dir
|
||||
popd
|
||||
'';
|
||||
});
|
||||
commonOverrides = import ./elpa-common-overrides.nix pkgs;
|
||||
|
||||
overrides = self: super: {
|
||||
pq = super.pq.overrideAttrs (old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.postgresql ];
|
||||
});
|
||||
|
||||
xeft = super.xeft.overrideAttrs (old: let
|
||||
libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in {
|
||||
dontUnpack = false;
|
||||
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.xapian ];
|
||||
buildPhase = (old.buildPhase or "") + ''
|
||||
$CXX -shared -o xapian-lite${libExt} xapian-lite.cc $NIX_CFLAGS_COMPILE -lxapian
|
||||
'';
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
outd=$out/share/emacs/site-lisp/elpa/xeft-*
|
||||
install -m444 -t $outd xapian-lite${libExt}
|
||||
rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile
|
||||
'';
|
||||
});
|
||||
|
||||
# native compilation for tests/seq-tests.el never ends
|
||||
# delete tests/seq-tests.el to workaround this
|
||||
seq = super.seq.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
postUnpack = (old.postUnpack or "") + "\n" + ''
|
||||
local content_directory=$(echo seq-*)
|
||||
rm --verbose $content_directory/tests/seq-tests.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
'';
|
||||
});
|
||||
};
|
||||
|
||||
elpaDevelPackages = super // overrides;
|
||||
elpaDevelPackages =
|
||||
let super' = super // (commonOverrides self super); in super' // (overrides self super');
|
||||
|
||||
in elpaDevelPackages);
|
||||
|
||||
|
|
|
@ -47,7 +47,9 @@ self: let
|
|||
|
||||
super = imported;
|
||||
|
||||
overrides = {
|
||||
commonOverrides = import ./elpa-common-overrides.nix pkgs;
|
||||
|
||||
overrides = self: super: {
|
||||
# upstream issue: Wrong type argument: arrayp, nil
|
||||
org-transclusion =
|
||||
if super.org-transclusion.version == "1.2.0"
|
||||
|
@ -98,17 +100,6 @@ self: let
|
|||
};
|
||||
});
|
||||
|
||||
eglot = super.eglot.overrideAttrs (old: {
|
||||
postInstall = (old.postInstall or "") + ''
|
||||
local info_file=eglot.info
|
||||
pushd $out/share/emacs/site-lisp/elpa/eglot-*
|
||||
# specify output info file to override the one defined in eglot.texi
|
||||
makeinfo --output=$info_file eglot.texi
|
||||
install-info $info_file dir
|
||||
popd
|
||||
'';
|
||||
});
|
||||
|
||||
jinx = super.jinx.overrideAttrs (old: let
|
||||
libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in {
|
||||
|
@ -150,38 +141,11 @@ self: let
|
|||
}
|
||||
);
|
||||
|
||||
xeft = super.xeft.overrideAttrs (old: let
|
||||
libExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in {
|
||||
dontUnpack = false;
|
||||
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.xapian ];
|
||||
buildPhase = (old.buildPhase or "") + ''
|
||||
$CXX -shared -o xapian-lite${libExt} xapian-lite.cc $NIX_CFLAGS_COMPILE -lxapian
|
||||
'';
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
outd=$out/share/emacs/site-lisp/elpa/xeft-*
|
||||
install -m444 -t $outd xapian-lite${libExt}
|
||||
rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile
|
||||
'';
|
||||
});
|
||||
|
||||
# native compilation for tests/seq-tests.el never ends
|
||||
# delete tests/seq-tests.el to workaround this
|
||||
seq = super.seq.overrideAttrs (old: {
|
||||
dontUnpack = false;
|
||||
postUnpack = (old.postUnpack or "") + "\n" + ''
|
||||
local content_directory=$(echo seq-*)
|
||||
rm --verbose $content_directory/tests/seq-tests.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
'';
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
elpaPackages = super // overrides;
|
||||
elpaPackages =
|
||||
let super' = super // (commonOverrides self super); in super' // (overrides self super');
|
||||
|
||||
in elpaPackages);
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
pkgs:
|
||||
|
||||
self: super:
|
||||
|
||||
{
|
||||
p4-16-mode = super.p4-16-mode.overrideAttrs {
|
||||
# workaround https://github.com/NixOS/nixpkgs/issues/301795
|
||||
prePatch = ''
|
||||
mkdir tmp-untar-dir
|
||||
pushd tmp-untar-dir
|
||||
|
||||
tar --extract --verbose --file=$src
|
||||
content_directory=$(echo p4-16-mode-*)
|
||||
cp --verbose $content_directory/p4-16-mode-pkg.el $content_directory/p4-pkg.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
|
||||
popd
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -10,7 +10,11 @@
|
|||
3. Run `git commit -m "nongnu-devel-packages $(date -Idate)" -- nongnu-devel-generated.nix`
|
||||
*/
|
||||
|
||||
{ lib, buildPackages }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
buildPackages,
|
||||
}:
|
||||
|
||||
self:
|
||||
let
|
||||
|
@ -35,26 +39,15 @@ let
|
|||
|
||||
super = imported;
|
||||
|
||||
overrides = {
|
||||
p4-16-mode = super.p4-16-mode.overrideAttrs {
|
||||
# workaround https://github.com/NixOS/nixpkgs/issues/301795
|
||||
prePatch = ''
|
||||
mkdir tmp-untar-dir
|
||||
pushd tmp-untar-dir
|
||||
commonOverrides = import ./nongnu-common-overrides.nix pkgs;
|
||||
|
||||
tar --extract --verbose --file=$src
|
||||
content_directory=$(echo p4-16-mode-*)
|
||||
cp --verbose $content_directory/p4-16-mode-pkg.el $content_directory/p4-pkg.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
|
||||
popd
|
||||
'';
|
||||
};
|
||||
};
|
||||
overrides = self: super: { };
|
||||
|
||||
in
|
||||
super // overrides
|
||||
let
|
||||
super' = super // (commonOverrides self super);
|
||||
in
|
||||
super' // (overrides self super')
|
||||
);
|
||||
|
||||
in
|
||||
|
|
|
@ -12,7 +12,7 @@ To update the list of packages from nongnu (ELPA),
|
|||
|
||||
*/
|
||||
|
||||
{ lib, buildPackages }:
|
||||
{ lib, pkgs, buildPackages }:
|
||||
|
||||
self: let
|
||||
|
||||
|
@ -29,24 +29,11 @@ self: let
|
|||
|
||||
super = imported;
|
||||
|
||||
overrides = {
|
||||
p4-16-mode = super.p4-16-mode.overrideAttrs {
|
||||
# workaround https://github.com/NixOS/nixpkgs/issues/301795
|
||||
prePatch = ''
|
||||
mkdir tmp-untar-dir
|
||||
pushd tmp-untar-dir
|
||||
commonOverrides = import ./nongnu-common-overrides.nix pkgs;
|
||||
|
||||
tar --extract --verbose --file=$src
|
||||
content_directory=$(echo p4-16-mode-*)
|
||||
cp --verbose $content_directory/p4-16-mode-pkg.el $content_directory/p4-pkg.el
|
||||
src=$PWD/$content_directory.tar
|
||||
tar --create --verbose --file=$src $content_directory
|
||||
overrides = self: super: { };
|
||||
|
||||
popd
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
in super // overrides);
|
||||
in
|
||||
let super' = super // (commonOverrides self super); in super' // (overrides self super'));
|
||||
|
||||
in generateNongnu { }
|
||||
|
|
|
@ -34,12 +34,12 @@ let
|
|||
};
|
||||
|
||||
mkNongnuDevelPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-devel-packages.nix {
|
||||
inherit (pkgs) buildPackages;
|
||||
inherit (pkgs) pkgs buildPackages;
|
||||
inherit lib;
|
||||
};
|
||||
|
||||
mkNongnuPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/nongnu-packages.nix {
|
||||
inherit (pkgs) buildPackages;
|
||||
inherit (pkgs) pkgs buildPackages;
|
||||
inherit lib;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue