{ lib, mkYarnPackage, fetchFromGitHub, nodejs, runtimeShell , nodePackages, python3, vips, glib, pkg-config }: # Notes for the upgrade: # * Download the tarball of the new version to use. # * Remove the `resolutions`-section from upstream `package.json` # as this breaks with `yarn2nix`. # * Regenerate `yarn.lock` and `yarn2nix --no-patch`. # * Replace new `package.json`, `yarn.nix`, `yarn.lock` here. # * Update `version`+`hash` and rebuild. mkYarnPackage rec { pname = "grafana-image-renderer"; version = "3.6.4"; src = fetchFromGitHub { owner = "grafana"; repo = "grafana-image-renderer"; rev = "v${version}"; sha256 = "sha256-CWA2xmVWvPeKCvssQAMHMYJ3CxJ7sIC7GX3qb3QFLuA="; }; buildPhase = '' runHook preBuild pushd deps/renderer yarn run build popd runHook postBuild ''; dontInstall = true; packageJSON = ./package.json; yarnNix = ./yarn.nix; yarnLock = ./yarn.lock; pkgConfig.sharp = { nativeBuildInputs = [ nodePackages.node-gyp python3 pkg-config ]; buildInputs = [ glib vips ]; postInstall = '' node-gyp rebuild ''; }; distPhase = '' runHook preDist shopt -s extglob pushd deps/renderer install_path="$out/libexec/grafana-image-renderer" mkdir -p $install_path cp -R ../../node_modules $install_path cp -R ./!(node_modules) $install_path popd mkdir -p $out/bin cat >$out/bin/grafana-image-renderer <