File: pkg-config_and_bindgen.diff

package info (click to toggle)
rust-zstd-sys 2.0.13-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: ansic: 57; makefile: 4
file content (115 lines) | stat: -rw-r--r-- 2,787 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Description: Use Debian packaged zstd
Last-Update: 2023-02-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/zstd.h
+++ b/zstd.h
@@ -1,3 +1 @@
-#ifdef PKG_CONFIG
-
 /* Just use installed headers */
@@ -7,15 +5 @@
 #endif  // #ifdef ZSTD_RUST_BINDINGS_EXPERIMENTAL
-
-#else // #ifdef PKG_CONFIG
-
-#include "zstd/lib/zstd.h"
-#ifdef ZSTD_RUST_BINDINGS_EXPERIMENTAL
-#include "zstd/lib/zstd_errors.h"
-#endif // #ifdef ZSTD_RUST_BINDINGS_EXPERIMENTAL
-
-#endif // #ifdef PKG_CONFIG
-
-
-/* This file is used to generate bindings for both headers.
- * Check update_bindings.sh to see how to use it.
- * Or use the `bindgen` feature, which will create the bindings automatically. */
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -58,8 +58,2 @@
 ]
-optional = true
-default-features = false
-
-[build-dependencies.cc]
-version = "1.0.45"
-features = ["parallel"]
 
--- a/build.rs
+++ b/build.rs
@@ -4,3 +4,2 @@
 
-#[cfg(feature = "bindgen")]
 fn generate_bindings(defs: Vec<&str>, headerpaths: Vec<PathBuf>) {
@@ -38,5 +37,2 @@
 
-#[cfg(not(feature = "bindgen"))]
-fn generate_bindings(_: Vec<&str>, _: Vec<PathBuf>) {}
-
 fn pkg_config() -> (Vec<&'static str>, Vec<PathBuf>) {
@@ -50,3 +46,3 @@
 
-#[cfg(not(feature = "legacy"))]
+/*#[cfg(not(feature = "legacy"))]
 fn set_legacy(_config: &mut cc::Build) {}
@@ -86,5 +82,5 @@
     }
-}
+}*/
 
-fn compile_zstd() {
+/*fn compile_zstd() {
     let mut config = cc::Build::new();
@@ -236,3 +232,3 @@
     cargo_print(&format_args!("root={}", dst.display()));
-}
+}*/
 
@@ -259,7 +255,7 @@
     // println!("cargo:rustc-link-lib=zstd");
-    let (defs, headerpaths) = if cfg!(feature = "pkg-config")
+    let (defs, headerpaths) = /*if cfg!(feature = "pkg-config")
         || env::var_os("ZSTD_SYS_USE_PKG_CONFIG").is_some()
-    {
+    {*/
         pkg_config()
-    } else {
+    /*} else {
         if !Path::new("zstd/lib").exists() {
@@ -275,3 +271,3 @@
         (vec![], vec![manifest_dir.join("zstd/lib")])
-    };
+    }*/;
 
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,5 +15,5 @@
 // If running bindgen, we'll end up with the correct bindings anyway.
-#[cfg(feature = "bindgen")]
 include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
 
+/*
 // The bindings used depend on a few feature flags.
@@ -38 +38,2 @@
 include!("bindings_zdict_experimental.rs");
+*/
--- a/zdict.h
+++ b/zdict.h
@@ -1,17 +1,2 @@
-#ifdef PKG_CONFIG
-
 /* Just use installed headers */
 #include <zdict.h>
-// Don't use experimental features like zstdmt
-
-#else // #ifdef PKG_CONFIG
-
-#include "zstd/lib/zdict.h"
-
-#endif // #ifdef PKG_CONFIG
-
-
-/* This file is used to generate bindings for both headers.
- * Check update_bindings.sh to see how to use it.
- * Or use the `bindgen` feature, which will create the bindings automatically. */
-