2015-09-14 19:59:37 +01:00
|
|
|
{ stdenv, fetchurl, fetchgit, which, autoconf, automake, flex, yacc,
|
2017-11-08 20:24:34 +00:00
|
|
|
kernel, glibc, ncurses, perl, kerberos, fetchpatch }:
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-09-14 19:59:37 +01:00
|
|
|
name = "openafs-${version}-${kernel.version}";
|
2017-09-23 22:29:04 +01:00
|
|
|
version = "1.6.21.1";
|
2015-09-14 19:59:37 +01:00
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.openafs.org/dl/openafs/${version}/openafs-${version}-src.tar.bz2";
|
2017-09-23 22:29:04 +01:00
|
|
|
sha256 = "0nisxnfl8nllcfmi7mxj1gngkpxd4jp1wapbkhz07qwqynq9dn5f";
|
2016-03-26 21:53:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf automake flex yacc perl which ];
|
2015-01-01 16:59:27 +00:00
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
buildInputs = [ ncurses ];
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
2016-02-12 02:53:54 +00:00
|
|
|
|
2017-11-08 20:24:34 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2017-11-08 20:46:46 +00:00
|
|
|
name = "fix-stdint-include.patch";
|
|
|
|
url = "http://git.openafs.org/?p=openafs.git;a=patch;h=c193e5cba18273a062d4162118c7055b54f7eb5e";
|
2017-11-08 20:24:34 +00:00
|
|
|
sha256 = "1yc4gygcazwsslf6mzk1ai92as5jbsjv7212jcbb2dw83jydhc09";
|
|
|
|
})
|
2017-11-15 11:33:15 +00:00
|
|
|
# linux 4.14
|
|
|
|
(fetchpatch {
|
|
|
|
name = "test-for-__vfs_write-rather-than-__vfs_read.patch";
|
|
|
|
url = "http://git.openafs.org/?p=openafs.git;a=patch;h=929e77a886fc9853ee292ba1aa52a920c454e94b";
|
|
|
|
sha256 = "0g4jxqzvyrjy2q7mhxc5ikhypj3ljw1wri4lipzm66crsvycp9x5";
|
|
|
|
})
|
|
|
|
# linux 4.14
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-kernel_read-kernel_write-when-__vfs-variants-are-unavailable.patch";
|
|
|
|
url = "http://git.openafs.org/?p=openafs.git;a=patch;h=5ee516b3789d3545f3d78fb3aba2480308359945";
|
|
|
|
sha256 = "1vx55qb120y857mn1l00i58fj9cckschp86ch3g6hqrdc5q5bxv2";
|
|
|
|
})
|
2017-11-08 20:24:34 +00:00
|
|
|
];
|
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
preConfigure = ''
|
2015-01-01 16:59:09 +00:00
|
|
|
ln -s "${kernel.dev}/lib/modules/"*/build $TMP/linux
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
patchShebangs .
|
|
|
|
for i in `grep -l -R '/usr/\(include\|src\)' .`; do
|
|
|
|
echo "Patch /usr/include and /usr/src in $i"
|
|
|
|
substituteInPlace $i \
|
2015-04-26 18:54:51 +01:00
|
|
|
--replace "/usr/include" "${glibc.dev}/include" \
|
2011-10-13 13:37:15 +01:00
|
|
|
--replace "/usr/src" "$TMP"
|
2009-11-10 16:00:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
./regen.sh
|
|
|
|
|
2015-08-30 04:29:55 +01:00
|
|
|
${stdenv.lib.optionalString (kerberos != null)
|
|
|
|
"export KRB5_CONFIG=${kerberos}/bin/krb5-config"}
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
configureFlagsArray=(
|
|
|
|
"--with-linux-kernel-build=$TMP/linux"
|
2015-01-01 08:07:49 +00:00
|
|
|
${stdenv.lib.optionalString (kerberos != null) "--with-krb5"}
|
2011-10-13 13:37:15 +01:00
|
|
|
"--sysconfdir=/etc/static"
|
2015-08-30 04:29:55 +01:00
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
2011-10-13 13:37:15 +01:00
|
|
|
)
|
2009-11-10 16:00:52 +00:00
|
|
|
'';
|
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
meta = with stdenv.lib; {
|
2011-10-13 13:37:15 +01:00
|
|
|
description = "Open AFS client";
|
2016-03-26 21:53:41 +00:00
|
|
|
homepage = https://www.openafs.org;
|
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.z77z ];
|
2017-09-23 22:29:04 +01:00
|
|
|
broken = versionOlder kernel.version "3.18";
|
2009-11-10 16:00:52 +00:00
|
|
|
};
|
|
|
|
}
|