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

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

63 lines
1.6 KiB
Nix
Raw Normal View History

2023-08-15 17:10:20 +00:00
{ coreutils
2023-02-14 17:15:30 +00:00
, fetchurl
, gnugrep
2023-08-15 17:10:20 +00:00
, jre_headless
, lib
, makeBinaryWrapper
2023-02-14 17:16:11 +00:00
, nixosTests
2023-08-15 17:10:20 +00:00
, stdenv
, stdenvNoCC
2023-02-14 17:15:30 +00:00
}:
2023-08-15 17:08:03 +00:00
stdenvNoCC.mkDerivation (finalAttrs: {
2023-02-14 17:15:30 +00:00
pname = "opensearch";
2023-08-15 04:17:40 +00:00
version = "2.9.0";
2023-02-14 17:15:30 +00:00
src = fetchurl {
2023-08-15 17:08:03 +00:00
url = "https://artifacts.opensearch.org/releases/bundle/opensearch/${finalAttrs.version}/opensearch-${finalAttrs.version}-linux-x64.tar.gz";
2023-08-15 04:17:40 +00:00
hash = "sha256-A9YjwtmacQDC8PrdyP/ai6J+roqmP/bz99rSM3votow=";
2023-02-14 17:15:30 +00:00
};
2023-08-15 17:10:20 +00:00
nativeBuildInputs = [
makeBinaryWrapper
];
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-08-15 17:10:20 +00:00
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ shyim ];
platforms = lib.platforms.unix;
2023-05-05 13:06:37 +00:00
sourceProvenance = with lib.sourceTypes; [
binaryBytecode
binaryNativeCode
];
2023-02-14 17:15:30 +00:00
};
2023-08-15 17:08:03 +00:00
})