nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchgit
2, fetchpatch
3}:
4
5stdenv.mkDerivation rec {
6 pname = "liburing";
7 version = "2.1"; # remove patch when updating
8
9 src = fetchgit {
10 url = "http://git.kernel.dk/${pname}";
11 rev = "liburing-${version}";
12 sha256 = "sha256-7wSpKqjIdQeOdsQu4xN3kFHV49n6qQ3xVbjUcY1tmas=";
13 };
14
15 separateDebugInfo = true;
16 enableParallelBuilding = true;
17 # Upstream's configure script is not autoconf generated, but a hand written one.
18 setOutputFlags = false;
19 preConfigure =
20 # We cannot use configureFlags or configureFlagsArray directly, since we
21 # don't have structuredAttrs yet and using placeholder causes permissions
22 # denied errors. Using $dev / $man in configureFlags causes bash evaluation
23 # errors
24 ''
25 configureFlagsArray+=(
26 "--includedir=$dev/include"
27 "--mandir=$man/share/man"
28 )
29 '';
30
31 # Doesn't recognize platform flags
32 configurePlatforms = [];
33
34 outputs = [ "out" "bin" "dev" "man" ];
35
36 postInstall = ''
37 # Copy the examples into $bin. Most reverse dependency of this package should
38 # reference only the $out output
39 mkdir -p $bin/bin
40 cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
41 cp ./examples/link-cp $bin/bin/io_uring-link-cp
42 '' + lib.optionalString stdenv.hostPlatform.isGnu ''
43 cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
44 '';
45
46 # fix for compilation on 32-bit ARM, merged by upstream but not released; remove when
47 # upstream releases an update
48 patches = lib.optional stdenv.isAarch32 [
49 (fetchpatch {
50 url = "https://github.com/axboe/liburing/commit/e75a6cfa085fc9b5dbf5140fc1efb5a07b6b829e.diff";
51 sha256 = "sha256-qQEQXYm5mkws2klLxwuuoPSPRkpP1s6tuylAAEp7+9E=";
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}