restinio: fix build (#375955)
[NixPkgs.git] / pkgs / os-specific / linux / drbd / driver.nix
blobc2e81f7864c892fc60a80fc860308badce0c861e
2   stdenv,
3   lib,
4   fetchurl,
5   kernel,
6   kernelModuleMakeFlags,
7   nixosTests,
8   flex,
9   coccinelle,
10   python3,
13 stdenv.mkDerivation (finalAttrs: {
14   pname = "drbd";
15   version = "9.2.12";
17   src = fetchurl {
18     url = "https://pkg.linbit.com//downloads/drbd/9/drbd-${finalAttrs.version}.tar.gz";
19     hash = "sha256-amdcyPTynGTaaZh558Q3KnGuGyyLJKnsY+NBCO26Jq0=";
20   };
22   hardeningDisable = [ "pic" ];
24   nativeBuildInputs = [
25     kernel.moduleBuildDependencies
26     flex
27     coccinelle
28     python3
29   ];
31   enableParallelBuilding = true;
33   makeFlags = kernelModuleMakeFlags ++ [
34     "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
35     "KVER=${kernel.version}"
36     "INSTALL_MOD_PATH=${placeholder "out"}"
37     "M=$(sourceRoot)"
38     "SPAAS=false"
39   ];
41   installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
43   postPatch = ''
44     patchShebangs .
45     substituteInPlace Makefile --replace 'SHELL=/bin/bash' 'SHELL=${builtins.getEnv "SHELL"}'
46   '';
48   passthru.tests.drbd-driver = nixosTests.drbd-driver;
50   meta = with lib; {
51     homepage = "https://github.com/LINBIT/drbd";
52     description = "LINBIT DRBD kernel module";
53     license = licenses.gpl2Plus;
54     platforms = platforms.linux;
55     maintainers = with maintainers; [ birkb ];
56     longDescription = ''
57       DRBD is a software-based, shared-nothing, replicated storage solution
58       mirroring the content of block devices (hard disks, partitions, logical volumes, and so on) between hosts.
59     '';
60   };