rocksdb: use finalAttrs

This commit is contained in:
Pavol Rusnak 2023-11-25 12:10:50 +01:00
parent bcc0da2607
commit 1095d8934b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -16,14 +16,14 @@
, sse42Support ? stdenv.hostPlatform.sse4_2Support , sse42Support ? stdenv.hostPlatform.sse4_2Support
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "rocksdb"; pname = "rocksdb";
version = "8.3.2"; version = "8.3.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "facebook"; owner = "facebook";
repo = pname; repo = finalAttrs.pname;
rev = "v${version}"; rev = "v${finalAttrs.version}";
hash = "sha256-mfIRQ8nkUbZ3Bugy3NAvOhcfzFY84J2kBUIUBcQ2/Qg="; hash = "sha256-mfIRQ8nkUbZ3Bugy3NAvOhcfzFY84J2kBUIUBcQ2/Qg=";
}; };
@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
mkdir -p $tools/bin mkdir -p $tools/bin
cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/ cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/
'' + lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.${lib.versions.major version}.dylib" $out/lib/librocksdb.dylib {} ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.${lib.versions.major finalAttrs.version}.dylib" $out/lib/librocksdb.dylib {}
'' + lib.optionalString (stdenv.isLinux && enableShared) '' '' + lib.optionalString (stdenv.isLinux && enableShared) ''
ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib {} ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib {}
''; '';
@ -93,9 +93,9 @@ stdenv.mkDerivation rec {
meta = with lib; { meta = with lib; {
homepage = "https://rocksdb.org"; homepage = "https://rocksdb.org";
description = "A library that provides an embeddable, persistent key-value store for fast storage"; description = "A library that provides an embeddable, persistent key-value store for fast storage";
changelog = "https://github.com/facebook/rocksdb/raw/v${version}/HISTORY.md"; changelog = "https://github.com/facebook/rocksdb/raw/v${finalAttrs.version}/HISTORY.md";
license = licenses.asl20; license = licenses.asl20;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ adev magenbluten ]; maintainers = with maintainers; [ adev magenbluten ];
}; };
} })