Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 78 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 fetchpatch2, 6 makeWrapper, 7 nodejs, 8 pnpm_8, 9}: 10 11let 12 pnpm = pnpm_8; 13in 14stdenv.mkDerivation (finalAttrs: { 15 pname = "concurrently"; 16 version = "8.2.2"; 17 18 src = fetchFromGitHub { 19 owner = "open-cli-tools"; 20 repo = "concurrently"; 21 tag = "v${finalAttrs.version}"; 22 hash = "sha256-VoyVYBOBMguFKnG2VItk1L5BbF72nO7bYJpb7adqICs="; 23 }; 24 25 pnpmDeps = pnpm.fetchDeps { 26 inherit (finalAttrs) 27 pname 28 version 29 src 30 patches 31 ; 32 fetcherVersion = 1; 33 hash = "sha256-F1teWIABkK0mqZcK3RdGNKmexI/C59QWSrrD1jYbHt0="; 34 }; 35 36 patches = [ 37 (fetchpatch2 { 38 name = "use-pnpm-8.patch"; 39 url = "https://github.com/open-cli-tools/concurrently/commit/0b67a1a5a335396340f4347886fb9d0968a57555.patch"; 40 hash = "sha256-mxid2Yl9S6+mpN7OLUCrJ1vS0bQ/UwNiGJ0DL6Zn//Q="; 41 }) 42 ]; 43 44 nativeBuildInputs = [ 45 makeWrapper 46 nodejs 47 pnpm.configHook 48 ]; 49 50 buildPhase = '' 51 runHook preBuild 52 53 pnpm build 54 55 runHook postBuild 56 ''; 57 58 installPhase = '' 59 runHook preInstall 60 61 mkdir -p "$out/bin" "$out/lib/concurrently" 62 cp -r dist node_modules "$out/lib/concurrently" 63 makeWrapper "${lib.getExe nodejs}" "$out/bin/concurrently" \ 64 --add-flags "$out/lib/concurrently/dist/bin/concurrently.js" 65 ln -s "$out/bin/concurrently" "$out/bin/con" 66 67 runHook postInstall 68 ''; 69 70 meta = { 71 changelog = "https://github.com/open-cli-tools/concurrently/releases/tag/v${finalAttrs.version}"; 72 description = "Run commands concurrently"; 73 homepage = "https://github.com/open-cli-tools/concurrently"; 74 license = lib.licenses.mit; 75 maintainers = with lib.maintainers; [ jpetrucciani ]; 76 mainProgram = "concurrently"; 77 }; 78})