2021-01-21 18:00:13 +01: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 15:15:08 +02:00
|
|
|
, fetchpatch
|
2019-04-22 17:42:23 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "liburing";
|
2022-01-08 00:43:14 +01:00
|
|
|
version = "2.1"; # remove patch when updating
|
2019-04-22 17:42:23 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
2019-10-28 19:00:54 +01:00
|
|
|
url = "http://git.kernel.dk/${pname}";
|
2020-07-10 23:53:28 +02:00
|
|
|
rev = "liburing-${version}";
|
2021-09-09 17:40:40 +02:00
|
|
|
sha256 = "sha256-7wSpKqjIdQeOdsQu4xN3kFHV49n6qQ3xVbjUcY1tmas=";
|
2019-04-22 17:42:23 +02:00
|
|
|
};
|
|
|
|
|
2019-05-29 21:21:43 +02:00
|
|
|
separateDebugInfo = true;
|
2019-04-22 17:42:23 +02:00
|
|
|
enableParallelBuilding = true;
|
2020-09-27 11:35:07 +02: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 04:42:40 +02:00
|
|
|
'';
|
2019-04-22 17:42:23 +02:00
|
|
|
|
2020-10-27 01:33:43 +01:00
|
|
|
# Doesn't recognize platform flags
|
|
|
|
configurePlatforms = [];
|
|
|
|
|
2020-09-27 11:35:07 +02:00
|
|
|
outputs = [ "out" "bin" "dev" "man" ];
|
|
|
|
|
2021-11-18 14:52:57 +01:00
|
|
|
postInstall = ''
|
|
|
|
# Copy the examples into $bin. Most reverse dependency of this package should
|
|
|
|
# reference only the $out output
|
2020-09-27 11:35:07 +02:00
|
|
|
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
|
2021-11-18 14:52:57 +01:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isGnu ''
|
2020-09-27 11:35:07 +02:00
|
|
|
cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
|
2021-11-18 14:52:57 +01:00
|
|
|
'';
|
2019-04-22 17:42:23 +02:00
|
|
|
|
2022-01-08 00:43:14 +01:00
|
|
|
# fix for compilation on 32-bit ARM, merged by upstream but not released; remove when
|
|
|
|
# upstream releases an update
|
|
|
|
patches = lib.optional stdenv.isAarch32 [
|
|
|
|
(fetchpatch {
|
2022-01-11 07:39:47 +01:00
|
|
|
url = "https://github.com/axboe/liburing/commit/e75a6cfa085fc9b5dbf5140fc1efb5a07b6b829e.diff";
|
2022-01-08 00:43:14 +01:00
|
|
|
sha256 = "sha256-qQEQXYm5mkws2klLxwuuoPSPRkpP1s6tuylAAEp7+9E=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2019-04-22 17:42:23 +02:00
|
|
|
description = "Userspace library for the Linux io_uring API";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://git.kernel.dk/cgit/liburing/";
|
2019-04-22 17:42:23 +02:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|