Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libhugetlbfs / default.nix
blob0f7859be9dbb452d4d5fc5aed1dca26cffda5578
1 { stdenv, lib, fetchurl }:
3 stdenv.mkDerivation rec {
4   pname = "libhugetlbfs";
5   version = "2.23";
7   src = fetchurl {
8     url = "https://github.com/libhugetlbfs/libhugetlbfs/releases/download/${version}/libhugetlbfs-${version}.tar.gz";
9     sha256 = "0ya4q001g111d3pqlzrf3yaifadl0ccirx5dndz1pih7x3qp41mp";
10   };
12   patches = [
13     (fetchurl {
14       url = "https://build.opensuse.org/public/source/openSUSE:Factory/libhugetlbfs/glibc-2.34-fix.patch?rev=50";
15       sha256 = "sha256-eRQa6M0ZdHMtwA5nnzDTWYv/x4AnRZhj+MpDiwyCvVM=";
16     })
17   ];
19   outputs = [ "bin" "dev" "man" "doc" "lib" "out" ];
21   postConfigure = ''
22     patchShebangs ld.hugetlbfs
23   '';
25   enableParallelBuilding = true;
26   makeFlags = [
27     "BUILDTYPE=NATIVEONLY"
28     "PREFIX=$(out)"
29     "HEADERDIR=$(dev)/include"
30     "LIBDIR32=$(lib)/$(LIB32)"
31     "LIBDIR64=$(lib)/$(LIB64)"
32     "EXEDIR=$(bin)/bin"
33     "DOCDIR=$(doc)/share/doc/libhugetlbfs"
34     "MANDIR=$(man)/share/man"
35   ] ++ lib.optionals (stdenv.buildPlatform.system != stdenv.hostPlatform.system) [
36     # The ARCH logic defaults to querying `uname`, which will return build platform arch
37     "ARCH=${stdenv.hostPlatform.uname.processor}"
38   ];
40   # Default target builds tests as well, and the tests want a static
41   # libc.
42   buildFlags = [ "libs" "tools" ];
43   installTargets = [ "install" "install-docs" ];
45   meta = with lib; {
46     description = "library and utilities for Linux hugepages";
47     maintainers = with maintainers; [ qyliss ];
48     license = licenses.lgpl21Plus;
49     platforms = platforms.linux;
50     badPlatforms = flatten [
51       systems.inspect.platformPatterns.isStatic
52       systems.inspect.patterns.isMusl
53     ];
54   };