From 274c9f6e0bab2cf7955059ee317098d1f6d9b643 Mon Sep 17 00:00:00 2001 From: happysalada Date: Tue, 31 Aug 2021 17:45:44 +0900 Subject: [PATCH] logstash: fix passthru.tests --- pkgs/tools/misc/logstash/7.x.nix | 101 ++++++++++++++++--------------- 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/pkgs/tools/misc/logstash/7.x.nix b/pkgs/tools/misc/logstash/7.x.nix index 83a063c125ef..c0c67b19b10a 100644 --- a/pkgs/tools/misc/logstash/7.x.nix +++ b/pkgs/tools/misc/logstash/7.x.nix @@ -24,54 +24,55 @@ let x86_64-linux = "sha256-jiV2yGPwPgZ5plo3ftImVDLSOsk/XBzFkeeALSObLhU="; x86_64-darwin = "sha256-UYG+GGr23eAc2GgNX/mXaGU0WKMjiQMPpD1wUvAVz0A="; }; + this = stdenv.mkDerivation rec { + version = elk7Version; + pname = "logstash${optionalString (!enableUnfree) "-oss"}"; + + src = fetchurl { + url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz"; + sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); + }; + + dontBuild = true; + dontPatchELF = true; + dontStrip = true; + dontPatchShebangs = true; + + buildInputs = [ + makeWrapper + jre + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out + + patchShebangs $out/bin/logstash + patchShebangs $out/bin/logstash-plugin + + wrapProgram $out/bin/logstash \ + --set JAVA_HOME "${jre}" + + wrapProgram $out/bin/logstash-plugin \ + --set JAVA_HOME "${jre}" + runHook postInstall + ''; + + meta = with lib; { + description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems"; + homepage = "https://www.elastic.co/products/logstash"; + license = if enableUnfree then licenses.elastic else licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ wjlroe offline basvandijk ]; + }; + passthru.tests = + optionalAttrs (!enableUnfree) ( + assert this.drvPath == nixosTests.elk.ELK-7.elkPackages.logstash.drvPath; + { + elk = nixosTests.elk.ELK-7; + } + ); + }; in -stdenv.mkDerivation rec { - version = elk7Version; - pname = "logstash${optionalString (!enableUnfree) "-oss"}"; - - src = fetchurl { - url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz"; - sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); - }; - - dontBuild = true; - dontPatchELF = true; - dontStrip = true; - dontPatchShebangs = true; - - buildInputs = [ - makeWrapper - jre - ]; - - installPhase = '' - runHook preInstall - mkdir -p $out - cp -r {Gemfile*,modules,vendor,lib,bin,config,data,logstash-core,logstash-core-plugin-api} $out - - patchShebangs $out/bin/logstash - patchShebangs $out/bin/logstash-plugin - - wrapProgram $out/bin/logstash \ - --set JAVA_HOME "${jre}" - - wrapProgram $out/bin/logstash-plugin \ - --set JAVA_HOME "${jre}" - runHook postInstall - ''; - - meta = with lib; { - description = "Logstash is a data pipeline that helps you process logs and other event data from a variety of systems"; - homepage = "https://www.elastic.co/products/logstash"; - license = if enableUnfree then licenses.elastic else licenses.asl20; - platforms = platforms.unix; - maintainers = with maintainers; [ wjlroe offline basvandijk ]; - }; - passthru.tests = - optionalAttrs (!enableUnfree) ( - assert this.drvPath == nixosTests.elk.ELK-7.elkPackages.logstash.drvPath; - { - elk = nixosTests.elk.ELK-7; - } - ); -} +this