1 { stdenv, lib, fetchurl, autoreconfHook }:
3 stdenv.mkDerivation rec {
4 pname = "libhugetlbfs";
8 url = "https://github.com/libhugetlbfs/libhugetlbfs/releases/download/${version}/libhugetlbfs-${version}.tar.gz";
9 hash = "sha256-1QHfqRyOrREGlno9OCnyunOMP6wKZcs1jtKrOHDdxe8=";
12 outputs = [ "bin" "dev" "man" "doc" "lib" "out" ];
14 nativeBuildInputs = [ autoreconfHook ];
17 patchShebangs ld.hugetlbfs
20 enableParallelBuilding = true;
22 "BUILDTYPE=NATIVEONLY"
24 "HEADERDIR=$(dev)/include"
25 "LIBDIR32=$(lib)/$(LIB32)"
26 "LIBDIR64=$(lib)/$(LIB64)"
28 "DOCDIR=$(doc)/share/doc/libhugetlbfs"
29 "MANDIR=$(man)/share/man"
30 ] ++ lib.optionals (stdenv.buildPlatform.system != stdenv.hostPlatform.system) [
31 # The ARCH logic defaults to querying `uname`, which will return build platform arch
32 "ARCH=${stdenv.hostPlatform.uname.processor}"
35 # Default target builds tests as well, and the tests want a static
37 buildFlags = [ "libs" "tools" ];
38 installTargets = [ "install" "install-docs" ];
41 homepage = "https://github.com/libhugetlbfs/libhugetlbfs";
42 changelog = "https://github.com/libhugetlbfs/libhugetlbfs/blob/${version}/NEWS";
43 description = "library and utilities for Linux hugepages";
44 maintainers = with maintainers; [ qyliss ];
45 license = licenses.lgpl21Plus;
46 platforms = platforms.linux;
47 badPlatforms = flatten [
48 systems.inspect.platformPatterns.isStatic
49 systems.inspect.patterns.isMusl