git.iko.soy/typeable/nixpkgs
on master help sign in
ungoogled-chromium: Support enableWideVine=true

Building with Google's proprietary Widevine DRM technology requires fetching the Google Chrome sources.

commit86ff1e45cece6f001cf0971559cdec6d25bb9db7 authorMichael Weiss <dev.primeos@gmail.com> dateTue 22 Dec 2020, 13:21 (6 years ago) parent74971a1
3 files changed+36−34
pkgs/applications/networking/browsers/chromium/default.nix+12−13 pkgs/applications/networking/browsers/chromium/update.py+23−21 pkgs/applications/networking/browsers/chromium/upstream-info.json+1
pkgs/applications/networking/browsers/chromium/default.nix+12−13
@@ -52,19 +52,18 @@ let
5252 ungoogled-chromium = callPackage ./ungoogled.nix {};
5353 };
5454
55− pkgSuffix = if channel == "dev" then "unstable" else channel;
55+ pkgSuffix = if channel == "dev" then "unstable" else
56+ (if channel == "ungoogled-chromium" then "stable" else channel);
5657 pkgName = "google-chrome-${pkgSuffix}";
57− chromeSrc = if channel == "ungoogled-chromium"
58− then throw "Google Chrome is not supported for the ungoogled-chromium channel."
59− else fetchurl {
60− urls = map (repo: "${repo}/${pkgName}/${pkgName}_${version}-1_amd64.deb") [
61− "https://dl.google.com/linux/chrome/deb/pool/main/g"
62− "http://95.31.35.30/chrome/pool/main/g"
63− "http://mirror.pcbeta.com/google/chrome/deb/pool/main/g"
64− "http://repo.fdzh.org/chrome/deb/pool/main/g"
65− ];
66− sha256 = chromium.upstream-info.sha256bin64;
67− };
58+ chromeSrc = fetchurl {
59+ urls = map (repo: "${repo}/${pkgName}/${pkgName}_${version}-1_amd64.deb") [
60+ "https://dl.google.com/linux/chrome/deb/pool/main/g"
61+ "http://95.31.35.30/chrome/pool/main/g"
62+ "http://mirror.pcbeta.com/google/chrome/deb/pool/main/g"
63+ "http://repo.fdzh.org/chrome/deb/pool/main/g"
64+ ];
65+ sha256 = chromium.upstream-info.sha256bin64;
66+ };
6867
6968 mkrpath = p: "${lib.makeSearchPathOutput "lib" "lib64" p}:${lib.makeLibraryPath p}";
7069 widevineCdm = stdenv.mkDerivation {
@@ -76,7 +75,7 @@ let
7675
7776 unpackCmd = let
7877 widevineCdmPath =
79− if channel == "stable" then
78+ if (channel == "stable" || channel == "ungoogled-chromium") then
8079 "./opt/google/chrome/WidevineCdm"
8180 else if channel == "beta" then
8281 "./opt/google/chrome-beta/WidevineCdm"
pkgs/applications/networking/browsers/chromium/update.py+23−21
@@ -91,24 +91,15 @@ def get_latest_ungoogled_chromium_tag():
9191 return tag_data[0]['name']
9292
9393
94−def get_ungoogled_chromium_channel():
95− """Returns a dictionary for the ungoogled-chromium channel."""
96− latest_tag = get_latest_ungoogled_chromium_tag()
97− version = latest_tag.split('-')[0]
98− if version == last_channels['ungoogled-chromium']['version']:
99− # No update available -> keep the cached information (no refetching required):
100− return last_channels['ungoogled-chromium']
101− channel = {
94+def get_latest_ungoogled_chromium_build():
95+ """Returns a dictionary for the latest ungoogled-chromium build."""
96+ tag = get_latest_ungoogled_chromium_tag()
97+ version = tag.split('-')[0]
98+ return {
99+ 'channel': 'ungoogled-chromium',
102100 'version': version,
103− 'sha256': nix_prefetch_url(f'{BUCKET_URL}/chromium-{version}.tar.xz'),
104− 'deps': get_channel_dependencies(version)
105− }
106− repo_url = 'https://github.com/Eloston/ungoogled-chromium.git'
107− channel['deps']['ungoogled-patches'] = {
108− 'rev': latest_tag,
109− 'sha256': nix_prefetch_git(repo_url, latest_tag)['sha256']
101+ 'ungoogled_tag': tag
110102 }
111− return channel
112103
113104
114105channels = {}
@@ -118,6 +109,8 @@ last_channels = load_json(JSON_PATH)
118109print(f'GET {HISTORY_URL}', file=sys.stderr)
119110with urlopen(HISTORY_URL) as resp:
120111 builds = csv.DictReader(iterdecode(resp, 'utf-8'))
112+ builds = list(builds)
113+ builds.append(get_latest_ungoogled_chromium_build())
121114 for build in builds:
122115 channel_name = build['channel']
123116
@@ -134,13 +127,18 @@ with urlopen(HISTORY_URL) as resp:
134127 continue
135128
136129 channel = {'version': build['version']}
137− suffix = 'unstable' if channel_name == 'dev' else channel_name
130+ if channel_name == 'dev':
131+ google_chrome_suffix = 'unstable'
132+ elif channel_name == 'ungoogled-chromium':
133+ google_chrome_suffix = 'stable'
134+ else:
135+ google_chrome_suffix = channel_name
138136
139137 try:
140138 channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{build["version"]}.tar.xz')
141139 channel['sha256bin64'] = nix_prefetch_url(
142− f'{DEB_URL}/google-chrome-{suffix}/' +
143− f'google-chrome-{suffix}_{build["version"]}-1_amd64.deb')
140+ f'{DEB_URL}/google-chrome-{google_chrome_suffix}/' +
141+ f'google-chrome-{google_chrome_suffix}_{build["version"]}-1_amd64.deb')
144142 except subprocess.CalledProcessError:
145143 # This build isn't actually available yet. Continue to
146144 # the next one.
@@ -149,6 +147,12 @@ with urlopen(HISTORY_URL) as resp:
149147 channel['deps'] = get_channel_dependencies(channel['version'])
150148 if channel_name == 'stable':
151149 channel['chromedriver'] = get_matching_chromedriver(channel['version'])
150+ elif channel_name == 'ungoogled-chromium':
151+ ungoogled_repo_url = 'https://github.com/Eloston/ungoogled-chromium.git'
152+ channel['deps']['ungoogled-patches'] = {
153+ 'rev': build['ungoogled_tag'],
154+ 'sha256': nix_prefetch_git(ungoogled_repo_url, build['ungoogled_tag'])['sha256']
155+ }
152156
153157 channels[channel_name] = channel
154158
@@ -167,8 +171,6 @@ with open(JSON_PATH, 'w') as out:
167171 return 3
168172 print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr)
169173 sys.exit(1)
170− # Get the special ungoogled-chromium channel:
171− channels['ungoogled-chromium'] = get_ungoogled_chromium_channel()
172174 sorted_channels = OrderedDict(sorted(channels.items(), key=get_channel_key))
173175 json.dump(sorted_channels, out, indent=2)
174176 out.write('\n')
pkgs/applications/networking/browsers/chromium/upstream-info.json+1
@@ -46,6 +46,7 @@
4646 "ungoogled-chromium": {
4747 "version": "87.0.4280.88",
4848 "sha256": "1h09g9b2zxad85vd146ymvg3w2kpngpi78yig3dn1vrmhwr4aiiy",
49+ "sha256bin64": "0n3fm6wf8zfkv135d50xl8xxrnng3q55vyxkck1da8jyvh18bijb",
4950 "deps": {
5051 "gn": {
5152 "version": "2020-09-09",