ply: Allow building for git-fetched kernels

This commit is contained in:
Tim Steinbach 2017-08-28 20:12:17 -04:00
parent 03b08fca66
commit 56beae4db6
No known key found for this signature in database
GPG Key ID: 472BFCCA96BD0EDA

View File

@ -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