emacs: Factor out expression to a generic build

This commit is contained in:
adisbladis 2020-08-21 00:54:00 +02:00
parent d1fdc67c53
commit 967259e6b4
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
3 changed files with 19 additions and 11 deletions

View file

@ -0,0 +1,8 @@
import ./generic.nix (rec {
version = "27.1";
sha256 = "0h9f2wpmp6rb5rfwvqwv1ia1nw86h74p7hnz3vb3gjazj67i4k2a";
patches = [
./clean-env.patch
./tramp-detect-wrapped-gvfsd.patch
];
})

View file

@ -1,3 +1,11 @@
{
version
, sha256
, versionModifier ? ""
, pname ? "emacs"
, name ? "emacs-${version}${versionModifier}"
, patches ? [ ]
}:
{ stdenv, lib, fetchurl, fetchpatch, ncurses, xlibsWrapper, libXaw, libXpm
, Xaw3d, libXcursor, pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
, libtiff, librsvg, gconf, libxml2, imagemagick, gnutls, libselinux
@ -32,25 +40,17 @@ assert withXwidgets -> withGTK3 && webkitgtk != null;
let
version = "27.1";
versionModifier = "";
name = "emacs-${version}${versionModifier}";
in stdenv.mkDerivation {
inherit name version;
inherit pname version;
src = fetchurl {
url = "mirror://gnu/emacs/${name}.tar.xz";
sha256 = "0h9f2wpmp6rb5rfwvqwv1ia1nw86h74p7hnz3vb3gjazj67i4k2a";
inherit sha256;
};
enableParallelBuilding = true;
patches = [
./clean-env.patch
./tramp-detect-wrapped-gvfsd.patch
];
postPatch = lib.concatStringsSep "\n" [
(lib.optionalString srcRepo ''
rm -fr .git

View file

@ -19882,7 +19882,7 @@ in
emacsPackages = emacs27Packages;
emacs-nox = emacs27-nox;
emacs27 = callPackage ../applications/editors/emacs {
emacs27 = callPackage ../applications/editors/emacs/27.nix {
# use override to enable additional features
libXaw = xorg.libXaw;
Xaw3d = null;