1{ lib, stdenv, fetchgit
2, fetchpatch
3}:
4
5stdenv.mkDerivation rec {
6 pname = "liburing";
7 version = "2.0";
8
9 src = fetchgit {
10 url = "http://git.kernel.dk/${pname}";
11 rev = "liburing-${version}";
12 sha256 = "0has1yd1ns5q5jgcmhrbgwhbwq0wix3p7xv3dyrwdf784p56izkn";
13 };
14
15 patches = [
16 # Fix build on 32-bit ARM
17 (fetchpatch {
18 url = "https://github.com/axboe/liburing/commit/808b6c72ab753bda0c300b5683cfd31750d1d49b.patch";
19 sha256 = "1x7a9c5a6rwhfsbjqmhbnwh2aiin6yylckrqdjbzljrprzf11wrd";
20 })
21 ];
22
23 separateDebugInfo = true;
24 enableParallelBuilding = true;
25 # Upstream's configure script is not autoconf generated, but a hand written one.
26 setOutputFlags = false;
27 preConfigure =
28 # We cannot use configureFlags or configureFlagsArray directly, since we
29 # don't have structuredAttrs yet and using placeholder causes permissions
30 # denied errors. Using $dev / $man in configureFlags causes bash evaluation
31 # errors
32 ''
33 configureFlagsArray+=(
34 "--includedir=$dev/include"
35 "--mandir=$man/share/man"
36 )
37 '';
38
39 # Doesn't recognize platform flags
40 configurePlatforms = [];
41
42 outputs = [ "out" "bin" "dev" "man" ];
43
44 postInstall =
45 # Copy the examples into $bin. Most reverse dependency of this package should
46 # reference only the $out output
47 ''
48 mkdir -p $bin/bin
49 cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
50 cp ./examples/link-cp $bin/bin/io_uring-link-cp
51 cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
52 ''
53 ;
54
55 meta = with lib; {
56 description = "Userspace library for the Linux io_uring API";
57 homepage = "https://git.kernel.dk/cgit/liburing/";
58 license = licenses.lgpl21;
59 platforms = platforms.linux;
60 maintainers = with maintainers; [ thoughtpolice ];
61 };
62}