2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchgit
|
liburing: bump to 0.1 tag + some extra patches
Normally changing the version of the tag in this manner would be nasty
for users -- `nix-env -u` would not see this as an upgrade on the
channel, for instance, if you had a previous version installed. But
liburing is a *library* and does not really come included with any
useful end-user tools. Most cases will use it directly as a build
dependency, in which case, an appropriate rebuild will happen anyway.
This also re-introduces AArch64 builds, which was previously broken due
to some internal changes requiring memory barrier support. In a twist of
fate, however, this was later broken by another patch, which was written
to fix a *different* regression for users. So we simply apply both of
these patches, as well as a third patch that re-fixes AArch64 support,
which I will submit upstream to Jens. Life is never easy.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2019-08-20 14:15:08 +01:00
|
|
|
, fetchpatch
|
2019-04-22 16:42:23 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "liburing";
|
2021-03-10 14:59:39 +00:00
|
|
|
version = "2.0";
|
2019-04-22 16:42:23 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
2019-10-28 18:00:54 +00:00
|
|
|
url = "http://git.kernel.dk/${pname}";
|
2020-07-10 22:53:28 +01:00
|
|
|
rev = "liburing-${version}";
|
2021-03-10 14:59:39 +00:00
|
|
|
sha256 = "0has1yd1ns5q5jgcmhrbgwhbwq0wix3p7xv3dyrwdf784p56izkn";
|
2019-04-22 16:42:23 +01:00
|
|
|
};
|
|
|
|
|
2021-04-23 21:07:46 +01:00
|
|
|
patches = [
|
|
|
|
# Fix build on 32-bit ARM
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/axboe/liburing/commit/808b6c72ab753bda0c300b5683cfd31750d1d49b.patch";
|
|
|
|
sha256 = "1x7a9c5a6rwhfsbjqmhbnwh2aiin6yylckrqdjbzljrprzf11wrd";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-05-29 20:21:43 +01:00
|
|
|
separateDebugInfo = true;
|
2019-04-22 16:42:23 +01:00
|
|
|
enableParallelBuilding = true;
|
2020-09-27 10:35:07 +01:00
|
|
|
# Upstream's configure script is not autoconf generated, but a hand written one.
|
|
|
|
setOutputFlags = false;
|
|
|
|
preConfigure =
|
|
|
|
# We cannot use configureFlags or configureFlagsArray directly, since we
|
|
|
|
# don't have structuredAttrs yet and using placeholder causes permissions
|
|
|
|
# denied errors. Using $dev / $man in configureFlags causes bash evaluation
|
|
|
|
# errors
|
|
|
|
''
|
|
|
|
configureFlagsArray+=(
|
|
|
|
"--includedir=$dev/include"
|
|
|
|
"--mandir=$man/share/man"
|
|
|
|
)
|
2019-05-29 03:42:40 +01:00
|
|
|
'';
|
2019-04-22 16:42:23 +01:00
|
|
|
|
2020-10-27 00:33:43 +00:00
|
|
|
# Doesn't recognize platform flags
|
|
|
|
configurePlatforms = [];
|
|
|
|
|
2020-09-27 10:35:07 +01:00
|
|
|
outputs = [ "out" "bin" "dev" "man" ];
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
# Copy the examples into $bin. Most reverse dependency of this package should
|
|
|
|
# reference only the $out output
|
|
|
|
''
|
|
|
|
mkdir -p $bin/bin
|
|
|
|
cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
|
|
|
|
cp ./examples/link-cp $bin/bin/io_uring-link-cp
|
|
|
|
cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
|
|
|
|
''
|
|
|
|
;
|
2019-04-22 16:42:23 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-04-22 16:42:23 +01:00
|
|
|
description = "Userspace library for the Linux io_uring API";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://git.kernel.dk/cgit/liburing/";
|
2019-04-22 16:42:23 +01:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|