cargo: patch zstd-sys to use system library
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
cd3b9a068f
commit
d04c67b8a9
|
@ -43,3 +43,6 @@ pam-sys = "0.5"
|
||||||
pam = "0.7"
|
pam = "0.7"
|
||||||
zstd = "0.4"
|
zstd = "0.4"
|
||||||
xdg = "2.2"
|
xdg = "2.2"
|
||||||
|
|
||||||
|
[replace]
|
||||||
|
"zstd-sys:1.4.8" = { path = "zstd-sys" }
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
[package]
|
||||||
|
edition = "2018"
|
||||||
|
name = "zstd-sys"
|
||||||
|
version = "1.4.8"
|
||||||
|
authors = [
|
||||||
|
"Wolfgang Bumiller <w.bumiller@proxmox.com>",
|
||||||
|
]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
bindgen = ">0.42.2"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["legacy"]
|
||||||
|
legacy = []
|
|
@ -0,0 +1,27 @@
|
||||||
|
extern crate bindgen;
|
||||||
|
|
||||||
|
use std::env;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Tell cargo to tell rustc to link the system libzstd
|
||||||
|
println!("cargo:rustc-link-lib=zstd");
|
||||||
|
|
||||||
|
// The bindgen::Builder is the main entry point
|
||||||
|
// to bindgen, and lets you build up options for
|
||||||
|
// the resulting bindings.
|
||||||
|
let bindings = bindgen::Builder::default()
|
||||||
|
.header("wrapper.h")
|
||||||
|
.blacklist_type("max_align_t")
|
||||||
|
.use_core()
|
||||||
|
.rustified_enum(".*")
|
||||||
|
.clang_arg("-DZSTD_STATIC_LINKING_ONLY")
|
||||||
|
.generate()
|
||||||
|
.expect("Unable to generate bindings");
|
||||||
|
|
||||||
|
// Write the bindings to the $OUT_DIR/bindings.rs file.
|
||||||
|
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||||
|
bindings
|
||||||
|
.write_to_file(out_path.join("bindings.rs"))
|
||||||
|
.expect("Couldn't write bindings!");
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
|
#![allow(non_camel_case_types)]
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include <zstd.h>
|
||||||
|
#include <zdict.h>
|
Loading…
Reference in New Issue