2023-08-22 20:05:09 +00:00
|
|
|
{ coreutils
|
2023-02-16 17:41:37 +00:00
|
|
|
, fetchurl
|
|
|
|
, gnugrep
|
2023-08-22 20:05:09 +00:00
|
|
|
, jre_headless
|
|
|
|
, lib
|
|
|
|
, makeBinaryWrapper
|
2023-02-16 17:41:37 +00:00
|
|
|
, nixosTests
|
2023-08-22 20:05:09 +00:00
|
|
|
, stdenv
|
|
|
|
, stdenvNoCC
|
2023-02-16 17:41:37 +00:00
|
|
|
}:
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2023-02-16 17:41:37 +00:00
|
|
|
pname = "opensearch";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.14.0";
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-08-22 20:05:09 +00:00
|
|
|
url = "https://artifacts.opensearch.org/releases/bundle/opensearch/${finalAttrs.version}/opensearch-${finalAttrs.version}-linux-x64.tar.gz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-NHLt23GDdtq1DliMByXN52jnKGZApdngp04MTz7F7HY=";
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeBinaryWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
jre_headless
|
|
|
|
];
|
2023-02-16 17:41:37 +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-07-15 17:15:38 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ gnugrep coreutils ]}" \
|
2023-03-08 16:32:21 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$out/plugins/opensearch-knn/lib/" \
|
2023-02-16 17:41:37 +00:00
|
|
|
--set JAVA_HOME "${jre_headless}"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/opensearch-plugin --set JAVA_HOME "${jre_headless}"
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
rm $out/bin/opensearch-cli
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = nixosTests.opensearch;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Open Source, Distributed, RESTful Search Engine";
|
|
|
|
homepage = "https://github.com/opensearch-project/OpenSearch";
|
2023-08-22 20:05:09 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ shyim ];
|
|
|
|
platforms = lib.platforms.unix;
|
2023-05-24 13:37:59 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
2023-08-22 20:05:09 +00:00
|
|
|
})
|