2018-07-17 21:11:16 +01:00
|
|
|
{ stdenv, fetchurl, which, autoconf, automake, flex, bison
|
2018-01-23 18:48:53 +00:00
|
|
|
, kernel, glibc, perl }:
|
|
|
|
|
|
|
|
with (import ./srcs.nix { inherit fetchurl; });
|
|
|
|
|
|
|
|
let
|
|
|
|
modDestDir = "$out/lib/modules/${kernel.modDirVersion}/extra/openafs";
|
|
|
|
kernelBuildDir = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "openafs-${version}-${kernel.version}";
|
|
|
|
inherit version src;
|
|
|
|
|
2018-07-17 21:11:16 +01:00
|
|
|
nativeBuildInputs = [ autoconf automake flex perl bison which ] ++ kernel.moduleBuildDependencies;
|
2018-01-23 18:48:53 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-linux-kernel-build=${kernelBuildDir}"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
for i in `grep -l -R '/usr/\(include\|src\)' .`; do
|
|
|
|
echo "Patch /usr/include and /usr/src in $i"
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace "/usr/include" "${glibc.dev}/include" \
|
|
|
|
--replace "/usr/src" "${kernelBuildDir}"
|
|
|
|
done
|
|
|
|
|
|
|
|
./regen.sh -q
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make V=1 only_libafs
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p ${modDestDir}
|
2018-08-20 23:22:46 +01:00
|
|
|
cp src/libafs/MODLOAD-*/libafs-${kernel.modDirVersion}.* ${modDestDir}/libafs.ko
|
2018-01-23 18:48:53 +00:00
|
|
|
xz -f ${modDestDir}/libafs.ko
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open AFS client kernel module";
|
|
|
|
homepage = https://www.openafs.org;
|
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.z77z maintainers.spacefrogg ];
|
2018-08-20 23:21:34 +01:00
|
|
|
broken = versionOlder kernel.version "3.18" ||
|
|
|
|
versionAtLeast kernel.version "4.18";
|
2018-01-23 18:48:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|