2021-03-14 17:50:12 +00:00
|
|
|
{ lib, stdenv, fetchurl, which, autoconf, automake, flex, bison
|
2021-08-02 09:00:56 +01:00
|
|
|
, kernel, glibc, perl, libtool_2, libkrb5 }:
|
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;
|
|
|
|
|
2021-03-14 17:50:12 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake flex libtool_2 perl which bison ]
|
2018-06-29 23:34:35 +01:00
|
|
|
++ kernel.moduleBuildDependencies;
|
|
|
|
|
2021-03-14 16:11:48 +00:00
|
|
|
buildInputs = [ libkrb5 ];
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-01-23 18:48:53 +00:00
|
|
|
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;
|
2021-08-02 09:00:56 +01:00
|
|
|
maintainers = with maintainers; [ maggesi spacefrogg ];
|
2020-11-17 20:00:40 +00:00
|
|
|
broken = versionOlder kernel.version "3.18" || kernel.isHardened;
|
2018-01-23 18:48:53 +00:00
|
|
|
};
|
|
|
|
}
|