2019-01-09 11:37:20 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, kernel }:
|
2017-02-03 19:44:59 +01:00
|
|
|
|
2017-02-28 16:28:23 +01:00
|
|
|
|
|
|
|
# Upstream build for kernel 4.1 is broken, 3.12 and below seems to be working
|
|
|
|
assert lib.versionAtLeast kernel.version "4.2" || lib.versionOlder kernel.version "4.0";
|
2017-02-28 15:46:57 +01:00
|
|
|
|
2017-02-03 19:44:59 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "exfat-nofuse-${version}-${kernel.version}";
|
2018-04-16 23:05:14 +02:00
|
|
|
version = "2018-04-16";
|
2017-02-03 19:44:59 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dorimanx";
|
|
|
|
repo = "exfat-nofuse";
|
2018-04-16 23:05:14 +02:00
|
|
|
rev = "01c30ad52625a7261e1b0d874553b6ca7af25966";
|
|
|
|
sha256 = "0n1ibamf1yj8iqapc86lfscnky9p07ngsi4f2kpv3d5r2s6mzsh6";
|
2017-02-03 19:44:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2018-01-13 19:44:19 +01:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2017-02-03 19:44:59 +01:00
|
|
|
makeFlags = [
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m644 -b -D exfat.ko $out/lib/modules/${kernel.modDirVersion}/kernel/fs/exfat/exfat.ko
|
|
|
|
'';
|
|
|
|
|
2019-01-09 11:37:20 +01:00
|
|
|
patches = [
|
2019-01-09 15:13:54 +01:00
|
|
|
# fix compile-errors in 4.18 and 4.20
|
|
|
|
# ref: https://github.com/dorimanx/exfat-nofuse/pull/137
|
2019-01-09 11:37:20 +01:00
|
|
|
(fetchpatch {
|
2019-01-09 15:13:54 +01:00
|
|
|
url = https://github.com/dorimanx/exfat-nofuse/compare/01c30ad52625a7261e1b0d874553b6ca7af25966...f93a47e6414d567a1e7f6ab7f34b015b20f9a050.patch ;
|
|
|
|
sha256 = "0w57pi9h6dwjxfgc3zpwy6sr4zw42hn1zj72f7wgfpqrx6d8xkh5";
|
2019-01-09 11:37:20 +01:00
|
|
|
} )
|
|
|
|
];
|
|
|
|
|
2017-02-03 19:44:59 +01:00
|
|
|
meta = {
|
|
|
|
description = "exfat kernel module";
|
|
|
|
homepage = https://github.com/dorimanx/exfat-nofuse;
|
2017-02-28 16:28:23 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ makefu ];
|
|
|
|
platforms = lib.platforms.linux;
|
2017-02-03 19:44:59 +01:00
|
|
|
};
|
|
|
|
}
|