2019-06-16 20:59:06 +01:00
|
|
|
{ stdenv, fetchurl, which, autoconf, automake, flex, yacc
|
2019-09-20 18:29:06 +01:00
|
|
|
, kernel, glibc, perl, libtool_2, kerberos, fetchpatch }:
|
2018-01-23 18:48:53 +00:00
|
|
|
|
2020-05-21 22:46:44 +01:00
|
|
|
with (import ./srcs.nix {
|
|
|
|
inherit fetchurl;
|
|
|
|
});
|
2018-01-23 18:48:53 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
modDestDir = "$out/lib/modules/${kernel.modDirVersion}/extra/openafs";
|
|
|
|
kernelBuildDir = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2018-10-15 14:48:19 +01:00
|
|
|
name = "openafs-${version}-${kernel.modDirVersion}";
|
2018-01-23 18:48:53 +00:00
|
|
|
inherit version src;
|
|
|
|
|
2018-06-29 23:34:35 +01:00
|
|
|
nativeBuildInputs = [ autoconf automake flex libtool_2 perl which yacc ]
|
|
|
|
++ kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
buildInputs = [ kerberos ];
|
2018-01-23 18:48:53 +00:00
|
|
|
|
2020-05-21 22:46:44 +01:00
|
|
|
patches = [
|
|
|
|
# openafs 5.6 patches, included in the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openafs/openafs/commit/34f1689b7288688550119638ee9959e453fde414.patch";
|
|
|
|
sha256 = "0rxjqzr8c5ajlk8wrhgjc1qp1934qiriqdi0qxsnk4gj5ibbk4d5";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openafs/openafs/commit/355ea43f0d1b7feae1b3af58bc33af12838db7c3.patch";
|
|
|
|
sha256 = "1f9xn8ql6vnxglpj3dvi30sj8vkncazjab2rc13hbw48nvsvcnhm";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openafs/openafs/commit/17d38e31e6f2e237a7fb4dfb46841060296310b6.patch";
|
|
|
|
sha256 = "14dydxfm0f5fvnj0kmvgm3bgh0ajhh04i3l7l0hr9cpmwl7vrlcg";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-linux-kernel-build=${kernelBuildDir}"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2018-06-29 23:34:35 +01:00
|
|
|
"--with-gssapi"
|
2018-01-23 18:48:53 +00:00
|
|
|
"--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";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.openafs.org";
|
2018-01-23 18:48:53 +00:00
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
2019-10-07 15:44:58 +01:00
|
|
|
maintainers = [ maintainers.maggesi maintainers.spacefrogg ];
|
2018-10-16 15:44:02 +01:00
|
|
|
broken = versionOlder kernel.version "3.18";
|
2018-01-23 18:48:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|