1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

chromium: use versionhistory.googleapis.com over omahaproxy.appspot.com

Version information previously available at omahaproxy.appspot.com will
have to be retrieved from versionhistory.googleapis.com in the future.

See https://groups.google.com/a/chromium.org/g/chromium-dev/c/uH-nFrOLWtE/m/PhUj_inyAQAJ
See https://github.com/ungoogled-software/ungoogled-chromium/pull/2260
This commit is contained in:
networkException 2023-04-07 23:33:45 +02:00
parent 6f0cdea7a3
commit 93357bed06
No known key found for this signature in database
GPG key ID: E3877443AE684391
2 changed files with 30 additions and 21 deletions

View file

@ -29,7 +29,7 @@
- Release updates: https://chromereleases.googleblog.com/
- Available as Atom or RSS feed (filter for
"Stable Channel Update for Desktop")
- Channel overview: https://omahaproxy.appspot.com/
- Release API: https://developer.chrome.com/docs/versionhistory/guide/
- Release schedule: https://chromiumdash.appspot.com/schedule
# Updating Chromium
@ -39,6 +39,16 @@ update `upstream-info.json`. After updates it is important to test at least
`nixosTests.chromium` (or basic manual testing) and `google-chrome` (which
reuses `upstream-info.json`).
Note: Due to the script downloading many large tarballs it might be
necessary to adjust the available tmpfs size (it defaults to 10% of the
systems memory)
```nix
services.logind.extraConfig = ''
RuntimeDirectorySize=4G
'';
```
Note: The source tarball is often only available a few hours after the release
was announced. The CI/CD status can be tracked here:
- https://ci.chromium.org/p/infra/builders/cron/publish_tarball

View file

@ -19,7 +19,7 @@ from distutils.version import LooseVersion
from os.path import abspath, dirname
from urllib.request import urlopen
HISTORY_URL = 'https://omahaproxy.appspot.com/history?os=linux'
RELEASES_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/all/versions/all/releases'
DEB_URL = 'https://dl.google.com/linux/chrome/deb/pool/main/g'
BUCKET_URL = 'https://commondatastorage.googleapis.com/chromium-browser-official'
@ -103,7 +103,7 @@ def get_latest_ungoogled_chromium_build():
tag = get_latest_ungoogled_chromium_tag()
version = tag.split('-')[0]
return {
'channel': 'ungoogled-chromium',
'name': 'chrome/platforms/linux/channels/ungoogled-chromium/versions/',
'version': version,
'ungoogled_tag': tag
}
@ -159,27 +159,26 @@ channels = {}
last_channels = load_json(JSON_PATH)
print(f'GET {HISTORY_URL}', file=sys.stderr)
with urlopen(HISTORY_URL) as resp:
builds = csv.DictReader(iterdecode(resp, 'utf-8'))
builds = list(builds)
builds.append(get_latest_ungoogled_chromium_build())
for build in builds:
channel_name = build['channel']
print(f'GET {RELEASES_URL}', file=sys.stderr)
with urlopen(RELEASES_URL) as resp:
releases = json.load(resp)['releases']
releases.append(get_latest_ungoogled_chromium_build())
for release in releases:
channel_name = re.findall("chrome\/platforms\/.*\/channels\/(.*)\/versions\/", release['name'])[0]
# If we've already found a newer build for this channel, we're
# If we've already found a newer release for this channel, we're
# no longer interested in it.
if channel_name in channels:
continue
# If we're back at the last build we used, we don't need to
# If we're back at the last release we used, we don't need to
# keep going -- there's no new version available, and we can
# just reuse the info from last time.
if build['version'] == last_channels[channel_name]['version']:
if release['version'] == last_channels[channel_name]['version']:
channels[channel_name] = last_channels[channel_name]
continue
channel = {'version': build['version']}
channel = {'version': release['version']}
if channel_name == 'dev':
google_chrome_suffix = 'unstable'
elif channel_name == 'ungoogled-chromium':
@ -188,13 +187,13 @@ with urlopen(HISTORY_URL) as resp:
google_chrome_suffix = channel_name
try:
channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{build["version"]}.tar.xz')
channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{release["version"]}.tar.xz')
channel['sha256bin64'] = nix_prefetch_url(
f'{DEB_URL}/google-chrome-{google_chrome_suffix}/' +
f'google-chrome-{google_chrome_suffix}_{build["version"]}-1_amd64.deb')
f'google-chrome-{google_chrome_suffix}_{release["version"]}-1_amd64.deb')
except subprocess.CalledProcessError:
if (channel_name == 'ungoogled-chromium' and 'sha256' in channel and
build['version'].split('.')[0] == last_channels['stable']['version'].split('.')[0]):
release['version'].split('.')[0] == last_channels['stable']['version'].split('.')[0]):
# Sometimes ungoogled-chromium is updated to a newer tag than
# the latest stable Chromium version. In this case we'll set
# sha256bin64 to null and the Nixpkgs code will fall back to
@ -202,7 +201,7 @@ with urlopen(HISTORY_URL) as resp:
# Widevine/DRM which is disabled by default):
channel['sha256bin64'] = None
else:
# This build isn't actually available yet. Continue to
# This release isn't actually available yet. Continue to
# the next one.
continue
@ -212,11 +211,11 @@ with urlopen(HISTORY_URL) as resp:
elif channel_name == 'ungoogled-chromium':
ungoogled_repo_url = 'https://github.com/Eloston/ungoogled-chromium.git'
channel['deps']['ungoogled-patches'] = {
'rev': build['ungoogled_tag'],
'sha256': nix_prefetch_git(ungoogled_repo_url, build['ungoogled_tag'])['sha256']
'rev': release['ungoogled_tag'],
'sha256': nix_prefetch_git(ungoogled_repo_url, release['ungoogled_tag'])['sha256']
}
with open(UNGOOGLED_FLAGS_PATH, 'w') as out:
out.write(get_ungoogled_chromium_gn_flags(build['ungoogled_tag']))
out.write(get_ungoogled_chromium_gn_flags(release['ungoogled_tag']))
channels[channel_name] = channel