diff --git a/pkgs/tools/admin/pgadmin/check-system-config-dir.patch b/pkgs/by-name/pg/pgadmin4/check-system-config-dir.patch similarity index 100% rename from pkgs/tools/admin/pgadmin/check-system-config-dir.patch rename to pkgs/by-name/pg/pgadmin4/check-system-config-dir.patch diff --git a/pkgs/tools/admin/pgadmin/expose-setup.py.patch b/pkgs/by-name/pg/pgadmin4/expose-setup.py.patch similarity index 100% rename from pkgs/tools/admin/pgadmin/expose-setup.py.patch rename to pkgs/by-name/pg/pgadmin4/expose-setup.py.patch diff --git a/pkgs/by-name/pg/pgadmin4/missing-hashes.json b/pkgs/by-name/pg/pgadmin4/missing-hashes.json new file mode 100644 index 000000000000..ad60429537cd --- /dev/null +++ b/pkgs/by-name/pg/pgadmin4/missing-hashes.json @@ -0,0 +1,43 @@ +{ + "@img/sharp-darwin-arm64@npm:0.34.3": "c5ed848f3cecaced50be6d1805cfb23586299f119a9917880c3f590b7ddd54b930e493c73480d13452503101168f92a0dc85ccc5b19b330470a5fe69e1fcf206", + "@img/sharp-darwin-x64@npm:0.34.3": "7e892ca052c8eb9002fb6e86e0a7893aff909e0f203f6ada7a67f4ca7e189631203189700a498ab3401280f5c042f5b08c3f7bc713192a97228864e9c4527743", + "@img/sharp-libvips-darwin-arm64@npm:1.2.0": "35d0d475da11fdfd7f5b5f7f1de4376ac04de6d6e0879833f71b2fa305b9d58c96ee464cf234060506ef9b1e2eabe5c09c302e818f8899b2ced1fcb7f85c01eb", + "@img/sharp-libvips-darwin-x64@npm:1.2.0": "e853f3b8a19d815af553b703e1d6d70abec525c61f3f19cc8a9d50d3749bc563b7f255307709b7c0836f76b110948489d3a9a3932d2fbc1775a083a56979bf56", + "@img/sharp-libvips-linux-arm64@npm:1.2.0": "ec53e3e62c9351e28ea0e4c26a1d8ab257ac003e8184b1757b79c2a240baecec2452e0dbca08c8227fd01c498801c428230261fdb86198e873e07347d741c3c7", + "@img/sharp-libvips-linux-arm@npm:1.2.0": "a2f9822cb2ac5b315f2a02c59ebdb235f6c45251207795f83f1a92db696a9deced882dc752bdddd1eab98da5d7d1d1e9968ae142313ff09960b7ae30b760ba07", + "@img/sharp-libvips-linux-ppc64@npm:1.2.0": "e90e1c46e6020f3a96562dd526549af2fabff46a1576f2e7af003be4b5efeb6fc8caa8e303e2eeb58129c938be31e0bf067736072479f2298152230cecd5fce4", + "@img/sharp-libvips-linux-s390x@npm:1.2.0": "2cf62c8b285effd3a3ec8854bc5fd78af162459294a6d9847af33d6bdeacfbad81cb0bec68b76889b148306a8a28492b4d44e6c96b778d0879349180191d758d", + "@img/sharp-libvips-linux-x64@npm:1.2.0": "ca342d07d1f0d22559f26bdcc0354f87a845ef19c69c22e37d9e23d71de15159f50d01183e8e7ea75e0ccfb6c7be9406741414a1f3534ec4aba10e51f0d7dffd", + "@img/sharp-libvips-linuxmusl-arm64@npm:1.2.0": "aa248f0c8602b0a17fdb5c1b00ce7dbb09f05b94a45ee7f226eaebfa459d4ee3fd407c62244902e15699927943c511a7fe045b575185ecc9b585987b64ae6cb1", + "@img/sharp-libvips-linuxmusl-x64@npm:1.2.0": "811071647c5129a1ead1e54b8f4672061bbbc1177d1d49127c755848e81f21bcbf5bf438c0e53118e731be5e000235904de3b5cf305053de015b56609a059371", + "@img/sharp-linux-arm64@npm:0.34.3": "3e8d53f54789b3d98dc14bf696917ff50f8c8c355aedc0dc90890ca764259bafec7390eabe262ce843eab8b74e0c128858128ce614e0b85dcba28d6b9ce3ea3f", + "@img/sharp-linux-arm@npm:0.34.3": "563c48ee129e5f3c6afed71ffba9c79a4369e7967e7b3a4a97d9b1e5aefa511873d3cd7a568ec42cd5968ea76f89ab93ee65c1363170af50559b620bfdb89d5b", + "@img/sharp-linux-ppc64@npm:0.34.3": "5973f8c522f33f826efff4052e253ec554882db54421a00f2636594e9ccc27e16dfb865f8de101678cb07b1a2d31b516ce4a88b65132ecc1101d07b6cc1bd571", + "@img/sharp-linux-s390x@npm:0.34.3": "284d2fcd9cc297b27ec135b0c63d5a6170cb17be378d92c75ec19b6034e7ed5801cab04ca17d445a80b073d67c4f9fe809334f5d4edf533c2d81d66d5d882ef3", + "@img/sharp-linux-x64@npm:0.34.3": "a370c04ca6d4145e6d6529d84b133d80e88d408e4483ba168e5993e5b4c0cbd2db57d4e53aca0bfa43320b571ff8bd70c22d8d7f5fadb5e5df1ded91393ae71d", + "@img/sharp-linuxmusl-arm64@npm:0.34.3": "c63d8afda1a7d4810bdc19473b6235313d923f8763a8dfc182465b63b8e4805769a9e92a8b2136f0235e07ae1b1ab63adfa904bb833d64f0495108dfc180a475", + "@img/sharp-linuxmusl-x64@npm:0.34.3": "9500e8f5d0ab96395a8d522920f25d4376d928ec58e88b3a5dbce5249c26efec046d20845bee8e9233fbff5287cfa979cfc079bc608342d257a6827be6cc0322", + "@img/sharp-wasm32@npm:0.34.3": "840dd97d3151b2189c3d0ee0746c139cbdd0441d5d5dfc87d2dd9970fc2c5448a3815c3110c64009998d165ca6dc7b5d58811b98b2c1e4ab0a1eb5ad97275f1e", + "@img/sharp-win32-arm64@npm:0.34.3": "adc7d18a8334ca1fea09c877dc9493e75a9018f73dc63038c8ccef7535a272c0aa3c2a9867a49a223703747149fb1fe57ef8580dd6098f0f33c602a876a48e1b", + "@img/sharp-win32-ia32@npm:0.34.3": "eef220adf1240429f72d9a9aadc22ccb741889785fa025396cfed41603364990b5f3841cee4d60525b22e65f36c7416297581300c873268fe2b7bb67087ada73", + "@img/sharp-win32-x64@npm:0.34.3": "5a5d2624bea7a31393b5a89738ad22a2b020a67f5e5b9eb40063510b514e8516b0fb4e320ff9eb1d32fa2ee3b4c3a0387333d051da28d93957116cbbd63b5fe0", + "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1": "04dd38b694c1680bfec192b499e188700398a414886a08a8a7c72815db56ac147df03d88c73ff6fff7ac3e0a01dc41978054b3622b49463e0d684c5168557fcc", + "@unrs/resolver-binding-android-arm64@npm:1.11.1": "763626adc34dd2b4af677b5ced6493e7b2b1935351a5c9137f1c9561d11faf97b94015e6876e57e85c33ff563564314c92c0882a4780a57f2225cbbd779a695d", + "@unrs/resolver-binding-darwin-arm64@npm:1.11.1": "03b477fdfec55dbabe488fe0962417bddaa38b028d2670053469f1d24163907b097aac15b565f6974449bee398a38d5e3e1525f2b515ce57e243149021b7aa2f", + "@unrs/resolver-binding-darwin-x64@npm:1.11.1": "3aeff9aaf4ef6d786c517d9017b5c41b0af180cdbaf705d08e6e5b5ba9d5410d28ef6754c5f8a865f0bb5efd460dc1c4156b5e2201032c0a604a6c734ddbc848", + "@unrs/resolver-binding-freebsd-x64@npm:1.11.1": "b9f7a3e03db9edfc3480db056dd25229f901f21840ee768b69f349b66676a995a404e60617b3bcbd984f57f2199eb352dd6fad0f4420c3084ceef5e3293cdad5", + "@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.11.1": "4d03b8bcef5a90586a846d6d332f39cee211f3d330b6e10036969894b6ecfb70b047265e985d572def93b84f38621dec30e4b4bb42699dd784adbae3ca5e7bea", + "@unrs/resolver-binding-linux-arm-musleabihf@npm:1.11.1": "9f3a3c2e5e6418a5a78294fa042824f5c270e993c1a99e82dd6b0ee0d2869929bb62dd154a0acc1e4ef16273e8073e0e257901208c062e6bdd49d586d07bb419", + "@unrs/resolver-binding-linux-arm64-gnu@npm:1.11.1": "05228d6fd669f404f0e3164ccf2430a52cc7b3bbd211367527b5d726b1220a1816bab70159bed55694d9b7543553f6002379e7e186c605d7055c5156977da022", + "@unrs/resolver-binding-linux-arm64-musl@npm:1.11.1": "8115802143396d4992bb2f6f0acb6e8bc141a57864c5fd84cbc70577c25784cb08dd163b753b1fc0decc02582cf4cb1e30d04faaf763048babbbe706bdfa26ea", + "@unrs/resolver-binding-linux-ppc64-gnu@npm:1.11.1": "50f9f54b2eafb1ea023671cc3070692b2b15f6e49105b08b3f588033e65e8de4183f76e080b798de710f9c41df1bf5515c01868866a21cbd35db179b4ac9f23b", + "@unrs/resolver-binding-linux-riscv64-gnu@npm:1.11.1": "8f8222f938cc2025ed3971e0e303f4ff5aa5df74474b835442830ebe942d050ba3f8bbb67095da64099e6fc69bb5bb73ca63db54e059c95e51aa8909880fb207", + "@unrs/resolver-binding-linux-riscv64-musl@npm:1.11.1": "5c8987f7dcaf38ef27ec67dcf118141502d5ac75d28429da6d1b7037f3e5a5351f32f55094472fde11784e65d01f1da4dafd7c0fdca28423fbc8de2c2c51d16c", + "@unrs/resolver-binding-linux-s390x-gnu@npm:1.11.1": "17aed6472880a82e5a05147a55efb6f0d968f5dcb584845addf89acec3824534ee741d4b162686124d17daf9131373c469c57843996a5ee2db4f1b1b55e1d11e", + "@unrs/resolver-binding-linux-x64-gnu@npm:1.11.1": "9495c08fc42f2d4a33e33c64adbcbf51588cd7ea07478eacb2e9143d955a760122440f4a3ac48b086cc2563ca2b2464d72ed0336fcc20c0a89ddc356f956eda8", + "@unrs/resolver-binding-linux-x64-musl@npm:1.11.1": "c84fadfee66eeebd16eb7cce7c4b5a1ec90260c724d0064111e9f43a1341ebfede61627cb68fd3a9735e4c10b25606fb472a4d13143cc569867b80d85c4a9824", + "@unrs/resolver-binding-wasm32-wasi@npm:1.11.1": "655a3990ed9b238e8f0c4858f87ca84bd3d81db300f7730c885162333055170e11207af7789ff38f619e261178718f6977729e42ce7978cc9e6ac7b6d93822d5", + "@unrs/resolver-binding-win32-arm64-msvc@npm:1.11.1": "983f800ff8b5181247a7d460ab5c9704cd425d0182e93290f69fb969d93efe17be6a27c22b97546d36e9a9d9aeda96d5f753bc938b3d9a00f32c10fc228ce5a9", + "@unrs/resolver-binding-win32-ia32-msvc@npm:1.11.1": "383d639e3b08fc9e4ba18127ef55610172d2d1d6adb83e1466fff2b223552384cdc6217051f749829e0c90a757ea5631e8c4ad2cfeb59bdee2bb033fbd526854", + "@unrs/resolver-binding-win32-x64-msvc@npm:1.11.1": "c862561f6495c0dbffb94d421e5727b25c1b61d98e22383bff23e6719a6c0125bb0b7df3be7220f5480bf54f5a605ea572f10fff1cce14fda24d42e396559940" +} diff --git a/pkgs/tools/admin/pgadmin/default.nix b/pkgs/by-name/pg/pgadmin4/package.nix similarity index 75% rename from pkgs/tools/admin/pgadmin/default.nix rename to pkgs/by-name/pg/pgadmin4/package.nix index ab78cdeee48c..adf9b1543aea 100644 --- a/pkgs/tools/admin/pgadmin/default.nix +++ b/pkgs/by-name/pg/pgadmin4/package.nix @@ -6,37 +6,28 @@ nixosTests, postgresqlTestHook, postgresql, - yarn-berry_3, + yarn-berry_4, nodejs, autoconf, automake, libtool, libpng, nasm, - cmake, pkg-config, stdenv, - srcOnly, server-mode ? true, }: let pname = "pgadmin"; - version = "9.3"; - yarnHash = "sha256-T6RKWuAAoJgbzJKef4ioOoUDtoGM9s9BFqxFdy5EtyQ="; + version = "9.8"; + yarnHash = "sha256-NvQlrDXn9sa4MpytFYPsC4bKO8Thx/MuqG8M6VIa2ig="; src = fetchFromGitHub { owner = "pgadmin-org"; repo = "pgadmin4"; rev = "REL-${lib.versions.major version}_${lib.versions.minor version}"; - hash = "sha256-4uupF1dw6OE/briAI5PWiQ7h6RPx1sUqf8PB8cJsNSU="; - }; - - mozjpeg-bin = fetchFromGitHub { - owner = "imagemin"; - repo = "mozjpeg-bin"; - rev = "c0587fbc00b21ed8cad8bae499a0827baeaf7ffa"; - hash = "sha256-D/pXQBlIIyk7KAgxJ1gKqxYxtlfBbLzUSmYZbH659cA="; + hash = "sha256-gnVrMuxWV7lAol1gyONbhtuUL4EEOfOPkRUM2esMgi0="; }; # keep the scope, as it is used throughout the derivation and tests @@ -58,16 +49,10 @@ in pythonPackages.buildPythonApplication rec { inherit pname version src; + missingHashes = ./missing-hashes.json; - offlineCache = yarn-berry_3.fetchYarnBerryDeps { - # mozjpeg fails to build on darwin due to a hardocded path - # this has been fixed upstream on master but no new version - # has been released. We therefore point yarn to upstream - # see https://github.com/imagemin/mozjpeg-bin/issues/64 - # and https://github.com/imagemin/mozjpeg-bin/issues/81 - patches = [ - ./mozjpeg.patch - ]; + offlineCache = yarn-berry_4.fetchYarnBerryDeps { + inherit missingHashes; src = src + "/web"; hash = yarnHash; }; @@ -85,11 +70,6 @@ pythonPackages.buildPythonApplication rec { ]; postPatch = '' - # the patch needs to be executed inside the /web subfolder - # therefore it is included here and not in `patches` - cd web - patch -u yarn.lock ${./mozjpeg.patch} - cd .. # patching Makefile, so it doesn't try to build sphinx documentation here # (will do so later) substituteInPlace Makefile \ @@ -111,9 +91,6 @@ pythonPackages.buildPythonApplication rec { ''; dontYarnBerryInstallDeps = true; - env.YARN_ENABLE_SCRIPTS = "0"; - dontUseCmakeConfigure = true; - preBuild = '' # Adapted from pkg/pip/build.sh echo Creating required directories... @@ -141,25 +118,6 @@ pythonPackages.buildPythonApplication rec { export LD=$CC # https://github.com/imagemin/optipng-bin/issues/108 yarnBerryConfigHook ) - # mozjpeg vendored source isn't included in the checkout for yarn. If we copy it before the - # yarnConfigHook it will just get overwritten. So we first run the configHook without build, - # then copy the vendored source and then build the dependencies - # This has the disadvantage of repeating some of the yarnConfigHooks logic here - mkdir -p node_modules/mozjpeg/vendor/source - cp ${mozjpeg-bin}/vendor/source/mozjpeg.tar.gz node_modules/mozjpeg/vendor/source/ - ( - # https://github.com/mozilla/mozjpeg/issues/438 - substituteInPlace node_modules/mozjpeg/lib/install.js --replace-fail "cmake -DCMAKE" "cmake -DENABLE_STATIC=FALSE -DCMAKE" - substituteInPlace node_modules/mozjpeg/lib/install.js --replace-fail "cp cjpeg-static" "cp cjpeg" - export LD=$CC - export HOME=$(mktemp -d) - export YARN_ENABLE_SCRIPTS=1 - YARN_IGNORE_PATH=1 ${yarn-berry_3.yarn-berry-offline}/bin/yarn config set enableTelemetry false - YARN_IGNORE_PATH=1 ${yarn-berry_3.yarn-berry-offline}/bin/yarn config set enableGlobalCache false - export npm_config_nodedir="${srcOnly nodejs}" - export npm_config_node_gyp="${nodejs}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" - YARN_IGNORE_PATH=1 ${yarn-berry_3.yarn-berry-offline}/bin/yarn install --inline-builds - ) yarn webpacker cp -r * ../pip-build/pgadmin4 # save some disk space @@ -185,24 +143,14 @@ pythonPackages.buildPythonApplication rec { cython pip sphinx - yarn-berry_3 - yarn-berry_3.yarnBerryConfigHook + yarn-berry_4 + yarn-berry_4.yarnBerryConfigHook nodejs - - # for building mozjpeg2 - cmake - autoconf - automake - libtool - nasm - pkg-config ]; buildInputs = [ zlib pythonPackages.wheel - # for mozjpeg2 - libpng ]; propagatedBuildInputs = with pythonPackages; [ @@ -247,7 +195,6 @@ pythonPackages.buildPythonApplication rec { azure-identity sphinxcontrib-youtube dnspython - speaklater3 google-auth-oauthlib google-api-python-client keyring diff --git a/pkgs/tools/admin/pgadmin/update.sh b/pkgs/by-name/pg/pgadmin4/update.sh similarity index 86% rename from pkgs/tools/admin/pgadmin/update.sh rename to pkgs/by-name/pg/pgadmin4/update.sh index 0205b654e437..3f66e5b9848b 100755 --- a/pkgs/tools/admin/pgadmin/update.sh +++ b/pkgs/by-name/pg/pgadmin4/update.sh @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl wget jq common-updater-scripts yarn-berry_3 yarn-berry_3.yarn-berry-fetcher +#!nix-shell -i bash -p curl wget jq common-updater-scripts yarn-berry_4 yarn-berry_4.yarn-berry-fetcher set -eu -o pipefail @@ -43,8 +43,8 @@ tar -xzf "pgadmin4-$newest_version.tar.gz" cd "pgadmin4-$newest_version/web" printf "Will now generate the hash. This will download the packages to the nix store and also take some time\n" -yarn-berry-fetcher missing-hashes yarn.lock -if [[ -f missing-hashes.json ]]; then +yarn-berry-fetcher missing-hashes yarn.lock > missing-hashes.json +if [[ $(wc -l