{ lib, stdenv, fetchFromGitHub, buildNpmPackage, nix-update-script, electron, makeWrapper, copyDesktopItems, makeDesktopItem, pkg-config, pixman, cairo, pango, npm-lockfile-fix, apple-sdk_11, }: buildNpmPackage rec { pname = "bruno"; version = "1.34.2"; src = fetchFromGitHub { owner = "usebruno"; repo = "bruno"; rev = "v${version}"; hash = "sha256-ydb80+FP2IsobvCZiIKzbErAJNakVoSoYrhddmPmYkc="; postFetch = '' ${lib.getExe npm-lockfile-fix} $out/package-lock.json ''; }; npmDepsHash = "sha256-ODE8GLIgdUEOiniki8jzkHfU5TKHWoIIbjGJjNzMZCI="; npmFlags = [ "--legacy-peer-deps" ]; nativeBuildInputs = [ pkg-config ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ makeWrapper copyDesktopItems ]; buildInputs = [ pixman cairo pango ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # fix for: https://github.com/NixOS/nixpkgs/issues/272156 apple-sdk_11 ]; desktopItems = [ (makeDesktopItem { name = "bruno"; desktopName = "Bruno"; exec = "bruno %U"; icon = "bruno"; comment = "Opensource API Client for Exploring and Testing APIs"; categories = [ "Development" ]; startupWMClass = "Bruno"; }) ]; postPatch = '' substituteInPlace scripts/build-electron.sh \ --replace-fail 'if [ "$1" == "snap" ]; then' 'exit 0; if [ "$1" == "snap" ]; then' ''; postConfigure = '' # sh: line 1: /build/source/packages/bruno-common/node_modules/.bin/rollup: cannot execute: required file not found patchShebangs packages/*/node_modules ''; ELECTRON_SKIP_BINARY_DOWNLOAD = 1; # remove giflib dependency npmRebuildFlags = [ "--ignore-scripts" ]; preBuild = '' substituteInPlace node_modules/canvas/binding.gyp \ --replace-fail "'with_gif%': '