summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/rust-librocksdb-sys-unbundled-sources.patch
blob: 24c1932f360369414576387d2bd9129fe0987a53 (plain)
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
adjust from https://sources.debian.org/data/main/r/rust-librocksdb-sys/0.17.1-2/debian/patches/pkgconf

diff -u a/build.rs b/build.rs
--- a/build.rs
+++ b/build.rs
@@ -396,8 +396,13 @@
 }
 
 fn main() {
+    let Ok(rocksdb_lib) = pkg_config::Config::new().atleast_version("10.4.2").probe("rocksdb") else {
+        panic!("guix: rocksdb library not found");
+    };
+    env::set_var("ROCKSDB_INCLUDE_DIR", &rocksdb_lib.include_paths[0]);
+    env::set_var("ROCKSDB_LIB_DIR", &rocksdb_lib.link_paths[0]);
     if !Path::new("rocksdb/AUTHORS").exists() {
-        update_submodules();
+        // update_submodules();
     }
     bindgen_rocksdb();
     let target = env::var("TARGET").unwrap();
@@ -417,14 +422,14 @@
         }
 
         println!("cargo:rerun-if-changed=rocksdb/");
-        fail_on_empty_directory("rocksdb");
+        // fail_on_empty_directory("rocksdb");
         build_rocksdb();
     }
-    if cfg!(feature = "snappy") && !try_to_find_and_link_lib("SNAPPY") {
-        println!("cargo:rerun-if-changed=snappy/");
-        fail_on_empty_directory("snappy");
-        build_snappy();
-    }
+    // if cfg!(feature = "snappy") && !try_to_find_and_link_lib("SNAPPY") {
+    //     println!("cargo:rerun-if-changed=snappy/");
+    //     fail_on_empty_directory("snappy");
+    //     build_snappy();
+    // }
 
     // Allow dependent crates to locate the sources and output directory of
     // this crate. Notably, this allows a dependent crate to locate the RocksDB

diff -u a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -48,7 +48,7 @@
     "static",
     "bindgen/runtime",
 ]
-io-uring = ["pkg-config"]
+io-uring = []
 jemalloc = ["tikv-jemalloc-sys"]
 lto = []
 lz4 = ["lz4-sys"]
@@ -115,4 +115,4 @@
 
 [build-dependencies.pkg-config]
 version = "0.3"
-optional = true
+