questdb: use finalAttrs pattern

This commit is contained in:
Pol Dellaiera 2023-08-06 19:40:54 +02:00
parent 8946d2e0b5
commit 63cef72d95
No known key found for this signature in database
GPG key ID: D476DFE9C67467CA

View file

@ -1,18 +1,23 @@
{ fetchurl, jdk17_headless, lib, makeWrapper, stdenv }: {
fetchurl,
jdk17_headless,
lib,
makeBinaryWrapper,
stdenv
}:
let stdenv.mkDerivation (finalAttrs: {
jre = jdk17_headless;
in
stdenv.mkDerivation rec {
pname = "questdb"; pname = "questdb";
version = "7.3"; version = "7.3";
src = fetchurl { src = fetchurl {
url = "https://github.com/questdb/questdb/releases/download/${version}/questdb-${version}-no-jre-bin.tar.gz"; url = "https://github.com/questdb/questdb/releases/download/${finalAttrs.version}/questdb-${finalAttrs.version}-no-jre-bin.tar.gz";
sha256 = "sha256-teZ9oJ5aUPs0aTUxyK9UmpFRclHZVLEVl0jlWbrbiBs="; hash = "sha256-teZ9oJ5aUPs0aTUxyK9UmpFRclHZVLEVl0jlWbrbiBs=";
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [
makeBinaryWrapper
];
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -22,16 +27,16 @@ stdenv.mkDerivation rec {
cp questdb.jar $out/share/java cp questdb.jar $out/share/java
ln -s $out/share/java/questdb.jar $out/bin ln -s $out/share/java/questdb.jar $out/bin
wrapProgram $out/bin/questdb.sh --set JAVA_HOME "${jre}" wrapProgram $out/bin/questdb.sh --set JAVA_HOME "${jdk17_headless}"
runHook postInstall runHook postInstall
''; '';
meta = with lib; { meta = {
description = "high-performance, open-source SQL database for applications in financial services, IoT, machine learning, DevOps and observability"; description = "high-performance, open-source SQL database for applications in financial services, IoT, machine learning, DevOps and observability";
homepage = "https://questdb.io/"; homepage = "https://questdb.io/";
license = licenses.asl20; license = lib.licenses.asl20;
maintainers = [ maintainers.jacfal ]; maintainers = [ lib.maintainers.jacfal ];
platforms = platforms.linux; platforms = lib.platforms.linux;
}; };
} })