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. */
-
