diff --git a/pkgs/by-name/pg/pgadmin4/package.nix b/pkgs/by-name/pg/pgadmin4/package.nix index f54e0664e8ca..5c15cf400ab3 100644 --- a/pkgs/by-name/pg/pgadmin4/package.nix +++ b/pkgs/by-name/pg/pgadmin4/package.nix @@ -9,13 +9,14 @@ yarn-berry_4, nodejs, stdenv, + pkgsBuildHost, server-mode ? true, }: let pname = "pgadmin"; version = "9.14"; - yarnHash = "sha256-j/5qoCrhC7xBPaS6NhZFFQtJ7ThL/wkFXoCtyreLHco="; + yarnHash = "sha256-mJa5L8N40JWogQ8/LllSdX/uJHMzKULCow9+e5gFe/A="; src = fetchFromGitHub { owner = "pgadmin-org"; @@ -24,6 +25,9 @@ let hash = "sha256-NQe1ZN8jQEJE5qSpL5MjgLwWLGrGXCIHaCd8zLpsx3s="; }; + # Remove after https://github.com/pgadmin-org/pgadmin4/commit/79e490c5fa6031af7baa83f04f751bdc790dc408 is released + yarnPatch = ./yarn-4.14-support.patch; + # 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: { }); @@ -49,6 +53,7 @@ pythonPackages.buildPythonApplication rec { inherit missingHashes; src = src + "/web"; hash = yarnHash; + patches = [ yarnPatch ]; }; # from Dockerfile @@ -61,6 +66,7 @@ pythonPackages.buildPythonApplication rec { ./expose-setup.py.patch # check for permission of /etc/pgadmin/config_system and don't fail ./check-system-config-dir.patch + ]; postPatch = '' @@ -109,8 +115,10 @@ pythonPackages.buildPythonApplication rec { echo Building the web frontend... cd web ( - export LD=$CC # https://github.com/imagemin/optipng-bin/issues/108 - yarnBerryConfigHook + PATH=$PATH:${lib.makeBinPath [ pkgsBuildHost.git ]} + git apply ${yarnPatch} + export LD=$CC # https://github.com/imagemin/optipng-bin/issues/108 + yarnBerryConfigHook ) yarn webpacker cp -r * ../pip-build/pgadmin4 diff --git a/pkgs/by-name/pg/pgadmin4/yarn-4.14-support.patch b/pkgs/by-name/pg/pgadmin4/yarn-4.14-support.patch new file mode 100644 index 000000000000..62b859642205 --- /dev/null +++ b/pkgs/by-name/pg/pgadmin4/yarn-4.14-support.patch @@ -0,0 +1,25 @@ +diff --git a/.yarnrc.yml b/.yarnrc.yml +--- a/.yarnrc.yml ++++ b/.yarnrc.yml +@@ -1,5 +1,10 @@ ++approvedGitRepositories: ++ - "**" ++ + checksumBehavior: update + ++enableScripts: true ++ + logFilters: + - code: YN0013 + level: discard +diff --git a/yarn.lock b/yarn.lock +--- a/yarn.lock ++++ b/yarn.lock +@@ -2,6 +2,6 @@ + # Manual changes might be lost - proceed with caution! + + __metadata: +- version: 8 ++ version: 9 + cacheKey: 10c0 +