nixpkgs/pkgs/servers/search/opensearch/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.5 KiB
Nix
Raw Normal View History

2023-02-14 17:15:30 +00:00
{ lib
2023-02-28 20:47:34 +00:00
, stdenv
2023-02-14 17:15:30 +00:00
, stdenvNoCC
, fetchurl
, makeWrapper
, jre_headless
, gnugrep
, coreutils
, autoPatchelfHook
, zlib
2023-02-14 17:16:11 +00:00
, nixosTests
2023-02-14 17:15:30 +00:00
}:
stdenvNoCC.mkDerivation rec {
pname = "opensearch";
2023-06-14 08:09:38 +00:00
version = "2.8.0";
2023-02-14 17:15:30 +00:00
src = fetchurl {
url = "https://artifacts.opensearch.org/releases/bundle/opensearch/${version}/opensearch-${version}-linux-x64.tar.gz";
2023-06-14 08:09:38 +00:00
hash = "sha256-64vWis+YQfjOw8eaYi1nggq/Q2ErqqcEuISXPGROypc=";
2023-02-14 17:15:30 +00:00
};
nativeBuildInputs = [ makeWrapper ];
2023-06-14 08:09:38 +00:00
buildInputs = [ jre_headless ];
2023-02-14 17:15:30 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R bin config lib modules plugins $out
substituteInPlace $out/bin/opensearch \
--replace 'bin/opensearch-keystore' "$out/bin/opensearch-keystore"
wrapProgram $out/bin/opensearch \
2023-06-14 08:09:38 +00:00
--prefix PATH : "${lib.makeBinPath [ gnugrep coreutils ]}" \
2023-02-28 20:47:34 +00:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$out/plugins/opensearch-knn/lib/" \
2023-02-14 17:15:30 +00:00
--set JAVA_HOME "${jre_headless}"
wrapProgram $out/bin/opensearch-plugin --set JAVA_HOME "${jre_headless}"
2023-06-14 08:09:38 +00:00
wrapProgram $out/bin/opensearch-cli --set JAVA_HOME "${jre_headless}"
2023-02-14 17:15:30 +00:00
runHook postInstall
'';
passthru.tests = nixosTests.opensearch;
2023-02-14 17:16:11 +00:00
2023-02-14 17:15:30 +00:00
meta = {
description = "Open Source, Distributed, RESTful Search Engine";
homepage = "https://github.com/opensearch-project/OpenSearch";
2023-05-05 13:06:37 +00:00
sourceProvenance = with lib.sourceTypes; [
binaryBytecode
binaryNativeCode
];
2023-02-14 17:15:30 +00:00
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ shyim ];
};
}