about summary refs log tree commit diff
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-07-27 11:07:35 +0200
committerGitHub <noreply@github.com>2020-07-27 11:07:35 +0200
commit87f85a1c2f3b4c013926f0e2806983e87b5d3b23 (patch)
tree5803c960e757faef927c28214c5f539e2276bfe5
parent682c8aa1177271bbb6278930f6055f955d11e600 (diff)
parentb74dbf73ecf7cc420740c87af4c2d113d1fdd58e (diff)
downloadnixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar.gz
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar.bz2
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar.lz
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar.xz
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.tar.zst
nixlib-87f85a1c2f3b4c013926f0e2806983e87b5d3b23.zip
Merge pull request #47 from nix-community/nativecomp-pkgs
emacsGit/emacsGcc: Use nativeComp support from nixpkgs
-rw-r--r--default.nix27
1 files changed, 7 insertions, 20 deletions
diff --git a/default.nix b/default.nix
index aa0515d2f65b..80284f398ba8 100644
--- a/default.nix
+++ b/default.nix
@@ -19,7 +19,7 @@ let
     };
   });
 
-  mkGitEmacs = namePrefix: jsonFile: attrsFn:
+  mkGitEmacs = namePrefix: jsonFile:
     (self.emacs.override { srcRepo = true; }).overrideAttrs(old: (let
       repoMeta = super.lib.importJSON jsonFile;
       attrs = {
@@ -30,35 +30,23 @@ let
           repo = "emacs";
           inherit (repoMeta) sha256 rev;
         };
-        buildInputs = old.buildInputs ++ [ super.jansson super.harfbuzz.dev ];
         patches = [
           ./patches/tramp-detect-wrapped-gvfsd.patch
           ./patches/clean-env.patch
         ];
-        postPatch = ''
+        postPatch = old.postPatch + ''
           substituteInPlace lisp/loadup.el \
           --replace '(emacs-repository-get-version)' '"${repoMeta.rev}"' \
           --replace '(emacs-repository-get-branch)' '"master"'
         '';
       };
-    in attrs // attrsFn (old // attrs)));
+    in attrs));
 
-  emacsGit = mkGitEmacs "emacs-git" ./repos/emacs/emacs-master.json (_: { });
+  emacsGit = mkGitEmacs "emacs-git" ./repos/emacs/emacs-master.json;
 
-  emacsGcc = mkGitEmacs "emacs-gcc" ./repos/emacs/emacs-feature_native-comp.json (old: {
-    # When this is enabled, emacs does native compilation lazily after starting
-    # up, resulting in quicker package builds up-front, at the cost of slower
-    # running emacs until everything has been compiled. Since the elpa files in
-    # the nix store are read-only and we have binary caches, we prefer the
-    # longer AOT compilation instead of this flag.
-    # makeFlags = [ "NATIVE_FAST_BOOT=1" ];
-
-    LIBRARY_PATH = "${super.lib.getLib self.stdenv.cc.libc}/lib";
-
-    configureFlags = old.configureFlags ++ [ "--with-nativecomp" ];
-
-    buildInputs = old.buildInputs ++ [ self.libgccjit ];
-  });
+  emacsGcc = (mkGitEmacs "emacs-gcc" ./repos/emacs/emacs-feature_native-comp.json).override {
+    nativeComp = true;
+  };
 
   emacsUnstable = let
     repoMeta = super.lib.importJSON ./repos/emacs/emacs-unstable.json;
@@ -70,7 +58,6 @@ let
       repo = "emacs";
       inherit (repoMeta) sha256 rev;
     };
-    buildInputs = old.buildInputs ++ [ super.jansson super.harfbuzz.dev ];
     patches = [
       ./patches/tramp-detect-wrapped-gvfsd-27.patch
       ./patches/clean-env.patch