bscpkgs/pkgs/rdma-core/default.nix

59 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, docutils
2020-11-11 14:45:02 +01:00
, pandoc, ethtool, iproute, libnl, udev, python, perl
, makeWrapper
} :
let
version = "31.1";
in stdenv.mkDerivation {
pname = "rdma-core";
inherit version;
src = fetchFromGitHub {
owner = "linux-rdma";
repo = "rdma-core";
rev = "v${version}";
sha256 = "1xkmdix6mgv6kjjj6wi844bfddhl0ybalrp5g8pf5izasc43brg7";
};
nativeBuildInputs = [ cmake pkg-config pandoc docutils makeWrapper ];
2020-11-11 14:45:02 +01:00
buildInputs = [ libnl ethtool iproute udev python perl ];
cmakeFlags = [
"-DCMAKE_INSTALL_RUNDIR=/run"
"-DCMAKE_INSTALL_SHAREDSTATEDIR=/var/lib"
];
postPatch = ''
substituteInPlace srp_daemon/srp_daemon.sh.in \
--replace /bin/rm rm
'';
postInstall = ''
# cmake script is buggy, move file manually
mkdir -p $out/${perl.libPrefix}
mv $out/share/perl5/* $out/${perl.libPrefix}
'';
postFixup = ''
for pls in $out/bin/{ibfindnodesusing.pl,ibidsverify.pl}; do
echo "wrapping $pls"
chmod +x "$pls"
wrapProgram $pls --prefix PERL5LIB : "$out/${perl.libPrefix}"
done
2020-11-11 17:06:03 +01:00
# Remove the binaries as they pull systemd
2020-11-11 14:45:02 +01:00
rm -rf $out/bin
rm -rf $out/sbin
'';
2022-09-01 16:27:29 +02:00
meta = with lib; {
2020-11-11 14:45:02 +01:00
description = "RDMA Core Userspace Libraries and Daemons";
homepage = "https://github.com/linux-rdma/rdma-core";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ markuskowa ];
};
}