Files
nixpkgs/pkgs/development/python-modules/locust/webui.nix
magicquark 47ea10eaab locust: fix build errors
- Upstream moved from `yarn` to `yarn berry` in
a863a60d58

- The version bump of `locust` from 2.33.1 to 2.37.14 in
0c5bbee473,
did not update the `webui.nix` file that inherits the source in
`default.nix`. The
diff (https://github.com/locustio/locust/compare/2.33.1...2.37.14) shows
that the change to yarn berry was made in between the version bump.

- A new dependency was added during the version bump to `locust` of
  `locust-cloud`.

- Resolves: https://github.com/NixOS/nixpkgs/issues/441033

- Add back in a preBuild hook, slightly reworked, that was removed in
  PR 388942.
2025-09-23 21:06:40 +01:00

40 lines
670 B
Nix

{
stdenv,
yarn-berry_4,
nodejs,
version,
src,
lib,
}:
let
yarn-berry = yarn-berry_4;
in
stdenv.mkDerivation (finalAttrs: {
pname = "locust-ui";
inherit version src;
missingHashes = ./missing-hashes.json;
yarnOfflineCache = yarn-berry.fetchYarnBerryDeps {
inherit (finalAttrs) src missingHashes;
hash = "sha256-FbKaU3wezuvcn98FOcUZbmoot/iHtmeStp4n0dNwFYA=";
};
nativeBuildInputs = [
yarn-berry
yarn-berry.yarnBerryConfigHook
nodejs
];
buildPhase = ''
runHook preBuild
yarn build
runHook postBuild
'';
dontNpmPrune = true;
postInstall = ''
mkdir -p $out/dist
cp -r dist/** $out/dist
'';
})