about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-02-07 13:52:42 +0100
committerVladimír Čunát <vcunat@gmail.com>2016-02-07 13:52:42 +0100
commita115bff08c1f2046957d09a6a908202d1b98c311 (patch)
treee15cfb7f524284fcefa5119e7ee0abe2ae1096d9 /pkgs/build-support
parent234f4611393a6818b317f3ad93d2e276515bdc33 (diff)
parent98ffc61e2f846c4818280a4cccce3fdad3eb9677 (diff)
downloadnixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar.gz
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar.bz2
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar.lz
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar.xz
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.tar.zst
nixlib-a115bff08c1f2046957d09a6a908202d1b98c311.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/emacs/wrapper.nix64
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git4
-rw-r--r--pkgs/build-support/fetchgitlocal/default.nix2
-rw-r--r--pkgs/build-support/kernel/modules-closure.nix4
-rw-r--r--pkgs/build-support/kernel/modules-closure.sh2
-rw-r--r--pkgs/build-support/vm/default.nix12
6 files changed, 42 insertions, 46 deletions
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix
index dc4ff03f9e78..efee43d852ea 100644
--- a/pkgs/build-support/emacs/wrapper.nix
+++ b/pkgs/build-support/emacs/wrapper.nix
@@ -32,7 +32,7 @@ in customEmacsPackages.emacsWithPackages (epkgs: [ epkgs.evil epkgs.magit ])
 
 */
 
-{ lib, makeWrapper, stdenv }: self:
+{ lib, lndir, makeWrapper, stdenv }: self:
 
 with lib; let inherit (self) emacs; in
 
