summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ply
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2017-08-28 20:12:17 -0400
committerTim Steinbach <tim@nequissimus.com>2017-08-28 20:12:17 -0400
commit56beae4db6c00b493c1dcdabd7a63721bb852e77 (patch)
treeb39c5727160e371d394e307bb433347df07b92ec /pkgs/os-specific/linux/ply
parent03b08fca66850dc01f988146d8c807d059f9c4af (diff)
downloadnixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar.gz
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar.bz2
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar.lz
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar.xz
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.tar.zst
nixlib-56beae4db6c00b493c1dcdabd7a63721bb852e77.zip
ply: Allow building for git-fetched kernels
Diffstat (limited to 'pkgs/os-specific/linux/ply')
-rw-r--r--pkgs/os-specific/linux/ply/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/ply/default.nix b/pkgs/os-specific/linux/ply/default.nix
index a9c84516ef84..8ae731892768 100644
--- a/pkgs/os-specific/linux/ply/default.nix
+++ b/pkgs/os-specific/linux/ply/default.nix
@@ -16,9 +16,17 @@ in stdenv.mkDerivation {
   };
 
   preAutoreconf = ''
-    # ply wants to install header fails to its build directory
-    # use 7z to handle multiple archive formats transparently
-    7z x ${kernel.src} -so | 7z x -aoa -si -ttar
+    # If kernel sources are a folder (i.e. fetched from git), we just copy them in
+    # Since they are owned by uid 0 and read-only, we need to fix permissions
+    if [ -d ${kernel.src} ]; then
+      cp -r ${kernel.src} linux-${kernel.version}
+      chown -R $(whoami): linux-${kernel.version}
+      chmod -R a+w linux-${kernel.version}
+    else
+      # ply wants to install header files to its build directory
+      # use 7z to handle multiple archive formats transparently
+      7z x ${kernel.src} -so | 7z x -aoa -si -ttar
+    fi
 
     configureFlagsArray+=(--with-kerneldir=$(echo $(pwd)/linux-*))
     ./autogen.sh --prefix=$out