nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "liburing";
9 version = "2.6";
10
11 src = fetchFromGitHub {
12 owner = "axboe";
13 repo = "liburing";
14 rev = "refs/tags/liburing-${version}";
15 hash = "sha256-UOhnFT4UKZmPchKxew3vYeKH2oETDVylE1RmJ2hnLq0=";
16 };
17
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 ];
28
29 # mysterious link failure
30 hardeningDisable = [ "trivialautovarinit" ];
31
32 # Doesn't recognize platform flags
33 configurePlatforms = [ ];
34
35 outputs = [
36 "out"
37 "bin"
38 "dev"
39 "man"
40 ];
41
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 }
48
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 '';
55
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 };
66}