nixpkgs/pkgs/servers/openafs/1.8/module.nix
Artemis Tosini 71c68185e6
openafs_1_8: Include support for Linux 4.20
OpenAFS version 1.8.2 does not have support for Linux 4.20,
meaning that linuxPackages_latest.openafs_1_8 would fail
to build.

This patch adds patches taken from the OpenAFS git to
remove the references to deprecated functions. This has been
tested on Linux 4.20 and Linux 4.14

This patch must be removed when OpenAFS 1.8.3 is released
and improved when Linux 5.0 is added to Nix
2019-02-20 02:45:11 +00:00

63 lines
1.6 KiB
Nix

{ stdenv, fetchurl, which, autoconf, automake, flex, yacc
, kernel, glibc, perl, libtool_2, kerberos }:
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.modDirVersion}";
inherit version src;
patches = [ ./linux-4.20.patch ];
nativeBuildInputs = [ autoconf automake flex libtool_2 perl which yacc ]
++ kernel.moduleBuildDependencies;
buildInputs = [ kerberos ];
hardeningDisable = [ "pic" ];
configureFlags = [
"--with-linux-kernel-build=${kernelBuildDir}"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-gssapi"
"--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}
cp src/libafs/MODLOAD-*/libafs-${kernel.modDirVersion}.* ${modDestDir}/libafs.ko
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 ];
broken = versionOlder kernel.version "3.18";
};
}