2022-10-06 18:32:54 +00:00
|
|
|
{ fetchFromGitHub
|
|
|
|
, json_c
|
2023-04-29 16:46:19 +00:00
|
|
|
, keyutils
|
2022-10-06 18:32:54 +00:00
|
|
|
, lib
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, stdenv
|
2023-04-29 16:46:19 +00:00
|
|
|
, swig
|
2022-10-06 18:32:54 +00:00
|
|
|
, systemd
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchpatch
|
2023-10-09 19:29:22 +00:00
|
|
|
# ImportError: cannot import name 'mlog' from 'mesonbuild'
|
|
|
|
, withDocs ? stdenv.hostPlatform.canExecute stdenv.buildPlatform
|
2022-10-06 18:32:54 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-10-06 18:32:54 +00:00
|
|
|
pname = "libnvme";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.6";
|
2022-10-06 18:32:54 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
outputs = [ "out" ] ++ lib.optionals withDocs [ "man" ];
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-nvme";
|
|
|
|
repo = "libnvme";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-7bvjsmt16/6RycSDKIECtJ4ES7NTaspU6IMpUw0sViA=";
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
# included in next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/linux-nvme/libnvme/commit/ff742e792725c316ba6de0800188bf36751bd1d1.patch";
|
|
|
|
hash = "sha256-IUjPUBmGQC4oAKFFlBrjonqD2YdyNPC9siK4t/t2slE=";
|
|
|
|
})
|
2024-01-02 11:29:13 +00:00
|
|
|
# included in next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/linux-nvme/libnvme/commit/a2b8e52e46cfd888ac5a48d8ce632bd70a5caa93.patch";
|
|
|
|
hash = "sha256-AVSWraFriErfz7dA2CjU8+ehJtAmuLxBZyBALygmrf0=";
|
|
|
|
})
|
|
|
|
# included in next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/linux-nvme/libnvme/commit/68c6ffb11d40a427fc1fd70ac2ac97fd01952913.patch";
|
|
|
|
hash = "sha256-dvc1sjgCFU31/LornvJ/aRVYtPOsewkas0jS+/AwFuU=";
|
|
|
|
})
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postPatch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
patchShebangs scripts
|
2022-10-06 18:32:54 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
perl # for kernel-doc
|
|
|
|
pkg-config
|
2023-11-16 04:20:00 +00:00
|
|
|
python3.pythonOnBuildForHost
|
2023-04-29 16:46:19 +00:00
|
|
|
swig
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-04-29 16:46:19 +00:00
|
|
|
keyutils
|
2022-10-06 18:32:54 +00:00
|
|
|
json_c
|
|
|
|
openssl
|
|
|
|
systemd
|
2023-04-29 16:46:19 +00:00
|
|
|
python3
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=man"
|
2024-01-02 11:29:13 +00:00
|
|
|
(lib.mesonBool "tests" finalAttrs.finalPackage.doCheck)
|
2023-10-09 19:29:22 +00:00
|
|
|
(lib.mesonBool "docs-build" withDocs)
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export KBUILD_BUILD_TIMESTAMP="$(date -u -d @$SOURCE_DATE_EPOCH)"
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# mocked ioctl conflicts with the musl one: https://github.com/NixOS/nixpkgs/pull/263768#issuecomment-1782877974
|
|
|
|
doCheck = !stdenv.hostPlatform.isMusl;
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C Library for NVM Express on Linux";
|
|
|
|
homepage = "https://github.com/linux-nvme/libnvme";
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ fogti vifino ];
|
2022-10-06 18:32:54 +00:00
|
|
|
license = with licenses; [ lgpl21Plus ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
})
|