-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278603 from emilylange/chromium
{ungoogled-,}chromium: 120.0.6099.129 -> 120.0.6099.199, improve and move `recompressTarball`
- Loading branch information
Showing
5 changed files
with
57 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
pkgs/applications/networking/browsers/chromium/recompress-tarball.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ zstd | ||
, fetchurl | ||
}: | ||
|
||
{ version | ||
, hash ? "" | ||
, ... | ||
} @ args: | ||
|
||
fetchurl ({ | ||
name = "chromium-${version}.tar.zstd"; | ||
url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz"; | ||
inherit hash; | ||
|
||
# chromium xz tarballs are multiple gigabytes big and are sometimes downloaded multiples | ||
# times for different versions as part of our update script. | ||
# We originally inherited fetchzip's default for downloadToTemp (true). | ||
# Given the size of the /run/user tmpfs used defaults to logind's RuntimeDirectorySize=, | ||
# which in turn defaults to 10% of the total amount of physical RAM, this often lead to | ||
# "no space left" errors, eventually resulting in its own section in our chromium | ||
# README.md (for users wanting to run the update script). | ||
# Nowadays, we use fetchurl instead of fetchzip, which defaults to false instead of true. | ||
# We just want to be explicit and provide a place to document the history and reasoning | ||
# behind this. | ||
downloadToTemp = false; | ||
|
||
nativeBuildInputs = [ zstd ]; | ||
|
||
postFetch = '' | ||
cat "$downloadedFile" \ | ||
| xz -d --threads=$NIX_BUILD_CORES \ | ||
| tar xf - \ | ||
--warning=no-timestamp \ | ||
--one-top-level=source \ | ||
--exclude=third_party/llvm \ | ||
--exclude=third_party/rust-src \ | ||
--strip-components=1 | ||
tar \ | ||
--use-compress-program "zstd -T$NIX_BUILD_CORES" \ | ||
--sort name \ | ||
--mtime "1970-01-01" \ | ||
--owner=root --group=root \ | ||
--numeric-owner --mode=go=rX,u+rw,a-s \ | ||
-cf $out source | ||
''; | ||
} // removeAttrs args [ "version" ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters