From 67dcd62bab28d86682a5982f3cbe1383ce873286 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 30 Apr 2024 21:20:22 -0400 Subject: [PATCH 1/3] liburing: format with nixfmt --- .../libraries/liburing/default.nix | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/liburing/default.nix b/pkgs/development/libraries/liburing/default.nix index a42aab3d59e8..8e993761b10a 100644 --- a/pkgs/development/libraries/liburing/default.nix +++ b/pkgs/development/libraries/liburing/default.nix @@ -1,12 +1,16 @@ -{ lib, stdenv, fetchgit }: +{ + lib, + stdenv, + fetchgit, +}: stdenv.mkDerivation rec { pname = "liburing"; version = "2.5"; src = fetchgit { - url = "http://git.kernel.dk/${pname}"; - rev = "liburing-${version}"; + url = "http://git.kernel.dk/${pname}"; + rev = "liburing-${version}"; sha256 = "sha256-hPyEZ0P1rfos53OCNd2OYFiqmv6TgpWaj5/xPLccCvM="; }; @@ -20,25 +24,35 @@ stdenv.mkDerivation rec { ]; # Doesn't recognize platform flags - configurePlatforms = []; + configurePlatforms = [ ]; - outputs = [ "out" "bin" "dev" "man" ]; + 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 - '' + lib.optionalString stdenv.hostPlatform.isGnu '' - cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp - ''; + 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 + '' + + lib.optionalString stdenv.hostPlatform.isGnu '' + cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp + ''; meta = with lib; { description = "Userspace library for the Linux io_uring API"; - homepage = "https://git.kernel.dk/cgit/liburing/"; - license = licenses.lgpl21; - platforms = platforms.linux; - maintainers = with maintainers; [ thoughtpolice nickcao ]; + homepage = "https://git.kernel.dk/cgit/liburing/"; + license = licenses.lgpl21; + platforms = platforms.linux; + maintainers = with maintainers; [ + thoughtpolice + nickcao + ]; }; } From 801bbb1aa29b4e4c7c890c5d0da7b35bfcbcb8ed Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 30 Apr 2024 21:25:31 -0400 Subject: [PATCH 2/3] liburing: 2.5 -> 2.6, fetch source from github --- pkgs/development/libraries/liburing/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/liburing/default.nix b/pkgs/development/libraries/liburing/default.nix index 8e993761b10a..2fd54747f823 100644 --- a/pkgs/development/libraries/liburing/default.nix +++ b/pkgs/development/libraries/liburing/default.nix @@ -1,17 +1,18 @@ { lib, stdenv, - fetchgit, + fetchFromGitHub, }: stdenv.mkDerivation rec { pname = "liburing"; - version = "2.5"; + version = "2.6"; - src = fetchgit { - url = "http://git.kernel.dk/${pname}"; - rev = "liburing-${version}"; - sha256 = "sha256-hPyEZ0P1rfos53OCNd2OYFiqmv6TgpWaj5/xPLccCvM="; + src = fetchFromGitHub { + owner = "axboe"; + repo = "liburing"; + rev = "refs/tags/liburing-${version}"; + hash = "sha256-UOhnFT4UKZmPchKxew3vYeKH2oETDVylE1RmJ2hnLq0="; }; separateDebugInfo = true; @@ -47,7 +48,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Userspace library for the Linux io_uring API"; - homepage = "https://git.kernel.dk/cgit/liburing/"; + homepage = "https://github.com/axboe/liburing"; license = licenses.lgpl21; platforms = platforms.linux; maintainers = with maintainers; [ From 7db1dff736026c8ba2a64aef09161bdbc43d46d2 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 30 Apr 2024 21:53:13 -0400 Subject: [PATCH 3/3] liburing: install all examples --- .../development/libraries/liburing/default.nix | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/liburing/default.nix b/pkgs/development/libraries/liburing/default.nix index 2fd54747f823..151305630b82 100644 --- a/pkgs/development/libraries/liburing/default.nix +++ b/pkgs/development/libraries/liburing/default.nix @@ -34,17 +34,13 @@ stdenv.mkDerivation rec { "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 - '' - + lib.optionalString stdenv.hostPlatform.isGnu '' - cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp - ''; + postInstall = '' + # 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";