@@ -47,11 +47,14 @@ in
 
 stdenv.mkDerivation {
   name = (appendToName "with-packages" emacs).name;
-  nativeBuildInputs = [ emacs makeWrapper ];
+  nativeBuildInputs = [ emacs lndir makeWrapper ];
   inherit emacs explicitRequires;
   phases = [ "installPhase" ];
   installPhase = ''
-    requires=""
+    mkdir -p $out/bin
+    mkdir -p $out/share/emacs/site-lisp
+
+    local requires
     for pkg in $explicitRequires; do
       findInputs $pkg requires propagated-user-env-packages
     done
@@ -59,52 +62,47 @@ stdenv.mkDerivation {
 
     siteStart="$out/share/emacs/site-lisp/site-start.el"
 
-    addEmacsPath() {
-      local list=$1
+    # 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" <<EOF
+(load-file "$emacs/share/emacs/site-lisp/site-start.el")
+(add-to-list 'load-path "$out/share/emacs/site-lisp")
+EOF
+
+    linkPath() {
+      local pkg=$1
       local path=$2
       # Add the path to the search path list, but only if it exists
-      if [[ -d "$path" ]]; then
-        echo "(add-to-list '$list \"$path\")" >>"$siteStart"
+      if [[ -d "$pkg/$path" ]]; then
+        lndir -silent "$pkg/$path" "$out/$path"
       fi
     }
 
-    # Add a dependency's paths to site-start.el
-    addToEmacsPaths() {
-      addEmacsPath "exec-path" "$1/bin"
-      addEmacsPath "load-path" "$1/share/emacs/site-lisp"
-      addEmacsPath "package-directory-list" "$1/share/emacs/site-lisp/elpa"
+    # Add a package's paths to site-start.el
+    linkEmacsPackage() {
+      linkPath "$1" "bin"
+      linkPath "$1" "share/emacs/site-lisp"
     }
 
-    mkdir -p $out/share/emacs/site-lisp
-    # 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.
-    echo "(load-file \"$emacs/share/emacs/site-lisp/site-start.el\")" >"$siteStart"
-    echo "(require 'package)" >>"$siteStart"
-
-    # Set paths for the dependencies of the requested packages. These paths are
-    # searched before the profile paths, but after the explicitly-required paths.
-    for pkg in $requires; do
-      # The explicitly-required packages are also in the list, but we will add
-      # those paths last.
-      if ! ( echo "$explicitRequires" | grep "$pkg" >/dev/null ) ; then
-        addToEmacsPaths $pkg
-      fi
+    # First, link all the explicitly-required packages.
+    for pkg in $explicitRequires; do
+      linkEmacsPackage $pkg
     done
 
-    # Finally, add paths for all the explicitly-required packages. These paths
-    # will be searched first.
-    for pkg in $explicitRequires; do
-      addToEmacsPaths $pkg
+    # Next, link all the dependencies.
+    for pkg in $requires; do
+      linkEmacsPackage $pkg
     done
 
     # Byte-compiling improves start-up time only slightly, but costs nothing.
     emacs --batch -f batch-byte-compile "$siteStart"
 
-    mkdir -p $out/bin
     # Wrap emacs and friends so they find our site-start.el before the original.
     for prog in $emacs/bin/*; do # */
-      makeWrapper "$prog" $out/bin/$(basename "$prog") \
+      local progname=$(basename "$prog")
+      rm -f "$out/bin/$progname"
+      makeWrapper "$prog" "$out/bin/$progname" \
         --suffix EMACSLOADPATH ":" "$out/share/emacs/site-lisp:"
     done
 
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 6cf694dd2b14..945ba592a0ae 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -32,8 +32,8 @@ Options:
       --url url       Any url understand by 'git clone'.
       --rev ref       Any sha1 or references (such as refs/heads/master)
       --hash h        Expected hash.
-      --deepClone     Clone submodules recursively.
-      --no-deepClone  Do not clone submodules.
+      --deepClone     Clone the entire repository.
+      --no-deepClone  Make a shallow clone of just the required ref.
       --leave-dotGit  Keep the .git directories.
       --fetch-submodules Fetch submodules.
       --builder       Clone as fetchgit does, but url, rev, and out option are mandatory.
diff --git a/pkgs/build-support/fetchgitlocal/default.nix b/pkgs/build-support/fetchgitlocal/default.nix
index 60803ddcb1f8..7a25966e9fb5 100644
--- a/pkgs/build-support/fetchgitlocal/default.nix
+++ b/pkgs/build-support/fetchgitlocal/default.nix
@@ -34,7 +34,7 @@ let
 
       # dump tar of *current directory* at given revision
       git -C ${srcStr} archive --format=tar ${gitHash} \
-        | tar xvf - -C $out
+        | tar xf - -C $out
     '';
 
 in nixPath
diff --git a/pkgs/build-support/kernel/modules-closure.nix b/pkgs/build-support/kernel/modules-closure.nix
index cad0c7a21f94..6ae844a62463 100644
--- a/pkgs/build-support/kernel/modules-closure.nix
+++ b/pkgs/build-support/kernel/modules-closure.nix
@@ -9,7 +9,7 @@
 stdenv.mkDerivation {
   name = kernel.name + "-shrunk";
   builder = ./modules-closure.sh;
-  buildInputs = [nukeReferences];
-  inherit kernel rootModules kmod allowMissing;
+  buildInputs = [ nukeReferences kmod ];
+  inherit kernel rootModules allowMissing;
   allowedReferences = ["out"];
 }
diff --git a/pkgs/build-support/kernel/modules-closure.sh b/pkgs/build-support/kernel/modules-closure.sh
index d0ac88f69247..71d507b1e2b1 100644
--- a/pkgs/build-support/kernel/modules-closure.sh
+++ b/pkgs/build-support/kernel/modules-closure.sh
@@ -2,8 +2,6 @@ source $stdenv/setup
 
 set -o pipefail
 
-PATH=$kmod/sbin:$PATH
-
 version=$(cd $kernel/lib/modules && ls -d *)
 
 echo "kernel version is $version"
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index ebcbf8c87b5e..96611b725bec 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -1770,22 +1770,22 @@ rec {
     };
 
     debian8i386 = {
-      name = "debian-8.2-jessie-i386";
-      fullName = "Debian 8.2 Jessie (i386)";
+      name = "debian-8.3-jessie-i386";
+      fullName = "Debian 8.3 Jessie (i386)";
       packagesList = fetchurl {
         url = mirror://debian/dists/jessie/main/binary-i386/Packages.xz;
-        sha256 = "f7eda33a296d792d467b84ba608a33f00ff249cb9a385c005586925645d83778";
+        sha256 = "1240d404bd99afbeec042c08fdab049f0b5a984a393cac7c221553ab08f637f5";
       };
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;
     };
 
     debian8x86_64 = {
-      name = "debian-8.2-jessie-amd64";
-      fullName = "Debian 8.2 Jessie (amd64)";
+      name = "debian-8.3-jessie-amd64";
+      fullName = "Debian 8.3 Jessie (amd64)";
       packagesList = fetchurl {
         url = mirror://debian/dists/jessie/main/binary-amd64/Packages.xz;
-        sha256 = "ff1b82b4c767769e594fd482de4ef8f70bce8e9f01fa8ef2d6952def0b071ba0";
+        sha256 = "ec937c1b3bbfe4803f0fa43681b19d089eb6b355455ac7caa17ec8e9ff604e56";
       };
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;