2022-03-10 19:12:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchurl
|
|
|
|
, rpmextract
|
|
|
|
, patchelf
|
|
|
|
, makeWrapper
|
|
|
|
, openssl
|
2023-05-24 13:37:59 +00:00
|
|
|
, libxcrypt-legacy
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "snowsql";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.2.26";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-05-24 13:37:59 +00:00
|
|
|
url = "https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/${lib.versions.majorMinor version}/linux_x86_64/snowflake-snowsql-${version}-1.x86_64.rpm";
|
|
|
|
sha256 = "sha256-V0TZebmhc463DczQuTDy0nZQX+io61z/m32/n/EKFJY=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ rpmextract makeWrapper ];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
libPath = lib.makeLibraryPath [ openssl libxcrypt-legacy ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin/
|
|
|
|
cd $out
|
|
|
|
rpmextract $src
|
|
|
|
rm -R usr/bin
|
|
|
|
mv usr/* $out
|
|
|
|
rmdir usr
|
|
|
|
|
|
|
|
${patchelf}/bin/patchelf \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
lib64/snowflake/snowsql/snowsql
|
|
|
|
|
|
|
|
makeWrapper $out/lib64/snowflake/snowsql/snowsql $out/bin/snowsql \
|
|
|
|
--set LD_LIBRARY_PATH "${libPath}":"${placeholder "out"}"/lib64/snowflake/snowsql \
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Command line client for the Snowflake database";
|
|
|
|
homepage = "https://www.snowflake.com";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ andehen ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|