pari: 2.15.5 -> 2.17.1 (#348442)
[NixPkgs.git] / pkgs / by-name / sn / snowsql / package.nix
blobac72739b7cd6052403fcd426e519550af365b40f
2   lib,
3   stdenv,
4   fetchurl,
5   rpmextract,
6   patchelf,
7   makeWrapper,
8   openssl,
9   libxcrypt-legacy,
12 stdenv.mkDerivation rec {
13   pname = "snowsql";
14   version = "1.3.0";
16   src = fetchurl {
17     url = "https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/${lib.versions.majorMinor version}/linux_x86_64/snowflake-snowsql-${version}-1.x86_64.rpm";
18     sha256 = "sha256-KKCCj+pIwWhuzOuxljQ8Y11mAwD/GONspbXuPAMBdhE=";
19   };
21   nativeBuildInputs = [
22     rpmextract
23     makeWrapper
24   ];
26   libPath = lib.makeLibraryPath [
27     openssl
28     libxcrypt-legacy
29   ];
31   buildCommand = ''
32     mkdir -p $out/bin/
33     cd $out
34     rpmextract $src
35     rm -R usr/bin
36     mv usr/* $out
37     rmdir usr
39     ${patchelf}/bin/patchelf \
40       --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
41         lib64/snowflake/snowsql/snowsql
43     makeWrapper $out/lib64/snowflake/snowsql/snowsql $out/bin/snowsql \
44       --set LD_LIBRARY_PATH "${libPath}":"${placeholder "out"}"/lib64/snowflake/snowsql \
45   '';
47   meta = with lib; {
48     description = "Command line client for the Snowflake database";
49     homepage = "https://www.snowflake.com";
50     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
51     license = licenses.unfree;
52     maintainers = with maintainers; [ andehen ];
53     platforms = [ "x86_64-linux" ];
54     mainProgram = "snowsql";
55   };