nixpkgs/pkgs/os-specific/linux/aufs/3.nix
Eelco Dolstra d8e722985b Add config option ‘allowUnfree’
If set to false, mkDerivation will throw an exception if a package has
an unfree license.  ‘release-lib.nix’ uses this to enforce that we
don't build unfree packages as part of the Nixpkgs channel.  Since
this is set through Nixpkgs' ‘config’ argument, it's more finegrained
than $HYDRA_DISALLOW_UNFREE.
2013-01-17 23:41:37 +01:00

45 lines
1.2 KiB
Nix

{ stdenv, kernel, perl }:
let
aufsPredicate = x:
if x ? features then
(if x.features ? aufs3 then x.features.aufs3 else false)
else false;
featureAbort = abort "This kernel does not have aufs 3 support";
patch = stdenv.lib.findFirst aufsPredicate featureAbort kernel.kernelPatches;
in
stdenv.mkDerivation {
name = "aufs3-${patch.version}-${kernel.version}";
src = patch.patch.src;
buildInputs = [ perl ];
makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build";
NIX_CFLAGS_COMPILE="-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
installPhase =
''
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
cp -v aufs.ko $out/lib/modules/${kernel.modDirVersion}/misc
# Install the headers because aufs3-util requires them.
mkdir -p $out/include/linux
cp -v usr/include/linux/aufs_type.h $out/include/linux
'';
passthru = { inherit patch; };
meta = {
description = "Another Unionfs implementation for Linux (third generation)";
homepage = http://aufs.sourceforge.net/;
maintainers = [ stdenv.lib.maintainers.eelco
stdenv.lib.maintainers.raskin ];
platforms = stdenv.lib.platforms.linux;
};
}