Skip to content

Commit 530593a

Browse files
authored
Merge pull request #10 from molpopgen/replace_tskit_submodule_with_stable_version
Replace tskit submodule with stable version
2 parents ea041b0 + de58df8 commit 530593a

File tree

23 files changed

+24281
-23
lines changed

23 files changed

+24281
-23
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This package provides the following:
1818

1919
The overview is:
2020

21-
1. `tskit` and `kastore` are submodules.
21+
1. `tskit` and `kastore` source from `tskit 0.3.4` are include in `subprojects/`
2222
2. These two tools are compiled into the `rust` package.
2323
3. Then `bindgen` generates the bindings.
2424
4. Finally, the entire rust package is generated.

build.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ fn main() {
55
pkg_config::Config::new().atleast_version("1.2");
66

77
let src = [
8-
"subprojects/tskit/c/tskit/convert.c",
9-
"subprojects/tskit/c/tskit/core.c",
10-
"subprojects/tskit/c/tskit/genotypes.c",
11-
"subprojects/tskit/c/tskit/haplotype_matching.c",
12-
"subprojects/tskit/c/tskit/stats.c",
13-
"subprojects/tskit/c/tskit/tables.c",
14-
"subprojects/tskit/c/tskit/trees.c",
15-
"subprojects/tskit/c/subprojects/kastore/kastore.c",
8+
"subprojects/tskit/tskit/convert.c",
9+
"subprojects/tskit/tskit/core.c",
10+
"subprojects/tskit/tskit/genotypes.c",
11+
"subprojects/tskit/tskit/haplotype_matching.c",
12+
"subprojects/tskit/tskit/stats.c",
13+
"subprojects/tskit/tskit/tables.c",
14+
"subprojects/tskit/tskit/trees.c",
15+
"subprojects/kastore/kastore.c",
1616
];
1717

18-
let tskit_path = Path::new("subprojects/tskit/c");
19-
let kastore_path = Path::new("subprojects/tskit/c/subprojects/kastore");
18+
let tskit_path = Path::new("subprojects/tskit/");
19+
let kastore_path = Path::new("subprojects/kastore/");
2020
let mut builder = cc::Build::new();
2121
let build = builder
2222
.files(src.iter())
@@ -32,8 +32,8 @@ fn main() {
3232
// The input header we would like to generate
3333
// bindings for.
3434
.header("wrapper.h")
35-
.clang_arg("-Isubprojects/tskit/c")
36-
.clang_arg("-Isubprojects/tskit/c/subprojects/kastore")
35+
.clang_arg("-Isubprojects/tskit")
36+
.clang_arg("-Isubprojects/kastore")
3737
.whitelist_type("tsk.*")
3838
.whitelist_function("tsk.*")
3939
.whitelist_type("TSK_.*")
@@ -51,8 +51,8 @@ fn main() {
5151
.expect("Unable to generate bindings");
5252

5353
// Write the bindings to the $OUT_DIR/bindings.rs file.
54-
//let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
54+
let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
5555
bindings
56-
.write_to_file("src/auto_bindings.rs")
56+
.write_to_file(out_path.join("auto_bindings.rs"))
5757
.expect("Couldn't write bindings!");
5858
}

src/bindings.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
//! Those docs describe the most important parts of the C API.
2525
//! This module contains the same types/functions with the same names.
2626
27-
// re-export the auto-generate bindings
28-
pub use crate::auto_bindings::*;
27+
include!(concat!(env!("OUT_DIR"), "/auto_bindings.rs"));
2928

3029
// tskit defines this via a type cast
3130
// in a macro. bindgen thus misses it.

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
pub mod bindings;
88

9-
mod auto_bindings;
10-
119
mod _macros; // Starts w/_ to be sorted at front by rustfmt!
1210
mod edge_table;
1311
pub mod error;

0 commit comments

Comments
 (0)