nixpkgs/pkgs/by-name/li/libhugetlbfs/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

53 lines
1.6 KiB
Nix

{ stdenv, lib, fetchurl, autoreconfHook }:
stdenv.mkDerivation rec {
pname = "libhugetlbfs";
version = "2.24";
src = fetchurl {
url = "https://github.com/libhugetlbfs/libhugetlbfs/releases/download/${version}/libhugetlbfs-${version}.tar.gz";
hash = "sha256-1QHfqRyOrREGlno9OCnyunOMP6wKZcs1jtKrOHDdxe8=";
};
outputs = [ "bin" "dev" "man" "doc" "lib" "out" ];
nativeBuildInputs = [ autoreconfHook ];
postConfigure = ''
patchShebangs ld.hugetlbfs
'';
enableParallelBuilding = true;
makeFlags = [
"BUILDTYPE=NATIVEONLY"
"PREFIX=$(out)"
"HEADERDIR=$(dev)/include"
"LIBDIR32=$(lib)/$(LIB32)"
"LIBDIR64=$(lib)/$(LIB64)"
"EXEDIR=$(bin)/bin"
"DOCDIR=$(doc)/share/doc/libhugetlbfs"
"MANDIR=$(man)/share/man"
] ++ lib.optionals (stdenv.buildPlatform.system != stdenv.hostPlatform.system) [
# The ARCH logic defaults to querying `uname`, which will return build platform arch
"ARCH=${stdenv.hostPlatform.uname.processor}"
];
# Default target builds tests as well, and the tests want a static
# libc.
buildFlags = [ "libs" "tools" ];
installTargets = [ "install" "install-docs" ];
meta = with lib; {
homepage = "https://github.com/libhugetlbfs/libhugetlbfs";
changelog = "https://github.com/libhugetlbfs/libhugetlbfs/blob/${version}/NEWS";
description = "library and utilities for Linux hugepages";
maintainers = with maintainers; [ qyliss ];
license = licenses.lgpl21Plus;
platforms = platforms.linux;
badPlatforms = flatten [
systems.inspect.platformPatterns.isStatic
systems.inspect.patterns.isMusl
];
};
}