summaryrefslogtreecommitdiff
diff options
-rw-r--r--patches/old-bindgen.patch132
-rw-r--r--patches/rust-mess.patch65
-rw-r--r--patches/series2
3 files changed, 66 insertions, 133 deletions
diff --git a/patches/old-bindgen.patch b/patches/old-bindgen.patch
deleted file mode 100644
index 8c85f5a..0000000
--- a/patches/old-bindgen.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-author: Andres Salomon <dilinger@debian.org>
-author: Nathan Pratta Teodosio <nteodosio@ubuntu.com>
-description: fix bindgen-related stuff
-
-Two separate but related fixes:
-
-Crabbyav1f is calling bindgen features which are not currently in
-bookworm or sid; --allowlist-item was added in bindgen 0.68. As far
-as I can tell the build.rs stuff calls allowlist_item from there as
-well, so these arguments may just be redundant? Hopefully I'm not
-breaking stuff.. Drop this for sid once bindgen gets upgraded.
-
-
-Also, the call to bindgen sets the path for libclang to
-rust_bindgen_root, which is wrong. We're already passing
-clang_base_path with the path to libclang, there's no reason that
-we'd expect libclang to be in the same directory as bindgen. That
-fix should probably go upstream.
-
-Last-Update by Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
-Fri, 13 Sep 2024 12:59:14 +0200
-
---- a/third_party/crabbyavif/BUILD.gn
-+++ b/third_party/crabbyavif/BUILD.gn
-@@ -13,13 +13,4 @@
- "no-doc-comments",
- "generate=functions,types,vars,methods,constructors,destructors",
-- "allowlist-item=dav1d_close",
-- "allowlist-item=dav1d_data_unref",
-- "allowlist-item=dav1d_data_wrap",
-- "allowlist-item=dav1d_default_settings",
-- "allowlist-item=dav1d_error",
-- "allowlist-item=dav1d_get_picture",
-- "allowlist-item=dav1d_open",
-- "allowlist-item=dav1d_picture_unref",
-- "allowlist-item=dav1d_send_data",
- ]
- }
-@@ -37,65 +37,6 @@ rust_bindgen("crabbyavif_dav1d_bindings"
- bindgen_flags = [
- "no-doc-comments",
- "generate=functions,types,vars,methods,constructors,destructors",
-- "allowlist-item=AR30ToAB30",
-- "allowlist-item=ARGBToABGR",
-- "allowlist-item=ARGBAttenuate",
-- "allowlist-item=ARGBUnattenuate",
-- "allowlist-item=Convert16To8Plane",
-- "allowlist-item=FilterMode",
-- "allowlist-item=FilterMode_kFilterBilinear",
-- "allowlist-item=FilterMode_kFilterBox",
-- "allowlist-item=FilterMode_kFilterNone",
-- "allowlist-item=HalfFloatPlane",
-- "allowlist-item=I010AlphaToARGBMatrix",
-- "allowlist-item=I010AlphaToARGBMatrixFilter",
-- "allowlist-item=I010ToARGBMatrix",
-- "allowlist-item=I010ToARGBMatrixFilter",
-- "allowlist-item=I012ToARGBMatrix",
-- "allowlist-item=I210AlphaToARGBMatrix",
-- "allowlist-item=I210AlphaToARGBMatrixFilter",
-- "allowlist-item=I210ToARGBMatrix",
-- "allowlist-item=I210ToARGBMatrixFilter",
-- "allowlist-item=I400ToARGBMatrix",
-- "allowlist-item=I410AlphaToARGBMatrix",
-- "allowlist-item=I410ToARGBMatrix",
-- "allowlist-item=I420AlphaToARGBMatrix",
-- "allowlist-item=I420AlphaToARGBMatrixFilter",
-- "allowlist-item=I420ToARGBMatrix",
-- "allowlist-item=I420ToARGBMatrixFilter",
-- "allowlist-item=I420ToRGB24Matrix",
-- "allowlist-item=I420ToRGB24MatrixFilter",
-- "allowlist-item=I420ToRGB565Matrix",
-- "allowlist-item=I420ToRGBAMatrix",
-- "allowlist-item=I422AlphaToARGBMatrix",
-- "allowlist-item=I422AlphaToARGBMatrixFilter",
-- "allowlist-item=I422ToARGBMatrix",
-- "allowlist-item=I422ToARGBMatrixFilter",
-- "allowlist-item=I422ToRGB24MatrixFilter",
-- "allowlist-item=I422ToRGB565Matrix",
-- "allowlist-item=I422ToRGBAMatrix",
-- "allowlist-item=I444AlphaToARGBMatrix",
-- "allowlist-item=I444ToARGBMatrix",
-- "allowlist-item=I444ToRGB24Matrix",
-- "allowlist-item=NV12ToARGBMatrix",
-- "allowlist-item=NV21ToARGBMatrix",
-- "allowlist-item=P010ToAR30Matrix",
-- "allowlist-item=P010ToARGBMatrix",
-- "allowlist-item=ScalePlane",
-- "allowlist-item=ScalePlane_12",
-- "allowlist-item=YuvConstants",
-- "allowlist-item=kYuv2020Constants",
-- "allowlist-item=kYuvF709Constants",
-- "allowlist-item=kYuvH709Constants",
-- "allowlist-item=kYuvI601Constants",
-- "allowlist-item=kYuvJPEGConstants",
-- "allowlist-item=kYuvV2020Constants",
-- "allowlist-item=kYvu2020Constants",
-- "allowlist-item=kYvuF709Constants",
-- "allowlist-item=kYvuH709Constants",
-- "allowlist-item=kYvuI601Constants",
-- "allowlist-item=kYvuJPEGConstants",
-- "allowlist-item=kYvuV2020Constants",
- ]
- }
-
---- a/build/rust/rust_bindgen.gni
-+++ b/build/rust/rust_bindgen.gni
-@@ -18,7 +18,7 @@ if (host_os == "win") {
-
- # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in
- # ../lib.
--_libclang_path = rust_bindgen_root
-+_libclang_path = clang_base_path
- if (host_os == "win") {
- _libclang_path += "/bin"
- } else {
---- a/build/config/compiler/BUILD.gn
-+++ b/build/config/compiler/BUILD.gn
-@@ -1051,5 +1051,4 @@
-
- # We use clang-rt sanitizer runtimes.
-- "-Zexternal-clangrt",
- ]
-
---- a/build/rust/run_bindgen.py
-+++ b/build/rust/run_bindgen.py
-@@ -101,6 +101,4 @@
- else:
- env["LD_LIBRARY_PATH"] = args.ld_library_path
-- if args.libclang_path:
-- env["LIBCLANG_PATH"] = args.libclang_path
- try:
- subprocess.check_call([args.exe, *genargs], env=env)
diff --git a/patches/rust-mess.patch b/patches/rust-mess.patch
new file mode 100644
index 0000000..9b1be20
--- /dev/null
+++ b/patches/rust-mess.patch
@@ -0,0 +1,65 @@
+Author: Nathan Pratta Teodosio <nteodosio@ubuntu.com>
+Description: Removal Rust's Bindgen flags that are too new to be implemented
+ in the Rust bindgens we have
+--- a/third_party/crabbyavif/BUILD.gn
++++ b/third_party/crabbyavif/BUILD.gn
+@@ -13,5 +13,8 @@
+ configs = [ "//third_party/dav1d:dav1d_config" ]
+ output_name = "dav1d_bindgen"
++ bindgen_flags = ["no-doc-comments", "generate=functions,types,vars,methods,constructors,destructors",]
+- bindgen_flags = [
++ junk = []
++ not_needed(["junk"])
++ junk =
+ "no-doc-comments",
+ "generate=functions,types,vars,methods,constructors,destructors",
+@@ -37,5 +37,8 @@ rust_bindgen("crabbyavif_dav1d_bindings"
+ configs = [ "//third_party/libyuv:libyuv_config" ]
+ output_name = "libyuv_bindgen"
++ bindgen_flags = ["no-doc-comments", "generate=functions,types,vars,methods,constructors,destructors",]
+- bindgen_flags = [
++ junk = []
++ not_needed(["junk"])
++ junk = [
+ "no-doc-comments",
+ "generate=functions,types,vars,methods,constructors,destructors",
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -1051,5 +1051,4 @@
+
+ # We use clang-rt sanitizer runtimes.
+- "-Zexternal-clangrt",
+ ]
+
+
+Author: Nathan Pratta Teodosio <nteodosio@ubuntu.com>
+Description: Please, wrapper, do as I say instead of overriding my environment.
+ .
+ We can thereafter remove the last hunk in this patch-set.
+--- a/build/rust/run_bindgen.py
++++ b/build/rust/run_bindgen.py
+@@ -101,6 +101,4 @@
+ else:
+ env["LD_LIBRARY_PATH"] = args.ld_library_path
+- if args.libclang_path:
+- env["LIBCLANG_PATH"] = args.libclang_path
+ try:
+ subprocess.check_call([args.exe, *genargs], env=env)
+
+
+Author: Andres Salomon <dilinger@debian.org>
+Description: The call to bindgen sets the path for libclang to
+ rust_bindgen_root, which is wrong. We're already passing
+ clang_base_path with the path to libclang, there's no reason that
+ we'd expect libclang to be in the same directory as bindgen.
+--- a/build/rust/rust_bindgen.gni
++++ b/build/rust/rust_bindgen.gni
+@@ -18,7 +18,7 @@ if (host_os == "win") {
+
+ # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in
+ # ../lib.
+-_libclang_path = rust_bindgen_root
++_libclang_path = clang_base_path
+ if (host_os == "win") {
+ _libclang_path += "/bin"
+ } else {
diff --git a/patches/series b/patches/series
index 13ce0d0..0ebe14c 100644
--- a/patches/series
+++ b/patches/series
@@ -23,5 +23,5 @@ fix-nss-include.patch
desktop-file-to-local-share-applications.patch
no-widevine.patch
no-unknown-warning.patch
-old-bindgen.patch
+rust-mess.patch
default-visibility-arg.patch