lz4: use finalAttrs

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-06-09 14:07:44 +02:00
parent ead868553b
commit 59238b728c
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -2,22 +2,24 @@
, valgrind
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "lz4";
version = "1.9.4";
src = fetchFromGitHub {
sha256 = "sha256-YiMCD3vvrG+oxBUghSrCmP2LAfAGZrEaKz0YoaQJhpI=";
rev = "v${version}";
repo = pname;
owner = pname;
repo = "lz4";
owner = "lz4";
rev = "v${finalAttrs.version}";
hash = "sha256-YiMCD3vvrG+oxBUghSrCmP2LAfAGZrEaKz0YoaQJhpI=";
};
nativeBuildInputs = [
cmake
];
buildInputs = lib.optional finalAttrs.doCheck valgrind;
buildInputs = lib.optionals finalAttrs.doCheck [
valgrind
];
# TODO(@Ericson2314): Separate binaries and libraries
outputs = [ "bin" "out" "dev" ];
@ -26,7 +28,7 @@ stdenv.mkDerivation rec {
(fetchpatch { # https://github.com/lz4/lz4/pull/1162
name = "build-shared-no.patch";
url = "https://github.com/lz4/lz4/commit/851ef4b23c7cbf4ceb2ba1099666a8b5ec4fa195.patch";
sha256 = "sha256-P+/uz3m7EAmHgXF/1Vncc0uKKxNVq6HNIsElx0rGxpw=";
hash = "sha256-P+/uz3m7EAmHgXF/1Vncc0uKKxNVq6HNIsElx0rGxpw=";
})
];
@ -49,4 +51,4 @@ stdenv.mkDerivation rec {
license = with licenses; [ bsd2 gpl2Plus ];
platforms = platforms.all;
};
}
})