commit
28a3306bd7
@ -0,0 +1,64 @@ |
||||
{ lib |
||||
, buildPythonApplication |
||||
, fetchFromGitHub |
||||
, fetchpatch |
||||
, poetry-core |
||||
, pandas |
||||
, prompt-toolkit |
||||
, databricks-sql-connector |
||||
, pygments |
||||
, configobj |
||||
, sqlparse |
||||
, cli-helpers |
||||
, click |
||||
, pytestCheckHook |
||||
}: |
||||
|
||||
buildPythonApplication rec { |
||||
pname = "databricks-sql-cli"; |
||||
version = "0.1.4"; |
||||
format = "pyproject"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "databricks"; |
||||
repo = "databricks-sql-cli"; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-gr7LJfnvIu2Jf1XgILqfZoi8CbXeQyq0g1wLEBa5TPM="; |
||||
}; |
||||
|
||||
patches = [ |
||||
# https://github.com/databricks/databricks-sql-cli/pull/38 |
||||
(fetchpatch { |
||||
url = "https://github.com/databricks/databricks-sql-cli/commit/fc294e00819b6966f1605e5c1ce654473510aefe.patch"; |
||||
sha256 = "sha256-QVrb7mD0fVbHrbrDywI6tsFNYM19x74LY8rhqqC8szE="; |
||||
}) |
||||
]; |
||||
|
||||
postPatch = '' |
||||
substituteInPlace pyproject.toml \ |
||||
--replace 'python = ">=3.7.1,<4.0"' 'python = ">=3.8,<4.0"' \ |
||||
--replace 'pandas = "1.3.4"' 'pandas = "~1.4"' |
||||
''; |
||||
|
||||
nativeBuildInputs = [ poetry-core ]; |
||||
|
||||
propagatedBuildInputs = [ |
||||
prompt-toolkit |
||||
pandas |
||||
databricks-sql-connector |
||||
pygments |
||||
configobj |
||||
sqlparse |
||||
cli-helpers |
||||
click |
||||
]; |
||||
|
||||
checkInputs = [ pytestCheckHook ]; |
||||
|
||||
meta = with lib; { |
||||
description = "CLI for querying Databricks SQL"; |
||||
homepage = "https://github.com/databricks/databricks-sql-cli"; |
||||
license = licenses.databricks; |
||||
maintainers = with maintainers; [ kfollesdal ]; |
||||
}; |
||||
} |
@ -1,52 +0,0 @@ |
||||
{ stdenv, lib, fetchFromGitHub, pkg-config, automake, autoconf |
||||
, zlib, boost, openssl, libtool, python, libiconv, ncurses |
||||
}: |
||||
|
||||
let |
||||
version = "1.1.11"; |
||||
formattedVersion = lib.replaceChars ["."] ["_"] version; |
||||
|
||||
# Make sure we override python, so the correct version is chosen |
||||
# for the bindings, if overridden |
||||
boostPython = boost.override { enablePython = true; inherit python; }; |
||||
|
||||
in stdenv.mkDerivation { |
||||
pname = "libtorrent-rasterbar"; |
||||
inherit version; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "arvidn"; |
||||
repo = "libtorrent"; |
||||
rev = "libtorrent_${formattedVersion}"; |
||||
sha256 = "0nwdsv6d2gkdsh7l5a46g6cqx27xwh3msify5paf02l1qzjy4s5l"; |
||||
}; |
||||
|
||||
enableParallelBuilding = true; |
||||
nativeBuildInputs = [ automake autoconf libtool pkg-config ]; |
||||
buildInputs = [ boostPython openssl zlib python libiconv ncurses ]; |
||||
preConfigure = "./autotool.sh"; |
||||
|
||||
postInstall = '' |
||||
moveToOutput "include" "$dev" |
||||
moveToOutput "lib/${python.libPrefix}" "$python" |
||||
''; |
||||
|
||||
outputs = [ "out" "dev" "python" ]; |
||||
|
||||
configureFlags = [ |
||||
"--enable-python-binding" |
||||
"--with-libiconv=yes" |
||||
"--with-boost=${boostPython.dev}" |
||||
"--with-boost-libdir=${boostPython.out}/lib" |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
# darwin: never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/libtorrent-rasterbar-1_1_x.x86_64-darwin |
||||
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin; |
||||
homepage = "https://libtorrent.org/"; |
||||
description = "A C++ BitTorrent implementation focusing on efficiency and scalability"; |
||||
license = licenses.bsd3; |
||||
maintainers = [ ]; |
||||
platforms = platforms.unix; |
||||
}; |
||||
} |
@ -0,0 +1,50 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchFromGitHub |
||||
, thrift |
||||
, pandas |
||||
, pyarrow |
||||
, poetry-core |
||||
, pytestCheckHook |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "databricks-sql-connector"; |
||||
version = "2.0.5"; |
||||
format = "pyproject"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "databricks"; |
||||
repo = "databricks-sql-python"; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-Qpdyn6z1mbO4bzyUZ2eYdd9pfIkIP/Aj4YgNXaYwxpE="; |
||||
}; |
||||
|
||||
postPatch = '' |
||||
substituteInPlace pyproject.toml \ |
||||
--replace 'thrift = "^0.13.0"' 'thrift = ">=0.13.0,<1.0.0"' |
||||
''; |
||||
|
||||
nativeBuildInputs = [ |
||||
poetry-core |
||||
]; |
||||
|
||||
propagatedBuildInputs = [ |
||||
thrift |
||||
pandas |
||||
pyarrow |
||||
]; |
||||
|
||||
checkInputs = [ |
||||
pytestCheckHook |
||||
]; |
||||
|
||||
pytestFlagsArray = [ "tests/unit" ]; |
||||
|
||||
meta = with lib; { |
||||
description = "Databricks SQL Connector for Python"; |
||||
homepage = https://docs.databricks.com/dev-tools/python-sql-connector.html; |
||||
license = licenses.asl20; |
||||
maintainers = with maintainers; [ harvidsen ]; |
||||
}; |
||||
} |
@ -0,0 +1,27 @@ |
||||
#!/usr/bin/env nix-shell |
||||
#!nix-shell -i bash -p curl wget jq yarn2nix yarn common-updater-scripts |
||||
|
||||
set -eu -o pipefail |
||||
|
||||
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd) |
||||
nixpkgs=$(realpath "$scriptDir"/../../../..) |
||||
|
||||
newest_version="$(curl -s https://www.pgadmin.org/versions.json | jq -r .pgadmin4.version)" |
||||
old_version=$(nix-instantiate --eval -E "(import \"$nixpkgs\" { config = {}; overlays = []; }).pgadmin4.version" | tr -d '"') |
||||
url="https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${newest_version}/source/pgadmin4-${newest_version}.tar.gz" |
||||
|
||||
if [[ $newest_version == $old_version ]]; then |
||||
echo "Already at latest version $newest_version" |
||||
exit 0 |
||||
fi |
||||
echo "New version: $newest_version" |
||||
|
||||
pushd $(mktemp -d --suffix=-pgadmin4-updater) |
||||
wget $url |
||||
tar -xzf "pgadmin4-$newest_version.tar.gz" |
||||
cd "pgadmin4-$newest_version/web" |
||||
yarn2nix > yarn.nix |
||||
cp yarn.nix yarn.lock package.json "$nixpkgs/pkgs/tools/admin/pgadmin/" |
||||
popd |
||||
|
||||
update-source-version pgadmin4 "$newest_version" --print-changes |
Loading…
Reference in new issue