nixpkgs/pkgs/by-name/ip/ipvsadm/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

42 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl, pkg-config, libnl, popt, gnugrep }:
stdenv.mkDerivation rec {
pname = "ipvsadm";
version = "1.31";
src = fetchurl {
url = "mirror://kernel/linux/utils/kernel/ipvsadm/${pname}-${version}.tar.xz";
sha256 = "1nyzpv1hx75k9lh0vfxfhc0p2fpqaqb38xpvs8sn88m1nljmw2hs";
};
postPatch = ''
substituteInPlace Makefile --replace "-lnl" "$(pkg-config --libs libnl-genl-3.0)"
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libnl popt ];
# Disable parallel build, errors:
# *** No rule to make target 'libipvs/libipvs.a', needed by 'ipvsadm'. Stop.
enableParallelBuilding = false;
preBuild = ''
makeFlagsArray+=(
INCLUDE=$(pkg-config --cflags libnl-genl-3.0)
BUILD_ROOT=$out
MANDIR=share/man
)
'';
postInstall = ''
sed -i -e "s|^PATH=.*|PATH=$out/bin:${gnugrep}/bin|" $out/sbin/ipvsadm-{restore,save}
'';
meta = with lib; {
description = "Linux Virtual Server support programs";
homepage = "http://www.linuxvirtualserver.org/software/ipvs.html";
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}