2019-04-22 17:42:23 +02:00
|
|
|
{ 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 {
|
|
|
|
name = "liburing-${version}";
|
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
|
|
|
version = "0.1";
|
2019-04-22 17:42:23 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "http://git.kernel.dk/liburing";
|
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
|
|
|
rev = "refs/tags/liburing-${version}";
|
|
|
|
sha256 = "038iqsbm9bdmlwvmb899bc6g1rw5dalr990azynbvgn8qs5adysh";
|
2019-04-22 17:42:23 +02:00
|
|
|
};
|
|
|
|
|
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
|
|
|
patches = [
|
|
|
|
|
|
|
|
# This patch re-introduces support for aarch64-linux, by adding the
|
|
|
|
# necessary memory barrier primitives for it to work.
|
|
|
|
#
|
|
|
|
# Already upstream: remove when moving to the next version
|
|
|
|
(fetchpatch {
|
|
|
|
url = "http://git.kernel.dk/cgit/liburing/patch/?id=0520db454c29f1d96cda6cf6cedeb93df65301e8";
|
|
|
|
sha256 = "1i8133sb1imzxpplmhlhnaxkffgplhj40vanivc6clbibvhgwpq6";
|
|
|
|
})
|
|
|
|
|
|
|
|
# This patch shuffles the name of the io_uring memory barrier primitives.
|
|
|
|
# They were using extremely common names by accident, which caused
|
|
|
|
# namespace conflicts with many other projects using the same names. Note:
|
|
|
|
# this does not change the user-visible API of liburing (liburing is
|
|
|
|
# designed exactly to hide the necessary memory barriers when using the
|
|
|
|
# io_uring syscall directly). It only changes the names of some internals.
|
|
|
|
# The only reason this caused problems at all is because memory barrier
|
|
|
|
# primitives are written as preprocessor defines, in a common header file,
|
|
|
|
# which get included unilaterally.
|
|
|
|
#
|
|
|
|
# Already upstream: remove when moving to the next version
|
|
|
|
(fetchpatch {
|
|
|
|
url = "http://git.kernel.dk/cgit/liburing/patch/?id=552c6a08d04c74d20eeaa86f535bfd553b352370";
|
|
|
|
sha256 = "123d6jdqfy7b8aq9f6ax767n48hhbx6pln3nlrp623595i8zz3wf";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Finally, this patch fixes the aarch64-linux support introduced by the
|
|
|
|
# first patch, but which was _broken_ by the second patch, in a horrid
|
|
|
|
# twist of fate: it neglected to change the names of the aarch64 barriers
|
2019-08-20 16:19:35 +02:00
|
|
|
# appropriately.
|
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
|
|
|
#
|
2019-08-20 16:19:35 +02:00
|
|
|
# Already upstream: remove when moving to the next version
|
|
|
|
(fetchpatch {
|
|
|
|
url = "http://git.kernel.dk/cgit/liburing/patch/?id=6e9dd0c8c50b5988a0c77532c9c2bd6afd4790d2";
|
|
|
|
sha256 = "11mqa1bp2pdfqh08gpcd98kg7lh3rrng41b4l1wvhxdbvg5rfw9c";
|
|
|
|
})
|
|
|
|
|
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
|
|
|
];
|
|
|
|
|
2019-05-29 21:21:43 +02:00
|
|
|
separateDebugInfo = true;
|
2019-04-22 17:42:23 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" "man" ];
|
|
|
|
|
2019-05-29 04:42:40 +02:00
|
|
|
configurePhase = ''
|
|
|
|
./configure \
|
|
|
|
--prefix=$out \
|
|
|
|
--includedir=$dev/include \
|
|
|
|
--libdir=$lib/lib \
|
|
|
|
--mandir=$man/share/man \
|
|
|
|
'';
|
2019-04-22 17:42:23 +02:00
|
|
|
|
liburing: bump, fix version (1.0.0pre92_7b989f3)
I accidentally got the number of commits wrong in the previous
prerelease version string. This is now fixed.
Generally, this would result in functions like builtins.compareVersions
to give incorrect results, so 'nix-env -u' doesn't work. But I'm
justifying it here, because: most people use it as a library, so the
hash change is all that matters. Plus, I only authored this a week or
so ago in upstream, so this change is fast enough that I think people
will be fine with it and can work around, especially since it's
unreleased in any stable channel.
This also bumps the library to the newest version, which contains some
bugfixes, and now installs the manpages into the $man output for us.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2019-05-03 02:29:32 +02:00
|
|
|
# Copy the examples into $out.
|
2019-04-22 17:42:23 +02:00
|
|
|
postInstall = ''
|
liburing: bump, fix version (1.0.0pre92_7b989f3)
I accidentally got the number of commits wrong in the previous
prerelease version string. This is now fixed.
Generally, this would result in functions like builtins.compareVersions
to give incorrect results, so 'nix-env -u' doesn't work. But I'm
justifying it here, because: most people use it as a library, so the
hash change is all that matters. Plus, I only authored this a week or
so ago in upstream, so this change is fast enough that I think people
will be fine with it and can work around, especially since it's
unreleased in any stable channel.
This also bumps the library to the newest version, which contains some
bugfixes, and now installs the manpages into the $man output for us.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2019-05-03 02:29:32 +02:00
|
|
|
mkdir -p $out/bin
|
2019-04-22 17:42:23 +02:00
|
|
|
cp ./examples/io_uring-cp examples/io_uring-test $out/bin
|
2019-05-21 17:35:27 +02:00
|
|
|
cp ./examples/link-cp $out/bin/io_uring-link-cp
|
2019-04-22 17:42:23 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Userspace library for the Linux io_uring API";
|
|
|
|
homepage = http://git.kernel.dk/cgit/liburing/;
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|