1{ lib, stdenv, fetchgit }:
2
3stdenv.mkDerivation rec {
4 pname = "liburing";
5 version = "2.5";
6
7 src = fetchgit {
8 url = "http://git.kernel.dk/${pname}";
9 rev = "liburing-${version}";
10 sha256 = "sha256-hPyEZ0P1rfos53OCNd2OYFiqmv6TgpWaj5/xPLccCvM=";
11 };
12
13 separateDebugInfo = true;
14 enableParallelBuilding = true;
15 # Upstream's configure script is not autoconf generated, but a hand written one.
16 setOutputFlags = false;
17 configureFlags = [
18 "--includedir=${placeholder "dev"}/include"
19 "--mandir=${placeholder "man"}/share/man"
20 ];
21
22 # Doesn't recognize platform flags
23 configurePlatforms = [];
24
25 outputs = [ "out" "bin" "dev" "man" ];
26
27 postInstall = ''
28 # Copy the examples into $bin. Most reverse dependency of this package should
29 # reference only the $out output
30 mkdir -p $bin/bin
31 cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
32 cp ./examples/link-cp $bin/bin/io_uring-link-cp
33 '' + lib.optionalString stdenv.hostPlatform.isGnu ''
34 cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
35 '';
36
37 meta = with lib; {
38 description = "Userspace library for the Linux io_uring API";
39 homepage = "https://git.kernel.dk/cgit/liburing/";
40 license = licenses.lgpl21;
41 platforms = platforms.linux;
42 maintainers = with maintainers; [ thoughtpolice nickcao ];
43 };
44}