base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / li / liburing / package.nix
blob931cbd77b041d2399aff8a5ef982d011fa1cf641
2   lib,
3   stdenv,
4   fetchFromGitHub,
5 }:
7 stdenv.mkDerivation rec {
8   pname = "liburing";
9   version = "2.8";
11   src = fetchFromGitHub {
12     owner = "axboe";
13     repo = "liburing";
14     rev = "refs/tags/liburing-${version}";
15     hash = "sha256-10zmoMDzO41oNRVXE/6FzDGPVRVJTJTARVUmc1b7f+o=";
16   };
18   separateDebugInfo = true;
19   enableParallelBuilding = true;
20   # Upstream's configure script is not autoconf generated, but a hand written one.
21   setOutputFlags = false;
22   dontDisableStatic = true;
23   dontAddStaticConfigureFlags = true;
24   configureFlags = [
25     "--includedir=${placeholder "dev"}/include"
26     "--mandir=${placeholder "man"}/share/man"
27   ];
29   # mysterious link failure
30   hardeningDisable = [ "trivialautovarinit" ];
32   # Doesn't recognize platform flags
33   configurePlatforms = [ ];
35   outputs = [
36     "out"
37     "bin"
38     "dev"
39     "man"
40   ];
42   postInstall = ''
43     # Always builds both static and dynamic libraries, so we need to remove the
44     # libraries that don't match stdenv type.
45     rm $out/lib/liburing*${
46       if stdenv.hostPlatform.isStatic then ".so*" else ".a"
47     }
49     # Copy the examples into $bin. Most reverse dependency of
50     # this package should reference only the $out output
51     for file in $(find ./examples -executable -type f); do
52       install -Dm555 -t "$bin/bin" "$file"
53     done
54   '';
56   meta = with lib; {
57     description = "Userspace library for the Linux io_uring API";
58     homepage = "https://github.com/axboe/liburing";
59     license = licenses.lgpl21;
60     platforms = platforms.linux;
61     maintainers = with maintainers; [
62       thoughtpolice
63       nickcao
64     ];
65   };