diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix new file mode 100644 index 000000000000..0fc6d0bf4717 --- /dev/null +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix @@ -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 + ''; + }); +} diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix index bd927e1fb919..1d04c8f361e0 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix @@ -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); diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix index 2d1122e270fd..dc412e9b246d 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix @@ -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);