tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
obs-studio: Fix compilation with latest CEF
V
4 years ago
40e8cd72
41756934
+70
3 changed files
expand all
collapse all
unified
split
pkgs
applications
video
obs-studio
Change-product_version-to-user_agent_product.patch
Enable-file-access-and-universal-access-for-file-URL.patch
default.nix
+26
pkgs/applications/video/obs-studio/Change-product_version-to-user_agent_product.patch
···
1
1
+
From 635772c4c5ecf11a0f84e6c9fc273dce6b9a5688 Mon Sep 17 00:00:00 2001
2
2
+
From: V <v@anomalous.eu>
3
3
+
Date: Thu, 10 Jun 2021 18:36:22 +0200
4
4
+
Subject: [PATCH] Change product_version to user_agent_product
5
5
+
6
6
+
This is its name as of CEF 91.1.0.
7
7
+
---
8
8
+
obs-browser-plugin.cpp | 2 +-
9
9
+
1 file changed, 1 insertion(+), 1 deletion(-)
10
10
+
11
11
+
diff --git a/obs-browser-plugin.cpp b/obs-browser-plugin.cpp
12
12
+
index 1a6a009..5eb379e 100644
13
13
+
--- a/plugins/obs-browser/obs-browser-plugin.cpp
14
14
+
+++ b/plugins/obs-browser/obs-browser-plugin.cpp
15
15
+
@@ -298,7 +298,7 @@ static void BrowserInit(void)
16
16
+
prod_ver << std::to_string(obs_maj) << "." << std::to_string(obs_min)
17
17
+
<< "." << std::to_string(obs_pat);
18
18
+
19
19
+
- CefString(&settings.product_version) = prod_ver.str();
20
20
+
+ CefString(&settings.user_agent_product) = prod_ver.str();
21
21
+
22
22
+
#ifdef USE_QT_LOOP
23
23
+
settings.external_message_pump = true;
24
24
+
--
25
25
+
2.31.1
26
26
+
+36
pkgs/applications/video/obs-studio/Enable-file-access-and-universal-access-for-file-URL.patch
···
1
1
+
From 0de0a90f8fe5e1e48fa4ec7aa7c825ef88770f9d Mon Sep 17 00:00:00 2001
2
2
+
From: Ryan Foster <RytoEX@gmail.com>
3
3
+
Date: Mon, 9 Sep 2019 23:55:02 -0400
4
4
+
Subject: [PATCH] Enable file access and universal access for file URLs
5
5
+
6
6
+
When loading a local file, instead of disabling CEF's web security,
7
7
+
enable file access and universal access for file URLs. This should allow
8
8
+
local files to make CORS requests without completely disabling CEF's
9
9
+
security model.
10
10
+
---
11
11
+
obs-browser-source.cpp | 9 ++++++---
12
12
+
1 file changed, 6 insertions(+), 3 deletions(-)
13
13
+
14
14
+
diff --git a/obs-browser-source.cpp b/obs-browser-source.cpp
15
15
+
index ab1181e..c775283 100644
16
16
+
--- a/plugins/obs-browser/obs-browser-source.cpp
17
17
+
+++ b/plugins/obs-browser/obs-browser-source.cpp
18
18
+
@@ -179,9 +179,12 @@ bool BrowserSource::CreateBrowser()
19
19
+
20
20
+
#if ENABLE_LOCAL_FILE_URL_SCHEME
21
21
+
if (is_local) {
22
22
+
- /* Disable web security for file:// URLs to allow
23
23
+
- * local content access to remote APIs */
24
24
+
- cefBrowserSettings.web_security = STATE_DISABLED;
25
25
+
+ /* Enable file access and universal access from file://
26
26
+
+ * URLs to allow local content access to remote APIs */
27
27
+
+ cefBrowserSettings.file_access_from_file_urls =
28
28
+
+ STATE_ENABLED;
29
29
+
+ cefBrowserSettings.universal_access_from_file_urls =
30
30
+
+ STATE_ENABLED;
31
31
+
}
32
32
+
#endif
33
33
+
34
34
+
--
35
35
+
2.31.1
36
36
+
+8
pkgs/applications/video/obs-studio/default.nix
···
53
53
fetchSubmodules = true;
54
54
};
55
55
56
56
+
patches = [
57
57
+
# Lets obs-browser build against CEF 90.1.0+
58
58
+
./Enable-file-access-and-universal-access-for-file-URL.patch
59
59
+
60
60
+
# Lets obs-browser build against CEF 91.1.0+
61
61
+
./Change-product_version-to-user_agent_product.patch
62
62
+
];
63
63
+
56
64
nativeBuildInputs = [ addOpenGLRunpath cmake pkg-config ];
57
65
58
66
buildInputs = [