Skip to content

Commit 9c2bf78

Browse files
committed
Fix packaging issues
1 parent 66b68f5 commit 9c2bf78

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

Cargo.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ include = [
2424
"src/*.c",
2525
"src/zlib/*.[ch]",
2626
"src/zlib/*.pc.in",
27+
# zlib-ng
28+
"src/zlib-ng/**.[ch]",
29+
"src/zlib-ng/arch/arm/**.[ch]",
30+
"src/zlib-ng/arch/generic/**.[ch]",
31+
"src/zlib-ng/arch/power/**.[ch]",
32+
"src/zlib-ng/arch/riscv/**.[ch]",
33+
"src/zlib-ng/arch/s390x/**.[ch]",
34+
"src/zlib-ng/arch/x86/**.[ch]",
35+
"src/zlib-ng/*.[ch].in",
36+
"src/zlib-ng/*.pc.in",
37+
"src/zlib-ng/zlib_name_mangling.h.empty",
38+
# zlib-ng cmake
39+
"src/zlib-ng/CMakeLists.txt",
40+
"src/zlib-ng/zlib.pc.cmakein",
41+
"src/zlib-ng/cmake",
2742
]
2843

2944
[workspace]
@@ -39,7 +54,7 @@ libc = { version = "0.2.43", optional = true }
3954

4055
[build-dependencies]
4156
pkg-config = "0.3.9"
42-
cc = "1.0.18"
57+
cc = "1.0.97"
4358
cmake = { version = "0.1.50", optional = true }
4459
vcpkg = "0.2"
4560

zng/cc.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ struct Build {
1111

1212
impl Build {
1313
fn new(cfg: cc::Build) -> Self {
14-
let is_msvc = cfg.get_compiler().is_like_msvc();
14+
// cc currently has a bug where they create a named temp file in a directory
15+
// without ensuring the directory exists first, so apply this workaround
16+
// until it can be fixed upstream
17+
let mut pb = PathBuf::from(env::var_os("OUT_DIR").expect("this should always be set"));
18+
pb.push("lib");
19+
if let Err(err) = std::fs::create_dir_all(&pb) {
20+
panic!("failed to create {:?}: {}", pb, err);
21+
}
22+
23+
let is_msvc = cfg.try_get_compiler().unwrap().is_like_msvc();
24+
1525
Self { cfg, is_msvc }
1626
}
1727

0 commit comments

Comments
 (0)