Merge pull request #288928 from emilylange/unbreak-packages-that-depend-on-chromium

sharedown: unbreak build, sitespeed-io: unbreak build, add `passthru.updateScript`, 27.3.1 -> 33.0.0
This commit is contained in:
Emily 2024-02-16 14:09:38 +01:00 committed by GitHub
commit 610303fd14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 8 deletions

View File

@ -6,7 +6,7 @@
, libsecret
, python3
, pkg-config
, nodePackages
, nodejs
, electron
, makeWrapper
, makeDesktopItem
@ -63,7 +63,6 @@ stdenvNoCC.mkDerivation rec {
nativeBuildInputs = [
python3
pkg-config
nodePackages.node-gyp
];
buildInputs = [
libsecret
@ -76,6 +75,15 @@ stdenvNoCC.mkDerivation rec {
};
};
# needed for node-gyp, copied from https://nixos.org/manual/nixpkgs/unstable/#javascript-yarn2nix-pitfalls
# permalink: https://github.com/NixOS/nixpkgs/blob/d176767c02cb2a048e766215078c3d231e666091/doc/languages-frameworks/javascript.section.md#pitfalls-javascript-yarn2nix-pitfalls
preBuild = ''
mkdir -p $HOME/.node-gyp/${nodejs.version}
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
export npm_config_nodedir=${nodejs}
'';
packageJSON = "${src}/package.json";
yarnLock = ./yarn.lock;

View File

@ -2,13 +2,14 @@
, stdenv
, fetchFromGitHub
, buildNpmPackage
, makeWrapper
, nodejs_18
, coreutils
, ffmpeg-headless
, imagemagick_light
, procps
, python3
, xorg
, nix-update-script
# chromedriver is more efficient than geckodriver, but is available on less platforms.
@ -23,15 +24,17 @@
assert (!withFirefox && !withChromium) -> throw "Either `withFirefox` or `withChromium` must be enabled.";
buildNpmPackage rec {
pname = "sitespeed-io";
version = "27.3.1";
version = "33.0.0";
src = fetchFromGitHub {
owner = "sitespeedio";
repo = "sitespeed.io";
rev = "v${version}";
hash = "sha256-Z4U4ZIw5Du/VSHIsGKdgu7wRv/6XVh/nMFDs8aYwkOQ=";
hash = "sha256-UmviwcxL67fn8B4ruJH9yKdcYVqmxqKSImQszKhDHZ0=";
};
nodejs = nodejs_18;
postPatch = ''
ln -s npm-shrinkwrap.json package-lock.json
'';
@ -41,11 +44,9 @@ buildNpmPackage rec {
GECKODRIVER_SKIP_DOWNLOAD = true;
EDGEDRIVER_SKIP_DOWNLOAD = true;
nativeBuildInputs = [ python3 makeWrapper ];
dontNpmBuild = true;
npmInstallFlags = [ "--omit=dev" ];
npmDepsHash = "sha256-RfZlXE8hnAJKiiWdOGFsAFGcxwgnLNvLrXeIinABFb0=";
npmDepsHash = "sha256-FggwOnuQ+azgdLxfc6EUAsbl0+il6/2+p1t7MCrTNgE=";
postInstall = ''
mv $out/bin/sitespeed{.,-}io
@ -81,6 +82,10 @@ buildNpmPackage rec {
${lib.optionalString (withFirefox && !withChromium) "--add-flags '-b firefox'"}
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "An open source tool that helps you monitor, analyze and optimize your website speed and performance";
homepage = "https://sitespeed.io";