From 56beae4db6c00b493c1dcdabd7a63721bb852e77 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 28 Aug 2017 20:12:17 -0400 Subject: ply: Allow building for git-fetched kernels --- pkgs/os-specific/linux/ply/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pkgs/os-specific/linux/ply') 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 -- cgit 1.4.1