nixpkgs/pkgs/by-name/li/liburing/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

67 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "liburing";
version = "2.7";
src = fetchFromGitHub {
owner = "axboe";
repo = "liburing";
rev = "refs/tags/liburing-${version}";
hash = "sha256-WhNlO2opPM7v4LOLWpmzPv31++zmn5Hmb6Su9IQBDH8=";
};
separateDebugInfo = true;
enableParallelBuilding = true;
# Upstream's configure script is not autoconf generated, but a hand written one.
setOutputFlags = false;
dontDisableStatic = true;
dontAddStaticConfigureFlags = true;
configureFlags = [
"--includedir=${placeholder "dev"}/include"
"--mandir=${placeholder "man"}/share/man"
];
# mysterious link failure
hardeningDisable = [ "trivialautovarinit" ];
# Doesn't recognize platform flags
configurePlatforms = [ ];
outputs = [
"out"
"bin"
"dev"
"man"
];
postInstall = ''
# Always builds both static and dynamic libraries, so we need to remove the
# libraries that don't match stdenv type.
rm $out/lib/liburing*${
if stdenv.hostPlatform.isStatic then ".so*" else ".a"
}
# Copy the examples into $bin. Most reverse dependency of
# this package should reference only the $out output
for file in $(find ./examples -executable -type f); do
install -Dm555 -t "$bin/bin" "$file"
done
'';
meta = with lib; {
description = "Userspace library for the Linux io_uring API";
homepage = "https://github.com/axboe/liburing";
license = licenses.lgpl21;
platforms = platforms.linux;
maintainers = with maintainers; [
thoughtpolice
nickcao
];
};
}