From 2b199537b7fc49a742c4650be55e52be99deed71 Mon Sep 17 00:00:00 2001 From: Samuel Rivas Date: Sun, 3 Apr 2016 21:11:38 +0200 Subject: [PATCH 1/2] emacsWithPackages: move bin and site-lisp to private share directory This is to avoid unwanted side effects when installing a wrapped emacs in the environment: * All executables in the dependencies become available in the user environment * All site-lisp binaries in the dependencies become accessible to unwrapped emacs Also, both bin and site-lisp would generate conflicts so installing a wrapped emacs becomes really cumbersome --- pkgs/build-support/emacs/wrapper.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index efee43d852e..7a85cfa1ed4 100644 --- a/pkgs/build-support/emacs/wrapper.nix +++ b/pkgs/build-support/emacs/wrapper.nix @@ -52,7 +52,8 @@ stdenv.mkDerivation { phases = [ "installPhase" ]; installPhase = '' mkdir -p $out/bin - mkdir -p $out/share/emacs/site-lisp + mkdir -p $out/share/emacs-with-packages/bin + mkdir -p $out/share/emacs-with-packages/site-lisp local requires for pkg in $explicitRequires; do @@ -60,29 +61,32 @@ stdenv.mkDerivation { done # requires now holds all requested packages and their transitive dependencies - siteStart="$out/share/emacs/site-lisp/site-start.el" + siteStart="$out/share/emacs-with-packages/site-lisp/site-start.el" # Begin the new site-start.el by loading the original, which sets some # NixOS-specific paths. Paths are searched in the reverse of the order # they are specified in, so user and system profile paths are searched last. cat >"$siteStart" < Date: Sun, 3 Apr 2016 21:21:50 +0200 Subject: [PATCH 2/2] emacsWithPackages: reduce some duplication --- pkgs/build-support/emacs/wrapper.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index 7a85cfa1ed4..7be4d21bfa8 100644 --- a/pkgs/build-support/emacs/wrapper.nix +++ b/pkgs/build-support/emacs/wrapper.nix @@ -51,9 +51,11 @@ stdenv.mkDerivation { inherit emacs explicitRequires; phases = [ "installPhase" ]; installPhase = '' - mkdir -p $out/bin - mkdir -p $out/share/emacs-with-packages/bin - mkdir -p $out/share/emacs-with-packages/site-lisp + readonly SHARE="share/emacs-with-packages" + + mkdir -p "$out/bin" + mkdir -p "$out/$SHARE/bin" + mkdir -p "$out/$SHARE/site-lisp" local requires for pkg in $explicitRequires; do @@ -61,15 +63,15 @@ stdenv.mkDerivation { done # requires now holds all requested packages and their transitive dependencies - siteStart="$out/share/emacs-with-packages/site-lisp/site-start.el" + siteStart="$out/$SHARE/site-lisp/site-start.el" # Begin the new site-start.el by loading the original, which sets some # NixOS-specific paths. Paths are searched in the reverse of the order # they are specified in, so user and system profile paths are searched last. cat >"$siteStart" <