diff options
author | Florian Brandes <florian.brandes@posteo.de> | 2022-08-27 23:37:28 +0200 |
---|---|---|
committer | Florian Brandes <florian.brandes@posteo.de> | 2022-09-22 17:42:20 +0200 |
commit | 73f09f2145b4d57380ab6313a3b6e1dfb3f33af8 (patch) | |
tree | 49af8b33e3e0643407bf96e7a0b6f57496cabdbe /pkgs/tools/admin/pgadmin | |
parent | b687749d7dedcacfc9bc220afa9c3cb0a6a2046f (diff) |
pgadmin4: 6.12 -> 6.13
- Add update script - Add email options to pgadmin4 nixOS module - Add override for flask 2.2 Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
Diffstat (limited to 'pkgs/tools/admin/pgadmin')
-rw-r--r-- | pkgs/tools/admin/pgadmin/default.nix | 19 | ||||
-rwxr-xr-x | pkgs/tools/admin/pgadmin/update.sh | 27 |
2 files changed, 38 insertions, 8 deletions
diff --git a/pkgs/tools/admin/pgadmin/default.nix b/pkgs/tools/admin/pgadmin/default.nix index dadd798249277..8dfcf078dbc98 100644 --- a/pkgs/tools/admin/pgadmin/default.nix +++ b/pkgs/tools/admin/pgadmin/default.nix @@ -10,11 +10,11 @@ let pname = "pgadmin"; - version = "6.12"; + version = "6.13"; src = fetchurl { url = "https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${version}/source/pgadmin4-${version}.tar.gz"; - sha256 = "sha256-cO7GdZDfJ0pq1jpMyrVy0UM49WhrKOIJOmMJauSkbyo="; + sha256 = "sha256-vLItmE76R1IzgMYEGEvIeOmbfQQac5WK12AkkZknTFU="; }; yarnDeps = mkYarnModules { @@ -72,13 +72,16 @@ let azure-identity ]; - # override necessary on pgadmin4 6.12 + # keep the scope, as it is used throughout the derivation and tests + # this also makes potential future overrides easier pythonPackages = python3.pkgs.overrideScope (final: prev: rec { - werkzeug = prev.werkzeug.overridePythonAttrs (oldAttrs: rec { - version = "2.0.3"; + # flask 2.2 is incompatible with pgadmin 6.13 + # https://redmine.postgresql.org/issues/7651 + flask = prev.flask.overridePythonAttrs (oldAttrs: rec { + version = "2.1.3"; src = oldAttrs.src.override { inherit version; - sha256 = "sha256-uGP4/wV8UiFktgZ8niiwQRYbS+W6TQ2s7qpQoWOCLTw="; + sha256 = "sha256-FZcuUBffBXXD1sCQuhaLbbkCWeYgrI1+qBOjlrrVtss="; }; }); }); @@ -124,7 +127,7 @@ pythonPackages.buildPythonApplication rec { # build the documentation cd docs/en_US - ${sphinx}/bin/sphinx-build -W -b html -d _build/doctrees . _build/html + sphinx-build -W -b html -d _build/doctrees . _build/html # Build the clean tree cd ../../web @@ -156,7 +159,7 @@ pythonPackages.buildPythonApplication rec { cp -v ../pkg/pip/setup_pip.py setup.py ''; - nativeBuildInputs = with pythonPackages; [ cython pip ]; + nativeBuildInputs = with pythonPackages; [ cython pip sphinx ]; buildInputs = [ zlib pythonPackages.wheel diff --git a/pkgs/tools/admin/pgadmin/update.sh b/pkgs/tools/admin/pgadmin/update.sh new file mode 100755 index 0000000000000..d7ca19bbddd8d --- /dev/null +++ b/pkgs/tools/admin/pgadmin/update.sh @@ -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 |